-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add rule to check if service account is valid #303
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,14 @@ scopes := { | |
| "tiled-writer" in token.claims.aud | ||
| } | ||
|
|
||
| default service_account_for_beamline := false | ||
|
|
||
| service_account_for_beamline if { | ||
| input.beamline == token.claims.beamline | ||
| "tiled-writer" in token.claims.aud | ||
| not token.claims.fedid | ||
| } | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. errors should be used to give the reason why the policy has failed without leaking any privileged information. I see this pattern emerging This might be better than having exception handling in every func like this Another example I can think of is when we were debugging numtracker and there was an extra “/” in the issuer, which caused JWT verification to fail. If we had received a clearer error message from OPA, the debugging process would have been much simpler. |
||
| _session := data.diamond.data.proposals[format_int(input.proposal, 10)].sessions[format_int(input.visit, 10)] | ||
|
|
||
| # Returns the session ID if the subject has write permissions for the | ||
|
|
||
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.
I think this should be moved into a folder name blueapi.
As this authZ check will only be made by blueapi and not by tiled