kibana/packages/core
Jean-Louis Leysens 23d39555e0
[HTTP] Allow for internal requests to also specify special query param elasticInternalOrigin (#163796)
## Summary

Closes https://github.com/elastic/kibana/issues/163678

* Raise the notion of "internal" into `CoreKibanaRequest`. This enables
us to share this with lifecycle handlers and control validation of query
params
* Added new `isInternalRequest` alongside `isSystemRequest` and
`isFakeRequest`
* Slight simplification to existing internal restriction check
* Some other chores and minor fixes

## Test

* Start ES with `yarn es serverless` and Kibana with `yarn start
--serverless --server.restrictInternalApis=true`
* Add the service account token to `kibana.dev.yml`:
`elasticsearch.serviceAccountToken: <SAT>`
* Send a request to an internal endpoint like: `curl -XPOST
-uelastic:changeme http://localhost:5601/<base-path>/api/files/find -H
'kbn-xsrf: foo' -H 'content-type: application/json' -d '{}'`
    * Should give you a 400 result
* message like `{"statusCode":400,"error":"Bad Request","message":"uri
[http://localhost:5603/api/files/find] with method [post] exists but is
not available with the current configuration"}`
* Send the same request, but include the query param:
`elasticInternalOrigin=true`
   *  Should give you a 200 result

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-21 11:55:33 +02:00
..
analytics Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
application [Serverless Chrome] Fix fullscreen (#163317) 2023-08-10 09:08:22 +01:00
apps [HTTP] First pass of making Kibana work with internal restrictions enforced (#162258) 2023-07-26 14:48:06 +02:00
base [Emotion] Order EUI's CSS utilities after Sass styles (#162365) 2023-07-25 10:37:29 -07:00
capabilities [Lens] library annotation groups (#152623) 2023-05-31 16:41:21 -04:00
chrome [Serverless] Chrome UI fixes (#164030) 2023-08-16 17:21:59 -04:00
config/core-config-server-internal Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
custom-branding [Custom Branding] Fetch custom branding on unauthenticated pages (#149207) 2023-01-31 10:01:35 +01:00
deprecations Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
doc-links Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
elasticsearch [Ops] Bump Node.js to version 18 (#160289) 2023-07-27 14:12:48 +02:00
environment Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
execution-context Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
fatal-errors [context] Unify Contexts, deprecate others (#161914) 2023-07-28 09:30:08 -07:00
http [HTTP] Allow for internal requests to also specify special query param elasticInternalOrigin (#163796) 2023-08-21 11:55:33 +02:00
i18n [HTTP] First pass of making Kibana work with internal restrictions enforced (#162258) 2023-07-26 14:48:06 +02:00
injected-metadata [Custom Branding] Fetch custom branding on unauthenticated pages (#149207) 2023-01-31 10:01:35 +01:00
integrations Upgrade EUI to v86.0.0 (#163088) 2023-08-14 15:45:09 -05:00
lifecycle Per User Dark Mode Preference (#151507) 2023-04-25 15:19:20 -04:00
logging Bump jest@29.6.1 (#161630) 2023-07-15 17:42:30 +02:00
metrics Bump jest@29.6.1 (#161630) 2023-07-15 17:42:30 +02:00
mount-utils Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
node Cleanup spread operators in reduce calls (#157471) 2023-05-22 04:50:24 -07:00
notifications [context] Unify Contexts, deprecate others (#161914) 2023-07-28 09:30:08 -07:00
overlays [regression] Handle deprecated KibanaThemeProvider uses to include KibanaRenderContextProvider (#163103) 2023-08-04 09:11:31 -07:00
plugins [Env] Add buildFlavor to package info (#161930) 2023-07-20 03:33:28 -07:00
preboot Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00
rendering [context] Unify Contexts, deprecate others (#161914) 2023-07-28 09:30:08 -07:00
root Bump jest@29.6.1 (#161630) 2023-07-15 17:42:30 +02:00
saved-objects [OAS] Add saved objects openAPI folder (#162522) 2023-08-16 16:01:50 -07:00
status [HTTP] First pass of making Kibana work with internal restrictions enforced (#162258) 2023-07-26 14:48:06 +02:00
test-helpers [modelVersions] add new migration change types (#161147) 2023-07-07 17:18:21 +02:00
theme [context] Unify Contexts, deprecate others (#161914) 2023-07-28 09:30:08 -07:00
ui-settings [uiSettings] use refresh: false instead of default refresh: 'wait_for' in create and update (#160278) 2023-07-25 04:21:28 -07:00
usage-data Implements default Permissions-Policy header (#158514) 2023-06-07 19:48:44 +02:00
user-settings Update CODEOWNERS to proper team (#155865) 2023-04-26 11:22:42 -04:00