-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Create API keys with metadata #100682
Create API keys with metadata #100682
Conversation
Pinging @elastic/kibana-security (Team:Security) |
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.
Thanks for putting this together so quickly!
A couple of additional comments:
- Can we update the type definitions for both
CreateAPIKeyParams
andGrantAPIKeyParams
within the server-side api key service to allow formetadata
to be provided? This is part of the plugin's public contract that is consumed elsewhere, so it'd be good to record that we do in fact support metadata:
export interface CreateAPIKeyParams { name: string; role_descriptors: Record<string, any>; expiration?: string; } interface GrantAPIKeyParams { api_key: CreateAPIKeyParams; grant_type: 'password' | 'access_token'; username?: string; password?: string; access_token?: string; } - Can we add an API test to ensure that we can pass metadata through successfully?:
describe('POST /internal/security/api_key', () => { - If you're up for it, we could update the documentation screenshot to include the new metadata toggle:
https://github.com/elastic/kibana/blob/69f013e2fb64544bc9d16d3fe9f4ec6c14ed9c11/docs/user/security/api-keys/images/create-api-key.png
x-pack/plugins/security/public/management/api_keys/api_keys_grid/create_api_key_flyout.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security/public/management/api_keys/api_keys_grid/create_api_key_flyout.tsx
Outdated
Show resolved
Hide resolved
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.
Great work @thomheymann! LGTM once all comments are resolved 👍
Should we update documentation at https://www.elastic.co/guide/en/kibana/current/api-keys.html#create-api-key too?
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!
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Co-authored-by: Thom Heymann <[email protected]>
…sens/kibana into reporting/new-png-pdf-report-type * 'reporting/new-png-pdf-report-type' of github.com:jloleysens/kibana: (46 commits) [Security Solution] Add Ransomware canary advanced policy option (elastic#101068) [Exploratory view] Core web vitals (elastic#100320) [Security solution][Endpoint] Add unit tests for fleet event filters/trusted apps cards (elastic#101034) [Lens] Use a setter function for the dimension panel (elastic#101123) [Index Patterns] Fix return saved index pattern object (elastic#101051) [CI] For PRs, build TS refs before public api docs check (elastic#100791) [Maps] fix line and polygon label regression (elastic#101085) Migrate CCR to new ES JS client. (elastic#100131) [Canvas] Switch Canvas to use React Router (elastic#100579) [Expressions] Use table column ID instead of name when set (elastic#99724) [DOCS] Updates docs landing page (elastic#100749) [DOCS] Corrects typo in step 3 (elastic#101079) [DOCS] Updates runtime example in Discover (elastic#100926) Migrate kibana.autocomplete config to data plugin (elastic#100586) [Uptime] New width/delay definition for waterfall sidebar item tooltip (elastic#100147) [FTR] Use importExport for saved_object/basic archive (elastic#100244) [Fleet] Better input for multi text input in agent policy builder (elastic#101020) [CI] Buildkite support with Baseline pipeline (elastic#100492) [Reporting/Telemetry] Do not send telemetry if we are in screenshot mode (elastic#100388) Create API keys with metadata (elastic#100682) ...
Resolves: #100534
Resolves: #93820
Summary
Added the ability to create API Keys with metadata.
Checklist
Delete any items that are not applicable to this PR.