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

Sync UserProfile interface in kbn/user-profile-components package with the one in Security plugin. #138704

Merged
merged 5 commits into from
Aug 12, 2022

Conversation

azasypkin
Copy link
Member

Summary

Sync UserProfile interface in kbn/user-profile-components packages with the one in Security plugin.

@azasypkin azasypkin added chore Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Feature:Security/User Profile labels Aug 12, 2022
/**
* Indicates whether user profile is enabled or not.
*/
enabled: boolean;
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: Covered the rationale here

// Get User Profile API returns `enabled` property, but Suggest User Profile API doesn't since it's assumed that the
// API returns only enabled profiles. To simplify the API in Kibana we use the same interfaces for user profiles
// irrespective to the source they are coming from, so we need to "normalize" `enabled` property here.
enabled: rawUserProfile.enabled ?? true,

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah nice, thanks for this Oleg. I wrongly removed this prop from the interface thinking it wasn't used anymore.

Copy link
Member Author

@azasypkin azasypkin Aug 12, 2022

Choose a reason for hiding this comment

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

No worries, I reviewed that PR and thought that was fine to remove it too 🙈 Only when migrating to the new Bulk Get API I realized that our consumers might need this field to recognize not active user profiles (e.g. in cases assignments).

@azasypkin azasypkin changed the title Sync UserProfile interface in kbn/user-profile-components packages with the one in Security plugin. Sync UserProfile interface in kbn/user-profile-components package with the one in Security plugin. Aug 12, 2022
@azasypkin
Copy link
Member Author

@elasticmachine merge upstream

@azasypkin azasypkin marked this pull request as ready for review August 12, 2022 11:00
@azasypkin azasypkin requested a review from a team as a code owner August 12, 2022 11:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@@ -13,6 +13,7 @@ import { PanelWithCodeBlock } from './panel_with_code_block';
export const AvatarDemo: FunctionComponent = () => {
const userProfile = {
uid: 'u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0',
enabled: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might be worth typing these so that we get type errors before test failures 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it's a good idea, will do!

Copy link
Contributor

@thomheymann thomheymann left a comment

Choose a reason for hiding this comment

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

LGTM!

@azasypkin azasypkin added the ci:skip-when-possible (Deprecated) no-op, managed automatically label Aug 12, 2022
@azasypkin azasypkin enabled auto-merge (squash) August 12, 2022 15:06
@azasypkin
Copy link
Member Author

@elasticmachine merge upstream

@azasypkin azasypkin merged commit c868daa into elastic:main Aug 12, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

API count

id before after diff
@kbn/user-profile-components 39 40 +1

History

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

@azasypkin azasypkin deleted the issue-xxx-user-profile-enabled branch August 12, 2022 20:20
Mpdreamz pushed a commit to Mpdreamz/kibana that referenced this pull request Sep 6, 2022
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 chore ci:skip-when-possible (Deprecated) no-op, managed automatically Feature:Security/User Profile release_note:skip Skip the PR/issue when compiling release notes Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants