[Env] Add buildFlavor to package info#161930
Conversation
|
Pinging @elastic/kibana-core (Team:Core) |
| buildNum: number; | ||
| buildSha: string; | ||
| buildDate: Date; | ||
| buildFlavor: BuildFlavor; |
There was a problem hiding this comment.
The actual change. Everything else is just adapting the test usages.
| prod: boolean; | ||
| } | ||
|
|
||
| export type BuildFlavor = 'serverless' | 'traditional'; |
There was a problem hiding this comment.
I went with traditional for the "unflavored" version, but I can go with something else if we have a better idea.
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
History
To update your PR or re-run it, just comment with: |
## Summary Add a `buildFavor` property to `Env` (accessible from the plugin's initializer context), Mimicking the idea of ES's `version.buildFlavor` field. Note: this is not supposed to be a replacement for feature flags, but can be useful when wanting to toggle features based on actual capabilities of our serverless product. Also, we already expose this value through the configuration via the `serverless` context value, so it now adds another way to access the information. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Closes #161337 ## Summary Uses build flavor(see #161930) to disable specific Kibana security, spaces, and encrypted saved objects HTTP API routes in serverless (see details in #161337). HTTP APIs that will be public in serverless have been handled in #162523. **IMPORTANT: This PR leaves login, user, and role routes enabled. The primary reason for this is due to several testing mechanisms that rely on basic authentication and custom roles (UI, Cypress). These tests will be modified to use SAML authentication and serverless roles in the immediate future. Once this occurs, we will disable these routes.** ### Testing This PR also implements testing API access in serverless. - The testing strategy for disabled routes in serverless is to verify a `404 not found `response. - The testing strategy for internal access routes in serverless is to verify that without the internal request header (`x-elastic-internal-origin`), a `400 bad request response` is received, then verify that with the internal request header, a `200 ok response` is received. - The strategy for public routes in serverless is to verify a `200 ok` or `203 redirect` is received. ~~blocked by #161930~~ ~~blocked by #162149 for test implementation~~ --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com> Co-authored-by: Aleh Zasypkin <aleh.zasypkin@elastic.co>
Summary
Add a
buildFavorproperty toEnv(accessible from the plugin's initializer context), Mimicking the idea of ES'sversion.buildFlavorfield.Note: this is not supposed to be a replacement for feature flags, but can be useful when wanting to toggle features based on actual capabilities of our serverless product. Also, we already expose this value through the configuration via the
serverlesscontext value, so it now adds another way to access the information.