feat: sync Google Group owners as C1 resource owners#109
feat: sync Google Group owners as C1 resource owners#109c1-dev-bot[bot] wants to merge 1 commit into
Conversation
Google Workspace groups have an OWNER role for members, but the connector was ignoring the member.Role field. This adds an ownership entitlement to groups and grants it to members with the OWNER role, allowing ConductorOne to use Resource Owner policies for group ownership. Fixes: CXH-1555
|
|
||
| if strings.EqualFold(member.Role, "OWNER") && strings.EqualFold(member.Type, "USER") { | ||
| ownerGrant := sdkGrant.NewGrant(resource, groupOwnerEntitlement, gmID) | ||
| rv = append(rv, ownerGrant) |
There was a problem hiding this comment.
🟡 Suggestion: The Grant() and Revoke() methods below don't distinguish between the member and owner entitlements — Grant() always calls InsertMember with a default role and returns a grant tagged groupMemberEntitlement. If ConductorOne routes a provisioning request for the owner entitlement, it would silently add a regular member instead of setting the OWNER role. Consider either handling the owner entitlement slug in Grant()/Revoke() (updating the member's role via the API), or removing WithGrantableTo from the ownership entitlement if it's intended to be sync-only.
Connector PR Review: feat: sync Google Group owners as C1 resource ownersBlocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review SummaryThis PR adds a new Security IssuesNone found. Correctness IssuesNone found. Suggestions
Prompt for AI agents |
|
Checking: |
Summary
owner) to Google Workspace group resources using the SDK'sNewOwnershipEntitlementwithPURPOSE_VALUE_OWNERSHIPOWNER(user type only, not nested groups)memberentitlement and grants remain unchanged — all group members still receive the membership grant regardless of roleDetails
Google Workspace allows admins to assign an "Owner" role to group members via the Admin Directory API. The
member.Rolefield returnsOWNER,MANAGER, orMEMBER. Previously, the connector ignored this field entirely — all members received identical membership grants.This change introduces a new
ownerentitlement on group resources so that ConductorOne can:Test plan
memberandownerentitlementsOWNERrole in Google Workspace receive bothmemberandownergrantsMEMBERorMANAGERrole receive only themembergrantGROUP) withOWNERrole do NOT receive an ownership grant (ownership is user-only)Fixes: CXH-1555
Automated PR Notice
This PR was automatically created by c1-dev-bot as a potential implementation.
This code requires: