-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[APM] Use callWithInternalUser for agent configuration endpoints #50211
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
Conversation
💚 Build Succeeded
|
...r/lib/settings/agent_configuration/get_environments/get_existing_environments_for_service.ts
Outdated
Show resolved
Hide resolved
a89032c to
5b7057b
Compare
💔 Build Failed
|
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.
Looking forward to partial application coming to javascript. Will enable us to do cluster.callWithRequest(req, ?, ?). Until then, bind is our friend :)
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 think you should just leave the name as clientAsInternalUser. I find having multiple names for the same thing is often (not always) more confusing that it does good
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.
... and I think asInternalUser everywhere is better than clientAsInternalUser everywhere
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.
Down the line do you think setupRequest should also expose a savedObjects client which takes clientAsInternalUser into account?
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.
Maybe! But I'm not yet 100% sold on the one-role-per-request approach yet 😬
sorenlouv
left a comment
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.
LGTM - only nits 👍
💔 Build Failed
|
27ed01c to
10fb539
Compare
|
Decided on zoom/slack after talking to @kobelb to only use |
sorenlouv
left a comment
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.
Latest changes look good too 👍
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.
Maybe make a helper to make this more readable:
const thirdRoute = getRouteByIndex(2)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.
Or if you wanna get real fancy:
const thirdRoute = getRoute('PUT', '/baz')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.
... or leave it as-is. Probably not worth it.
💔 Build Failed
|
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.
There are a few routes in here without any access: tags:
path: '/api/apm/settings/agent-configuration',
method: 'GET',
path: '/api/apm/settings/agent-configuration/services',
path: '/api/apm/settings/agent-configuration/environments',
path: '/api/apm/settings/agent-configuration/agent_name',
method: 'POST',
path: '/api/apm/settings/agent-configuration/search',
Are there defaults being supplied somewhere?
|
Yes, the default is ` [ 'access:apm'] `. (would love to point you to the
file, but on my phone. I think in server/routes/create_api/index.ts).
Op di 12 nov. 2019 23:36 schreef Brandon Kobel <[email protected]>:
… ***@***.**** commented on this pull request.
------------------------------
In x-pack/legacy/plugins/apm/server/routes/settings/agent_configuration.ts
<#50211 (comment)>:
> @@ -31,6 +31,9 @@ export const agentConfigurationRoute = createRoute(core => ({
export const deleteAgentConfigurationRoute = createRoute(() => ({
There are a few routes in here without any access: tags:
path: '/api/apm/settings/agent-configuration',
method: 'GET',
path: '/api/apm/settings/agent-configuration/services',
path: '/api/apm/settings/agent-configuration/environments',
path: '/api/apm/settings/agent-configuration/agent_name',
method: 'POST',
path: '/api/apm/settings/agent-configuration/search',
Are there default being supplied somewhere?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#50211?email_source=notifications&email_token=AACWDXB4QATJSBPGKYOC2LLQTMVVPA5CNFSM4JL2T6NKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLKBR3A#pullrequestreview-315889900>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACWDXBLZSFANPABDTQHPF3QTMVVPANCNFSM4JL2T6NA>
.
|
|
Thanks @dgieselaar, I see it there now! |
10fb539 to
9ab574d
Compare
💚 Build Succeeded
|
9ab574d to
fa7628e
Compare
💔 Build Failed
|
fa7628e to
fa0606b
Compare
💚 Build Succeeded |
…tic#50211) * [APM] Use callWithInternalUser for agent configuration endpoints Closes elastic#50050. * Review feedback * Use internalClient for agent conf queries only
…tic#50211) * [APM] Use callWithInternalUser for agent configuration endpoints Closes elastic#50050. * Review feedback * Use internalClient for agent conf queries only
Closes #50050.