Skip to content

[8.x] [Http] Make HTTP resource routes respond without the versioned header (#195940)#196324

Merged
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-195940
Oct 15, 2024
Merged

[8.x] [Http] Make HTTP resource routes respond without the versioned header (#195940)#196324
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-195940

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…elastic#195940)

## Summary

Follow up on elastic#195464

Adds public route registrar option `httpResource` to distinguish API
routes from routes intended to be used for loading resources, [for
ex](https://github.com/elastic/kibana/blob/bd22f1370fc55179ea6f2737176570176f700b6e/x-pack/plugins/security/server/routes/authentication/oidc.ts#L36).

This enables us to avoid returning the version header
`elastic-api-version` for HTTP resource routes.

It's still possible for API authors to use the versioned router for
things that should be HTTP resources, but it's assumed that all routes
registered through HTTP resources services are:

1. Public
2. Not versioned (focus of this PR)
3. Not documented (done in
elastic#192675)

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 72f3d2d)
@kibanamachine kibanamachine merged commit 0158fec into elastic:8.x Oct 15, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

API count

id before after diff
@kbn/core-http-server 531 532 +1

cc @jloleysens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants