-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implements 'check' command in API #34
Conversation
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.
Added a couple inline comments. In addition you would need to add the following:
- Update the README and CHANGELOG with your additions
- Add unit test(s) to verify that check_privilege is hitting the Conjur API as expected. Check the CONTRIBUTING docs in this repo for more info on running tests locally.
- In your cyberark-conjur-cli PR, add integration tests which validate the behavior of this branch.
Also feel free to reference similar PRs which have gone in recently.
resource_exists
role_memberships
.DS_Store |
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.
retained .gitignore updates
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |||
## [8.0.0] - 2022-05-25 | |||
|
|||
### Added | |||
- Add support for Check Privilege endpoint | |||
[conjur-api-python#34](https://github.com/cyberark/conjur-api-python/pull/34) |
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.
updated CHANGELOG.md with my additions
conjur_api/http/api.py
Outdated
@@ -182,8 +182,9 @@ async def check_privilege(self, kind: str, resource_id: str, privilege: str, rol | |||
if err.status == 404: | |||
return False | |||
|
|||
return True | |||
raise |
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.
added the raise
to handle other error codes
6e11904
to
95ebbcd
Compare
139d560
to
3f4d645
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.
Looks fantastic overall. Just left a couple minor suggestions.
conjur_api/http/api.py
Outdated
if err.status == 401: | ||
return False |
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 401 should only happen if there's an authentication error, see the conjur docs. This should presumably be raised as an exception.
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.
fixed in most recent update
945e1b7
to
34f66a8
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.
A couple more minor comments
adb7a6f
to
a72e466
Compare
febbc78
to
bc5e667
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!
Desired Outcome
Added functionality for the check command in the API side
Implemented Changes
Connected Issue/Story
ONYX-23082