[Fleet] Handler api key creation errors when Fleet Admin is invalid#84576
[Fleet] Handler api key creation errors when Fleet Admin is invalid#84576nchaulet merged 4 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
jfsiii
left a comment
There was a problem hiding this comment.
The code and screenshots LGTM overall. WDYT about changing the request as KibanaRequest to KibanaRequest.from as mentioned in https://github.com/elastic/sdh-kibana/issues/1009#issuecomment-734192331 ?
|
@jfsiii Just updated from |
Co-authored-by: John Schulz <john.schulz@elastic.co>
jfsiii
left a comment
There was a problem hiding this comment.
Haven't run locally, but the tests & code are clear.
I think we can remove the as cast now that we're using the factory from core.
We still need a |
…lastic#84576) # Conflicts: # x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/components/new_enrollment_key_flyout.tsx # x-pack/test/fleet_api_integration/apis/enrollment_api_keys/crud.ts
* master: [Lens] Show color in flyout instead of auto (elastic#84532) [Lens] Use index pattern through service instead of reading saved object (elastic#84432) Make it possible to use Kibana anonymous authentication provider with ES anonymous access. (elastic#84074) TelemetryCollectionManager: Use X-Pack strategy as an OSS overwrite (elastic#84477) migrate away from rest_total_hits_as_int (elastic#84508) [Input Control] Custom renderer (elastic#84423) Attempt to more granularly separate App Search vs Workplace Search vs shared GitHub notifications (elastic#84713) [Security Solutino][Case] Case connector alert UI (elastic#82405) [Maps] Support runtime fields in tooltips (elastic#84377) [CCR] Fix row actions in follower index and auto-follow pattern tables (elastic#84433) [Enterprise Search] Migrate shared Indexing Status component (elastic#84571) [maps] remove fields from index-pattern test artifacts (elastic#84379) Add routes for use in Sources Schema (elastic#84579) Changes UI links for drilldowns (elastic#83971) endpoint telemetry cloned endpoint tests (elastic#81498) [Fleet] Handler api key creation errors when Fleet Admin is invalid (elastic#84576)
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Summary
Resolve #84412
We use an user
fleet_enrollstored in a saved object to create API keys in Fleet. Currently if this user is updated (like a password change) outside of Fleet, our APIs that used that user will return a 401 and this will cause the current User to be logged out from Kibana.This PR fix this by handling that error and returning a 400 with the message
Fleet Admin user is invalidalso we clear the cache we use to store thefleet_enrolluser.How to test this?
/app/management/security/users/edit/fleet_enroll