-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate off deprecated trait profile/status attributes #50
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,8 +47,6 @@ func userResource(user *client.User, parentResourceID *v2.ResourceId) (*v2.Resou | |
| } | ||
|
|
||
| userTraitOptions := []rs.UserTraitOption{ | ||
| rs.WithUserProfile(profile), | ||
| rs.WithStatus(v2.UserTrait_Status_STATUS_ENABLED), | ||
| rs.WithEmail(user.Email, true), | ||
| } | ||
| if user.LastLogin != nil { | ||
|
|
@@ -60,6 +58,8 @@ func userResource(user *client.User, parentResourceID *v2.ResourceId) (*v2.Resou | |
| resourceTypeUser, | ||
| user.ID, | ||
| userTraitOptions, | ||
| rs.WithResourceProfile(profile), | ||
| rs.WithResourceStatus(v2.Status_RESOURCE_STATUS_ENABLED, ""), | ||
| rs.WithParentResourceID(parentResourceID), | ||
| rs.WithExternalID(&v2.ExternalId{Id: user.ID}), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: |
||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Suggestion:
Grantsnow depends on the profile round-tripping through the resource-level field rather than the group trait, and there is no test covering it (license_test.goonly assertsLicenseProfileTrait). A small test that buildsgroupResource(...)and assertsrs.GetProfileStringValue(rs.GetProfile(res), "group_id")returns the ID would lock in this migration and guard the grant path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetProfile will fall back to group trait if resource profile is not set