Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve grant validation #3081

Merged
merged 3 commits into from
Mar 16, 2023
Merged

Conversation

jefferai
Copy link
Member

This adds several relationships into the resource package that are then made use of to improve the grant validation that runs during Parse. By understanding mappings between ID and resource type the validation checks can far better align with actual allowed grant formats so we can find several common misunderstandings before they simply result in an authorization failure.

In the future some of these functions could be used in the logic in the actual ACL checks but it's not currently necessary and I don't want to lump that change in with this.

Note that the tests have not meaningfully changed, but they have had to be updated because the stricter validation is actually catching issues.

This adds several relationships into the resource package that are then
made use of to improve the grant validation that runs during Parse. By
understanding mappings between ID and resource type the validation
checks can far better align with actual allowed grant formats so we can
find several common misunderstandings before they simply result in an
authorization failure.

In the future some of these functions could be used in the logic in the
actual ACL checks but it's not currently necessary and I don't want to
lump that change in with this.

Note that the tests have not meaningfully changed, but they _have_ had
to be updated because the stricter validation is actually catching
issues.
@jefferai jefferai force-pushed the jefferai-update-grant-parsing-validation branch from d95b94d to 36f2ae9 Compare March 14, 2023 14:30
@jimlambrt jimlambrt self-requested a review March 14, 2023 14:38
Copy link
Collaborator

@jimlambrt jimlambrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great; great improvement.

One small bit (feel free to ignore) only case 1: in this switch has coverage. It might be nice to have some tests that exercise the other cases.

@jefferai
Copy link
Member Author

Added test, thanks!

@jefferai jefferai merged commit fc664eb into main Mar 16, 2023
@jefferai jefferai deleted the jefferai-update-grant-parsing-validation branch March 16, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants