-
Notifications
You must be signed in to change notification settings - Fork 1
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
split policy reading #81
split policy reading #81
Conversation
dd6ddd5
to
b643fbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -640,3 +659,51 @@ func switchToIsClassifiedBy(toChange []interface{}) []interface{} { | |||
} | |||
return changed | |||
} | |||
|
|||
func isAuthorizedForDelete(r *http.Request, scheduledForDelete interface{}) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
: Unfortunately we didn't write a middleware which calls a specific handle based on the opa evaluation, if we had such, you would have been able to get the annotations, use opa for the access control instead of this custom function, and later call the handler to actually delete the resource, we can think about this in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but if you call the handler in a middleware the annotation will be already deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, no, maybe I didn't make myself clear, imagine a response middleware which only gets the annotation, evaluates if it is eligible for deletion and after that is able to call another handler that deletes the annotation itself.
Description
What
split the policy reading. Before that all the rules were defined in a single auth file, now there are 2 files one for read rules and one for write. I have excluded the get-schema and validation endpoints from the authorization as they are not exposed and to reduce the number of rules.
As this remained not reviewed I had the time to add the authorization for the delete endpoint. Please review thoroughly.
Why
https://financialtimes.atlassian.net/browse/UPPSF-5436
Anything, in particular, you'd like to highlight to reviewers
Mention here sections of code which you would like reviewers to pay extra attention to .E.g
Would appreciate a second pair of eyes on the test
I am not quite sure how this bit works
Is there a better library for doing x
Scope and particulars of this PR (Please tick all that apply)
DoD - Ensure all relevant tasks are completed before marking this PR as "Ready for review"
This Pull Request follows the rules described in our Pull Requests Guide