mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.10`: - [[HTTP] Allow for internal requests to also specify special query param `elasticInternalOrigin` (#163796)](https://github.com/elastic/kibana/pull/163796) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jean-Louis Leysens","email":"jeanlouis.leysens@elastic.co"},"sourceCommit":{"committedDate":"2023-08-21T09:55:33Z","message":"[HTTP] Allow for internal requests to also specify special query param `elasticInternalOrigin` (#163796)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/163678\r\n\r\n* Raise the notion of \"internal\" into `CoreKibanaRequest`. This enables\r\nus to share this with lifecycle handlers and control validation of query\r\nparams\r\n* Added new `isInternalRequest` alongside `isSystemRequest` and\r\n`isFakeRequest`\r\n* Slight simplification to existing internal restriction check\r\n* Some other chores and minor fixes\r\n\r\n## Test\r\n\r\n* Start ES with `yarn es serverless` and Kibana with `yarn start\r\n--serverless --server.restrictInternalApis=true`\r\n* Add the service account token to `kibana.dev.yml`:\r\n`elasticsearch.serviceAccountToken: <SAT>`\r\n* Send a request to an internal endpoint like: `curl -XPOST\r\n-uelastic:changeme http://localhost:5601/<base-path>/api/files/find -H\r\n'kbn-xsrf: foo' -H 'content-type: application/json' -d '{}'`\r\n * Should give you a 400 result\r\n* message like `{\"statusCode\":400,\"error\":\"Bad Request\",\"message\":\"uri\r\n[http://localhost:5603/api/files/find] with method [post] exists but is\r\nnot available with the current configuration\"}`\r\n* Send the same request, but include the query param:\r\n`elasticInternalOrigin=true`\r\n * Should give you a 200 result\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"23d39555e0d0fc36c760f0c148913db69749cb47","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:http","Team:Core","release_note:skip","v8.10.0","v8.11.0"],"number":163796,"url":"https://github.com/elastic/kibana/pull/163796","mergeCommit":{"message":"[HTTP] Allow for internal requests to also specify special query param `elasticInternalOrigin` (#163796)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/163678\r\n\r\n* Raise the notion of \"internal\" into `CoreKibanaRequest`. This enables\r\nus to share this with lifecycle handlers and control validation of query\r\nparams\r\n* Added new `isInternalRequest` alongside `isSystemRequest` and\r\n`isFakeRequest`\r\n* Slight simplification to existing internal restriction check\r\n* Some other chores and minor fixes\r\n\r\n## Test\r\n\r\n* Start ES with `yarn es serverless` and Kibana with `yarn start\r\n--serverless --server.restrictInternalApis=true`\r\n* Add the service account token to `kibana.dev.yml`:\r\n`elasticsearch.serviceAccountToken: <SAT>`\r\n* Send a request to an internal endpoint like: `curl -XPOST\r\n-uelastic:changeme http://localhost:5601/<base-path>/api/files/find -H\r\n'kbn-xsrf: foo' -H 'content-type: application/json' -d '{}'`\r\n * Should give you a 400 result\r\n* message like `{\"statusCode\":400,\"error\":\"Bad Request\",\"message\":\"uri\r\n[http://localhost:5603/api/files/find] with method [post] exists but is\r\nnot available with the current configuration\"}`\r\n* Send the same request, but include the query param:\r\n`elasticInternalOrigin=true`\r\n * Should give you a 200 result\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"23d39555e0d0fc36c760f0c148913db69749cb47"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163796","number":163796,"mergeCommit":{"message":"[HTTP] Allow for internal requests to also specify special query param `elasticInternalOrigin` (#163796)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/163678\r\n\r\n* Raise the notion of \"internal\" into `CoreKibanaRequest`. This enables\r\nus to share this with lifecycle handlers and control validation of query\r\nparams\r\n* Added new `isInternalRequest` alongside `isSystemRequest` and\r\n`isFakeRequest`\r\n* Slight simplification to existing internal restriction check\r\n* Some other chores and minor fixes\r\n\r\n## Test\r\n\r\n* Start ES with `yarn es serverless` and Kibana with `yarn start\r\n--serverless --server.restrictInternalApis=true`\r\n* Add the service account token to `kibana.dev.yml`:\r\n`elasticsearch.serviceAccountToken: <SAT>`\r\n* Send a request to an internal endpoint like: `curl -XPOST\r\n-uelastic:changeme http://localhost:5601/<base-path>/api/files/find -H\r\n'kbn-xsrf: foo' -H 'content-type: application/json' -d '{}'`\r\n * Should give you a 400 result\r\n* message like `{\"statusCode\":400,\"error\":\"Bad Request\",\"message\":\"uri\r\n[http://localhost:5603/api/files/find] with method [post] exists but is\r\nnot available with the current configuration\"}`\r\n* Send the same request, but include the query param:\r\n`elasticInternalOrigin=true`\r\n * Should give you a 200 result\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"23d39555e0d0fc36c760f0c148913db69749cb47"}},{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co> |
||
---|---|---|
.. | ||
src | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/hapi-mocks
This package contains mocks for @hapi
types