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

Client gets 401 response from server when attempting to rotate own API key via RotateAPIKey* #78

Open
1 of 3 tasks
sgnn7 opened this issue Oct 29, 2020 · 2 comments
Open
1 of 3 tasks

Comments

@sgnn7
Copy link
Contributor

sgnn7 commented Oct 29, 2020

Summary

Due to the server-side change to not allow changing of the current user's API key via token, our use of RotateAPIKeyRequest will fail when the target roleID is the current user so we should raise an error eraly to notify the user about this.

Steps to Reproduce

Steps to reproduce the behavior:

  • Initialize a client against a Conjur instance
  • Run client.RotateAPIKey(roleID) or client.RotateAPIKeyReader(roleID)

Expected Results

User-friendly error

Actual Results (including error logs, if applicable)

401 error from the server

Reproducible

  • Always
  • Sometimes
  • Non-Reproducible

Version/Tag number

0.6.0

Environment setup

N/A

Additional Information

N/A

@sgnn7 sgnn7 self-assigned this Oct 29, 2020
@sgnn7 sgnn7 changed the title Disallow rotating own key via RotateAPIKey* Throw error when rotating own key via RotateAPIKey* Oct 29, 2020
@izgeri izgeri changed the title Throw error when rotating own key via RotateAPIKey* Client gets 401 response from server when attempting to rotate own API key via RotateAPIKey* Nov 2, 2020
@izgeri
Copy link
Contributor

izgeri commented Nov 2, 2020

Note: there is a workaround until we fix this in #79 by sending a direct API request to this route

@sgnn7
Copy link
Contributor Author

sgnn7 commented Nov 18, 2020

PR #83 contains partial work on this. The remaining logic for it needs to be written to take the newly-added username, compare it to the target of rotation, and error out if they are the same. Changelog will also need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants