[Fleet] Introduce API versioning for serverless#163570
Merged
criamico merged 43 commits intoelastic:mainfrom Sep 5, 2023
Merged
[Fleet] Introduce API versioning for serverless#163570criamico merged 43 commits intoelastic:mainfrom
criamico merged 43 commits intoelastic:mainfrom
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
|
merge conflict between base and head |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @criamico |
ashokaditya
added a commit
to ashokaditya/kibana
that referenced
this pull request
Sep 6, 2023
security_solution data loader scripts using fleet APIs need to move to versioned fleet APIs after changes in elastic/pull/163570 refs elastic/security-team/issues/7547
This was referenced Sep 6, 2023
criamico
added a commit
that referenced
this pull request
Sep 6, 2023
## Summary Related to #163570 Add a section to Readme about option to provide a default version for API headers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add versioning to Fleet APIs in preparation for serverless.
All the Fleet endpoints were made public by default in #163345.
Router.versionedprovided by Kibana core. Our router is a wrapper around it so I had to do some modifications to use the new APIs.If a new version will be released, a new
addVersionblock can be added to the previous.Introduce constants for the versions. These versions will be replaced in the future when new versions of the apis will be released:
API_VERSIONS.public.v1 = 2023-10-31API_VERSIONS.internal.v1 = 1Mark deprecated endpoints as private. List:
GET /api/fleet/agent-statusGET /api/fleet/enrollment-api-keysPOST /api/fleet/enrollment-api-keysGET /api/fleet/enrollment-api-keys/{keyId}DELETE /api/fleet/enrollment-api-keys/{keyId}POST /api/fleet/service-tokensPUT /api/fleet/epm/packages/{pkgkey}DELETE /api/fleet/epm/packages/{pkgkey}Pass these versions through the headers wherever the fleet apis are called (UI, other plugins, tests, etc). These headers have this format:
Notes
This prevents the router to enforce the headers presence for all the public endpoints; internal endpoints however will need it regardless of this flag.
The kibana dev tools still don't accept the new headers, the api calls can be only tested through
curlor equivalent for nowThese deprecated endpoints are still marked as public because if we mark them as internal the router would always choose them over the correspondent public routes.
Testing
Checklist