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

[Cases Plugin] Migrate authc.getCurrentUser usage to coreStart.security #187190

Closed

Conversation

tsullivan
Copy link
Member

Part of #186574

Summary

This PR migrates the method to access a Cases Plugin view model field, which 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.

lookupRealm: { name: '', type: '' },
authenticationProvider: '',
});
const response = await securityService.authc.getCurrentUser();
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the else as it would have been dead code. The new security service comes from Core and is always available.

@@ -65,6 +65,7 @@ export const App: React.FC<{ deps: RenderAppProps }> = ({ deps }) => {
kibanaVersion,
...coreStart,
...pluginsStart,
securityService: coreStart.security,
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, KibanaContextProvider isn't well typed for custom service objects like this. See the FIXME in x-pack/plugins/cases/public/common/lib/kibana/kibana_react.ts

@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 28, 2024
@tsullivan
Copy link
Member Author

/ci

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 29, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Cases Cypress Tests on Security Solution / Cases Creates a new case with timeline and opens the timeline Creates a new case with timeline and opens the timeline
  • [job] [logs] Cases Cypress Tests on Security Solution / Cases Creates a new case with timeline and opens the timeline Creates a new case with timeline and opens the timeline

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cases 479.4KB 479.4KB +27.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cases 151.6KB 151.4KB -239.0B
Unknown metric groups

References to deprecated APIs

id before after diff
cases 33 32 -1

History

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

@tsullivan
Copy link
Member Author

Getting a TypeError in a functional test, due to const { securityService } = useKibana().services;
image
image

It's extremely difficult to track down which provider hasn't passed in the correct service. I'll close this now, as these changes can come later.

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 Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants