Prepare the Security domain HTTP APIs for Serverless#162087
Prepare the Security domain HTTP APIs for Serverless#162087azasypkin merged 71 commits intoelastic:mainfrom
Conversation
| externalRouter, | ||
| const buildFlavor = this.initializerContext.env.packageInfo.buildFlavor; | ||
| const router = core.http.createRouter<SpacesRequestHandlerContext>(); | ||
| if (buildFlavor !== 'serverless') { |
There was a problem hiding this comment.
I opted to make decisions as high-level as possible so we don't have to dig into each route to understand the impact of the build flavor.
There was a problem hiding this comment.
++, over time, if we still use buildFlavor, we might even re-organize our routes to make it easier to toggle them (e.g. common + {non-serverless-name-tbd}-routes)
…-ref HEAD~1..HEAD --fix'
Removes optional authc on catch-all route.
…-ref HEAD~1..HEAD --fix'
|
ACK: will review today or, at the latest, tomorrow. |
| initGetSpaceApi(deps); | ||
| initGetAllSpacesApi(deps); | ||
| initPostSpacesApi(deps); | ||
| initPutSpacesApi(deps); |
There was a problem hiding this comment.
note: iirc, we don't need initPutSpacesApi in Serverless for now as well.
| body: { | ||
| providerType: 'basic', | ||
| providerName: isLocalhost(url.hostname) ? 'basic' : 'cloud-basic', | ||
| providerName: 'basic', |
There was a problem hiding this comment.
@jeramysoucy why do we need to make this change? I thought it was intentionally done like that to support tests in ESS?
There was a problem hiding this comment.
Checked with Larry and got more context around the issue you were trying to solve here - sounds good to me. We can re-consider it in the future if we need to.
…al implementation detatail of Saml Tools.
…not needed for functional tests.
💚 Build Succeeded
Metrics [docs]Canvas Sharable Runtime
History
To update your PR or re-run it, just comment with: cc @jeramysoucy |
* main: (150 commits) Fixes unnecessary autocompletes on HTTP methods (elastic#163233) [Defend Workflows] Convert filterQuery to kql (elastic#161806) [Fleet] copy `inactivity_timeout` when duplicating agent policy (elastic#164544) Fix 7.17 forward compatibility with 8.2+ (elastic#164274) [ML] Fixes dark mode in flyouts and modals (elastic#164399) [Defend Workflows]Changes to policy settings are not persistent until a refresh (elastic#164403) [Security Solution][Endpoint] Fixes kibana crash when going back to policy details page (elastic#164329) Prepare the Security domain HTTP APIs for Serverless (elastic#162087) skip failing test suite (elastic#160986) [Security Solution] Fix flaky Event Filters test (elastic#164473) [EDR workflows] Osquery serverless tests (elastic#163795) [Fleet] Only show agent dashboard links if there is more than one non-server agent and if the dashboards exist (elastic#164469) [Chrome UI] Fix background color in serverless (elastic#164419) [DOCS] Saved objects - resolve import errors API (elastic#162825) Remove 'Create Rule' button from Rule Group page (elastic#164167) [Security Solution] expandable flyout - fix infinite loop in correlations (elastic#163450) [Remote Clusters] Update copy about port help text (elastic#164442) [api-docs] 2023-08-23 Daily api_docs build (elastic#164524) [data views] Disable scripted fields in serverless environment (elastic#163228) [Reporting] Fix - show diagnostic only when image reporting is enabled (elastic#164336) ...
…lastic#162087)"" This reverts commit 35e777e.
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.
404 not foundresponse.x-elastic-internal-origin), a400 bad request responseis received, then verify that with the internal request header, a200 ok responseis received.200 okor203 redirectis received.blocked by #161930blocked by #162149 for test implementation