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

[ESO Plugin] Migrate authc.getCurrentUser usage to coreStart.security #187024

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Jun 26, 2024

Part of #186574

Summary

This PR migrates the Encrypted Saved Object Plugin's route handler that consumes authc.getCurrentUser to use coreStart.security.

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.

Checklist

Delete any items that are not applicable to this PR.

@tsullivan tsullivan force-pushed the security-in-core/encrypted-saved-objects-server-plugin-server branch from 33b74fa to 2eeefa2 Compare June 27, 2024 00:40
@tsullivan tsullivan added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes labels Jun 28, 2024
@tsullivan tsullivan force-pushed the security-in-core/encrypted-saved-objects-server-plugin-server branch from 1ae7970 to e76a4f5 Compare July 8, 2024 19:14
getStartServices: coreSetupMock.getStartServices,
});
});

describe('#setupContract', () => {
it('includes hiddenTypes when specified', async () => {
await setupContract({ includedHiddenTypes: ['hiddenType'] });
setupContract({ includedHiddenTypes: ['hiddenType'] });
await nextTick();
Copy link
Member Author

@tsullivan tsullivan Jul 8, 2024

Choose a reason for hiding this comment

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

Minor cleanup here: it was confusing to await setupContract since that function doesn't return a promise. But a promise does get initialized in that function, and the test depends on that promise being resolved.

@tsullivan tsullivan marked this pull request as ready for review July 8, 2024 19:16
@tsullivan tsullivan requested a review from a team as a code owner July 8, 2024 19:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@kc13greiner kc13greiner self-requested a review July 8, 2024 19:20
Copy link
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

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

LGTM!

@elastic elastic deleted a comment from kibana-ci Jul 8, 2024
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
encryptedSavedObjects 4 2 -2

History

@tsullivan tsullivan merged commit de495d7 into elastic:main Jul 9, 2024
20 checks passed
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Jul 9, 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:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants