Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Caveat update #127

Merged
merged 3 commits into from
Feb 28, 2021
Merged

Caveat update #127

merged 3 commits into from
Feb 28, 2021

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Feb 27, 2021

  • Export CaveatTypes enum
  • Simplify and refactor caveat validation
    • Previously, we did not check that the caveat type was supported. Now we do. A test case has been added.
  • Rename requireParams caveat to requireParamsIsSubset
    • To better reflect the action of the caveat, which is to reject the request if the params aren't a subset of the caveat value.

P.S. My apologies to posterity for the awful commit name.

@rekmarks rekmarks requested a review from a team as a code owner February 27, 2021 22:10
@rekmarks rekmarks merged commit 0d93aae into main Feb 28, 2021
@rekmarks rekmarks deleted the caveat-update branch February 28, 2021 05:11
rekmarks added a commit that referenced this pull request Feb 28, 2021
After merging #127, I realized that I repeated the same mistake I made in #61, which was reverted in #64.

The caveat formerly known as `requireParams` enforces that the request parameters are a _superset_ of the caveat value, and that is the intended behavior. That is clearly very confusing for me, so that caveat is now renamed to `requireParamsIsSuperset`.

This PR reverts the renaming of the superset caveat done in #127, and creates a new `requireParamsIsSubset` caveat, that actually requires that the request parameters are a subset of the caveat value.

Tests have been added.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants