-
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
Ensure all API Keys have a defined name #175721
Conversation
/ci |
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.
LGTM
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
To update your PR or re-run it, just comment with: |
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
## Summary Resolves elastic#173890. API Keys created in the 7.x era did not require a `name` (https://www.elastic.co/guide/en/elasticsearch/reference/7.5/security-api-create-api-key.html#security-api-create-api-key-request-body). The `name` is no longer an optional field, but our UIs have come to assume that a `name` will always be available. This updates our `GET /internal/security/api_key` API to ensure that a `name` will always exist. (cherry picked from commit 707b423)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Followup to #175721. Prefer using the key's `id` when `name` is not defined.
# Backport This will backport the following commits from `main` to `8.12`: - [Ensure all API Keys have a defined name (#175721)](#175721) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Larry Gregory","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-26T20:16:06Z","message":"Ensure all API Keys have a defined name (#175721)\n\n## Summary\r\n\r\nResolves https://github.com/elastic/kibana/issues/173890.\r\n\r\nAPI Keys created in the 7.x era did not require a `name`\r\n(https://www.elastic.co/guide/en/elasticsearch/reference/7.5/security-api-create-api-key.html#security-api-create-api-key-request-body).\r\nThe `name` is no longer an optional field, but our UIs have come to\r\nassume that a `name` will always be available. This updates our `GET\r\n/internal/security/api_key` API to ensure that a `name` will always\r\nexist.","sha":"707b4233898c18e63896581a61ddf8bfb7f20979","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Security","Feature:Users/Roles/API Keys","backport:all-open","v8.13.0"],"title":"Ensure all API Keys have a defined name","number":175721,"url":"https://github.com/elastic/kibana/pull/175721","mergeCommit":{"message":"Ensure all API Keys have a defined name (#175721)\n\n## Summary\r\n\r\nResolves https://github.com/elastic/kibana/issues/173890.\r\n\r\nAPI Keys created in the 7.x era did not require a `name`\r\n(https://www.elastic.co/guide/en/elasticsearch/reference/7.5/security-api-create-api-key.html#security-api-create-api-key-request-body).\r\nThe `name` is no longer an optional field, but our UIs have come to\r\nassume that a `name` will always be available. This updates our `GET\r\n/internal/security/api_key` API to ensure that a `name` will always\r\nexist.","sha":"707b4233898c18e63896581a61ddf8bfb7f20979"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175721","number":175721,"mergeCommit":{"message":"Ensure all API Keys have a defined name (#175721)\n\n## Summary\r\n\r\nResolves https://github.com/elastic/kibana/issues/173890.\r\n\r\nAPI Keys created in the 7.x era did not require a `name`\r\n(https://www.elastic.co/guide/en/elasticsearch/reference/7.5/security-api-create-api-key.html#security-api-create-api-key-request-body).\r\nThe `name` is no longer an optional field, but our UIs have come to\r\nassume that a `name` will always be available. This updates our `GET\r\n/internal/security/api_key` API to ensure that a `name` will always\r\nexist.","sha":"707b4233898c18e63896581a61ddf8bfb7f20979"}}]}] BACKPORT--> Co-authored-by: Larry Gregory <[email protected]>
Followup to elastic#175721. Prefer using the key's `id` when `name` is not defined. (cherry picked from commit 2cf9668)
#175800) # Backport This will backport the following commits from `main` to `8.12`: - [Fallback to using api key id when name is not defined (#175733)](#175733) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Larry Gregory","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-26T22:34:05Z","message":"Fallback to using api key id when name is not defined (#175733)\n\nFollowup to https://github.com/elastic/kibana/pull/175721.\r\n\r\nPrefer using the key's `id` when `name` is not defined.","sha":"2cf9668d5d84448046154e0a070b587385b6fc35","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","Feature:Users/Roles/API Keys","release_note:skip","backport:prev-minor","v8.13.0"],"number":175733,"url":"https://github.com/elastic/kibana/pull/175733","mergeCommit":{"message":"Fallback to using api key id when name is not defined (#175733)\n\nFollowup to https://github.com/elastic/kibana/pull/175721.\r\n\r\nPrefer using the key's `id` when `name` is not defined.","sha":"2cf9668d5d84448046154e0a070b587385b6fc35"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175733","number":175733,"mergeCommit":{"message":"Fallback to using api key id when name is not defined (#175733)\n\nFollowup to https://github.com/elastic/kibana/pull/175721.\r\n\r\nPrefer using the key's `id` when `name` is not defined.","sha":"2cf9668d5d84448046154e0a070b587385b6fc35"}}]}] BACKPORT-->
## Summary Resolves elastic#173890. API Keys created in the 7.x era did not require a `name` (https://www.elastic.co/guide/en/elasticsearch/reference/7.5/security-api-create-api-key.html#security-api-create-api-key-request-body). The `name` is no longer an optional field, but our UIs have come to assume that a `name` will always be available. This updates our `GET /internal/security/api_key` API to ensure that a `name` will always exist.
Followup to elastic#175721. Prefer using the key's `id` when `name` is not defined.
Summary
Resolves #173890.
API Keys created in the 7.x era did not require a
name
(https://www.elastic.co/guide/en/elasticsearch/reference/7.5/security-api-create-api-key.html#security-api-create-api-key-request-body). Thename
is no longer an optional field, but our UIs have come to assume that aname
will always be available. This updates ourGET /internal/security/api_key
API to ensure that aname
will always exist.Update The behavior of this has changed slightly via #175733. Instead of returning an empty
name
, thename
will fallback to the key'sid
.