Skip to content

Conversation

@dgieselaar
Copy link
Member

Closes #50050.

@dgieselaar dgieselaar requested a review from a team as a code owner November 11, 2019 20:49
@dgieselaar dgieselaar added release_note:skip Skip the PR/issue when compiling release notes v7.5.0 labels Nov 11, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar dgieselaar force-pushed the secure-agent-endpoints branch from a89032c to 5b7057b Compare November 12, 2019 10:55
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Member

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 :)

Copy link
Member

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

Copy link
Member

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

Copy link
Member

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?

Copy link
Member Author

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 😬

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - only nits 👍

@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar requested a review from kobelb November 12, 2019 20:20
@dgieselaar dgieselaar force-pushed the secure-agent-endpoints branch from 27ed01c to 10fb539 Compare November 12, 2019 20:20
@dgieselaar
Copy link
Member Author

Decided on zoom/slack after talking to @kobelb to only use callWithInternalUser for the agent configuration index, and callWithRequest for our data indices (apm-*).

Copy link
Member

@sorenlouv sorenlouv left a 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 👍

Copy link
Member

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)

Copy link
Member

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')

Copy link
Member

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.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@kobelb kobelb Nov 12, 2019

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?

@dgieselaar
Copy link
Member Author

dgieselaar commented Nov 12, 2019 via email

@kobelb
Copy link
Contributor

kobelb commented Nov 12, 2019

Thanks @dgieselaar, I see it there now!

@dgieselaar dgieselaar force-pushed the secure-agent-endpoints branch from 10fb539 to 9ab574d Compare November 13, 2019 08:07
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar dgieselaar force-pushed the secure-agent-endpoints branch from 9ab574d to fa7628e Compare November 13, 2019 10:32
@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar force-pushed the secure-agent-endpoints branch from fa7628e to fa0606b Compare November 13, 2019 13:15
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar dgieselaar merged commit f317c25 into elastic:master Nov 13, 2019
@dgieselaar dgieselaar deleted the secure-agent-endpoints branch November 13, 2019 14:42
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Nov 13, 2019
…tic#50211)

* [APM] Use callWithInternalUser for agent configuration endpoints

Closes elastic#50050.

* Review feedback

* Use internalClient for agent conf queries only
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Nov 13, 2019
…tic#50211)

* [APM] Use callWithInternalUser for agent configuration endpoints

Closes elastic#50050.

* Review feedback

* Use internalClient for agent conf queries only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes v7.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[APM] Secure agent configuration endpoints

4 participants