-
Notifications
You must be signed in to change notification settings - Fork 46
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
Convert role and API management to REST API #107
Conversation
This PR was tested by custom branch build on jenkins |
|
||
/** | ||
* Gets all roles for which the user has read access. This method will not throw an UnauthorizedException if | ||
* a valid API key is used but does not have permission to view any roles. In that case it will return |
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.
What is the reasoning behind not throwing a 403 ? Is it a security measure by design?
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.
It's because there is no overarching permission such as "user has permission to view roles". Instead there are permissions to filter which roles a user can read, such as role|read|your_team|*
. So functionally the service iterates over matching roles and filters out those for which the user doesn't have read permission. As an optimization Emo could check whether any of the user's permissions give her permission to view any possible matching role and return immediately if not (e.g.; pre-check whether the user has any permission starting withrole|read
). Even if this were implemented I'd think it would still return an empty list, otherwise the response would be very confusing. Just because the caller doesn't have permission to view any existing roles today doesn't mean a new role won't be created tomorrow for which she does have read access. So returning 403 today and a list with the one role she has read permission for tomorrow is inconsistent; only the data changed, not her permissions.
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.
Just looked at "Added user access control API and client" commit. Looks great 👍 , just one question.
…ception for invalid permissions
…d requests are the same
This PR was tested by custom branch build on jenkins |
This PR was tested by custom branch build on jenkins |
|
Github Issue
50
What Are We Doing Here?
This unfortunately sizable PR addresses a single purpose: convert role and API key management to a publicly-accessible RESTful front end. As much as possible this was broken into smaller, logical commits. The general flow the PR is:
How to Test and Verify
Risk
High. The actual changes aren't particularly complex, but this PR pulls out the old role and API key management system and replaces it with a new one, so any errors may negatively affect the ability to manage these.
Having said that, the backend for roles and API keys is unchanged, so if there were a breaking issue with the interface the system would still work with the existing set of roles and API keys, but until it were fixed there'd be no way to alter that set.
Level
High
Required Testing
Manual
Code Review Checklist
Tests are included. If not, make sure you leave us a line or two for the reason.
Pulled down the PR and performed verification of at least being able to
build and run.
Well documented, including updates to any necessary markdown files. When
we inevitably come back to this code it will only take hours to figure out, not
days.
Consistent/Clear/Thoughtful? We are better with this code. We also aren't
a victim of rampaging consistency, and should be using this course of action.
We don't have coding standards out yet for this project, so please make sure to address any feedback regarding STYLE so the codebase remains consistent.
PR has a valid summary, and a good description.