-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Failure to instantiate elasticsearchClient.asSecondaryAuthUser with fake request #192004
Labels
bug
Fixes for quality problems that affect the customer experience
core services
Issues related to enabling features across Kibana to leverage core services across domains
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Comments
klacabane
added
bug
Fixes for quality problems that affect the customer experience
core services
Issues related to enabling features across Kibana to leverage core services across domains
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
labels
Sep 3, 2024
Pinging @elastic/kibana-core (Team:Core) |
This was referenced Sep 3, 2024
klacabane
added a commit
that referenced
this issue
Sep 13, 2024
~blocked by #192004 This change adds an `includeState: boolean` option to methods querying entity definitions. When true this adds an `EntityDefinitionState` object containing all the definition components and their state (installed or not) and stats. Since this may only be used internally (eg builtin definition installation process) and for troubleshooting, `includeState` is false by default #### Testing - install a definition - call `GET kbn:/internal/entities/definition/<definition-id>?includeState=true` - check and validate the definition `state` block - manually remove transform/pipeline/template components - check and validate the definition `state` block
gergoabraham
pushed a commit
to gergoabraham/kibana
that referenced
this issue
Sep 13, 2024
…#192394) ## Summary Closes elastic#192004 Calling `client.asSecondaryAuthUser` from a client scoped to a fake request instantiated with `getKibanaFakeRequest` returns the following error: `Error: asSecondaryAuthUser called from a client scoped to a request without 'authorization' header.`. This is because we use the same branch when dealing with a real or fake request and expect the headers to be cached. There are existing tests to verify a fake request works but these requests are raw objects not created through `getKibanaFakeRequest` ### Testing This snippet does not throw ``` const fakeRequest = getFakeKibanaRequest({ id: apiKey.id, api_key: apiKey.apiKey }); const esClient = server.core.elasticsearch.client.asScoped(fakeRequest).asSecondaryAuthUser; ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
gergoabraham
pushed a commit
to gergoabraham/kibana
that referenced
this issue
Sep 13, 2024
~blocked by elastic#192004 This change adds an `includeState: boolean` option to methods querying entity definitions. When true this adds an `EntityDefinitionState` object containing all the definition components and their state (installed or not) and stats. Since this may only be used internally (eg builtin definition installation process) and for troubleshooting, `includeState` is false by default #### Testing - install a definition - call `GET kbn:/internal/entities/definition/<definition-id>?includeState=true` - check and validate the definition `state` block - manually remove transform/pipeline/template components - check and validate the definition `state` block
markov00
pushed a commit
to markov00/kibana
that referenced
this issue
Sep 18, 2024
…#192394) ## Summary Closes elastic#192004 Calling `client.asSecondaryAuthUser` from a client scoped to a fake request instantiated with `getKibanaFakeRequest` returns the following error: `Error: asSecondaryAuthUser called from a client scoped to a request without 'authorization' header.`. This is because we use the same branch when dealing with a real or fake request and expect the headers to be cached. There are existing tests to verify a fake request works but these requests are raw objects not created through `getKibanaFakeRequest` ### Testing This snippet does not throw ``` const fakeRequest = getFakeKibanaRequest({ id: apiKey.id, api_key: apiKey.apiKey }); const esClient = server.core.elasticsearch.client.asScoped(fakeRequest).asSecondaryAuthUser; ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
markov00
pushed a commit
to markov00/kibana
that referenced
this issue
Sep 18, 2024
~blocked by elastic#192004 This change adds an `includeState: boolean` option to methods querying entity definitions. When true this adds an `EntityDefinitionState` object containing all the definition components and their state (installed or not) and stats. Since this may only be used internally (eg builtin definition installation process) and for troubleshooting, `includeState` is false by default #### Testing - install a definition - call `GET kbn:/internal/entities/definition/<definition-id>?includeState=true` - check and validate the definition `state` block - manually remove transform/pipeline/template components - check and validate the definition `state` block
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Sep 24, 2024
…#192394) ## Summary Closes elastic#192004 Calling `client.asSecondaryAuthUser` from a client scoped to a fake request instantiated with `getKibanaFakeRequest` returns the following error: `Error: asSecondaryAuthUser called from a client scoped to a request without 'authorization' header.`. This is because we use the same branch when dealing with a real or fake request and expect the headers to be cached. There are existing tests to verify a fake request works but these requests are raw objects not created through `getKibanaFakeRequest` ### Testing This snippet does not throw ``` const fakeRequest = getFakeKibanaRequest({ id: apiKey.id, api_key: apiKey.apiKey }); const esClient = server.core.elasticsearch.client.asScoped(fakeRequest).asSecondaryAuthUser; ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 0987f70)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Fixes for quality problems that affect the customer experience
core services
Issues related to enabling features across Kibana to leverage core services across domains
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Calling
client.asSecondaryAuthUser
from a client scoped to a fake request returns the following error:Error: asSecondaryAuthUser called from a client scoped to a request without 'authorization' header.
The issue appears to be in this ternary that extracts auth headers from the request. When provided a fake request,
isRealRequest(request)
will return true triggering the wrong branch, leading to empty headers whilerequest.headers
are set.How to reproduce:
The text was updated successfully, but these errors were encountered: