-
Notifications
You must be signed in to change notification settings - Fork 525
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
Add apikey subcommand #3157
Add apikey subcommand #3157
Conversation
Co-Authored-By: Andrew Wilkins <[email protected]>
Co-Authored-By: Andrew Wilkins <[email protected]>
Co-Authored-By: Andrew Wilkins <[email protected]>
Co-Authored-By: Andrew Wilkins <[email protected]>
- Don't print error twice (i.e. by calling printErr and then returning to RunE) For now, just use Run and call os.Exit ourselves. - Update "create" to just pass in the privileges requested for the API Key to HasPrivileges, rather than all of them. - Update "create" to inform the auth'd user of which requested privileges they do not have.
- Revert param type change for authorization.NewBuilder - Add a TODO to stop swallowing all DeletePrivileges errors
Codecov Report
@@ Coverage Diff @@
## master #3157 +/- ##
=========================================
Coverage ? 78.89%
=========================================
Files ? 106
Lines ? 5587
Branches ? 0
=========================================
Hits ? 4408
Misses ? 1179
Partials ? 0
|
- Don't take value of "json" flag before it's resolved - If no privilege flags are specified, pass ActionsAll into createAPIKeyWithPrivileges, not ActionAny.
@@ -8,7 +8,7 @@ apm_server: | |||
privileges: ['sourcemap:write','event:write','config_agent:read'] | |||
resources: '*' | |||
beats: | |||
cluster: ['manage_index_templates','monitor','manage_ingest_pipelines','manage_ilm'] | |||
cluster: ['manage_index_templates','monitor','manage_ingest_pipelines','manage_ilm', 'manage_security','manage_api_key'] |
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.
Why is adding the cluster roles to beats
role necessary?
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 used by a system test that tests what happens when the user can create API keys, but doesn't have the privilege themself.
I'm not sure if beats_user has those privileges normally (I didn't add that bit). If not, I think maybe we should create a user dynamically for this test. In a follow up, preferably.
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 all the major comments were addressed, and we can create a follow up issue for smaller things.
Thanks @jalvz for all the effort you put into that, I think the CLI tool is pretty exhaustive and will be a great support for our users.
Co-authored-by: Andrew Wilkins <[email protected]>
Continuation of #3063