-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTTP/OAS] Make SO CRUD and resolve APIs internal
on serverless
#184408
[HTTP/OAS] Make SO CRUD and resolve APIs internal
on serverless
#184408
Conversation
/ci |
/ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cannot make all the SO APIs public, anywhere!
@@ -143,6 +143,10 @@ export const registerExportRoute = ( | |||
router.post( | |||
{ | |||
path: '/_export', | |||
options: { | |||
access: 'public', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
) => { | ||
const { allowHttpApiAccess } = config; | ||
router.put( | ||
{ | ||
path: '/_bulk_update', | ||
options: { | ||
access, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jloleysens Unless I'm missing some intricate detail, access
will be internal
according to https://github.com/elastic/kibana/pull/184408/files#diff-311e61dcad4f336ae3320406e2a114cc844823d4526d9c52c35c022d47516843R144.
The PR title had me worried you were making ALL the SO APIs public!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access will be set dynamically based on build flavour. Serverless will remain internal and stateful will remain public. This pr just brings those to bear in the code.
@@ -36,6 +36,8 @@ export const registerImportRoute = ( | |||
{ | |||
path: '/_import', | |||
options: { | |||
access: 'public', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
|
||
const internalOnServerless = isServerless ? 'internal' : 'public'; | ||
|
||
registerGetRoute(router, { config, coreUsageData, logger, access: internalOnServerless }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
registerBulkUpdateRoute(router, { config, coreUsageData, logger }); | ||
registerBulkDeleteRoute(router, { config, coreUsageData, logger }); | ||
|
||
const internalOnServerless = isServerless ? 'internal' : 'public'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. We cannot use internalOnServerless
as is to globally define access for ALL the routes. If we do then we'd make every single one public on non-serverless!
We can't do that and still say we're removing them in v9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , this is only used for the APIs documented as public, but that we want internal on serverless. I can add a comment to that effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jloleysens I'll approve this PR as long as we're not contradicting our public docs that clearly state which APIs are deprecated.
public
on stateful and internal
on serverlesspublic
on stateful and internal
on serverless
public
on stateful and internal
on serverlessinternal
on serverless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we're not contradicting our public documentation that lists the APIs that are deprecated, I'm ok with this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving on behalf of core
/ci |
registerBulkCreateRoute(router, { config, coreUsageData, logger, access: internalOnServerless }); | ||
registerBulkResolveRoute(router, { config, coreUsageData, logger, access: internalOnServerless }); | ||
registerBulkUpdateRoute(router, { config, coreUsageData, logger, access: internalOnServerless }); | ||
registerBulkDeleteRoute(router, { config, coreUsageData, logger, access: internalOnServerless }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not add tests for the existing public behaviour as I assume these tests already give us that coverage:
const result = await supertest(httpSetup.server.listener) |
Pinging @elastic/kibana-core (Team:Core) |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]History
To update your PR or re-run it, just comment with: |
Summary
Add a bit of logic to explicitly make SO CRUD + resolve APIs
public
for stateful andinternal
for serverless to bring our OAS in line with our user facing docs. Also added descriptions to APIs (taken from #184184)How to test
See added functional tests.
Related