Skip to content
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

[Actions Plugin] Use server-side authc.getCurrentUser from core.security #186924

Conversation

tsullivan
Copy link
Member

Part of #186574

Background: This PR serves as an example of a plugin migrating away from depending on the Security plugin, which is a high priority effort for the last release before 9.0. The Actions plugin uses the authc.getCurrentUser method to attribute the current user to persisted actions that are created in the system.

Checklist

Delete any items that are not applicable to this PR.

@tsullivan tsullivan added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jun 25, 2024
@@ -645,7 +645,6 @@ export class ActionsPlugin implements Plugin<PluginSetupContract, PluginStartCon
request,
authorizationMode,
authorization: this.security?.authz,
authentication: this.security?.authc,
Copy link
Member Author

Choose a reason for hiding this comment

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

The authentication property was unused and used the deprecated access method to the APIs

@tsullivan tsullivan force-pushed the security-in-core/actions-server-plugin-server branch from 91a9e28 to 5c4d2c8 Compare June 25, 2024 20:27
@tsullivan tsullivan marked this pull request as ready for review June 26, 2024 17:05
@tsullivan tsullivan requested a review from a team as a code owner June 26, 2024 17:05
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

authentication.getCurrentUser.mockReturnValueOnce({
username: 'some-user',
} as unknown as AuthenticatedUser);

Copy link
Member Author

Choose a reason for hiding this comment

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

This piece of code appears to have been unused boilerplate.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #40 / @skipInServerless endpoint @ess @serverless For each artifact list under management When on the Event Filters entries list should be able to update an existing Event Filters entry

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
actions 34 31 -3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@tsullivan tsullivan merged commit dc12ac8 into elastic:main Jul 2, 2024
22 checks passed
@tsullivan tsullivan deleted the security-in-core/actions-server-plugin-server branch July 2, 2024 15:33
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants