Replace Organization.googleWorkspaceOAuth2Scopes with SCIMBridgeTypeInfo

A Google-Workspace-specific field on the generic Organization type
was future-hostile: each new SCIM bridge type would need its own
top-level field. Replace with a generic SCIMBridgeTypeInfo type
queried through Organization.scimBridgeTypes, parallel to the
ConnectorProviderInfo pattern in console/v1.

ConnectorList looks up the Google Workspace entry from the list
and passes its scopes to GoogleWorkspaceConnector as before.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-04-08 09:09:17 +02:00
parent ec42409219
commit 22ccfaa30f
3 changed files with 22 additions and 6 deletions

View File

@@ -250,7 +250,7 @@ type Organization implements Node {
): SAMLConfigurationConnection @goField(forceResolver: true)
scimConfiguration: SCIMConfiguration @goField(forceResolver: true)
googleWorkspaceOAuth2Scopes: [String!]! @goField(forceResolver: true)
scimBridgeTypes: [SCIMBridgeTypeInfo!]! @goField(forceResolver: true)
auditLogEntries(
first: Int
@@ -422,6 +422,11 @@ enum SCIMBridgeType
GOOGLE_WORKSPACE @goEnum(value: "go.probo.inc/probo/pkg/coredata.SCIMBridgeTypeGoogleWorkspace")
}
type SCIMBridgeTypeInfo {
type: SCIMBridgeType!
oauth2Scopes: [String!]!
}
enum SCIMBridgeState
@goModel(model: "go.probo.inc/probo/pkg/coredata.SCIMBridgeState") {
PENDING @goEnum(value: "go.probo.inc/probo/pkg/coredata.SCIMBridgeStatePending")

View File

@@ -1334,9 +1334,14 @@ func (r *organizationResolver) ScimConfiguration(ctx context.Context, obj *types
return types.NewSCIMConfiguration(config), nil
}
// GoogleWorkspaceOAuth2Scopes is the resolver for the googleWorkspaceOAuth2Scopes field.
func (r *organizationResolver) GoogleWorkspaceOAuth2Scopes(ctx context.Context, obj *types.Organization) ([]string, error) {
return googleworkspace.OAuth2Scopes, nil
// ScimBridgeTypes is the resolver for the scimBridgeTypes field.
func (r *organizationResolver) ScimBridgeTypes(ctx context.Context, obj *types.Organization) ([]*types.SCIMBridgeTypeInfo, error) {
return []*types.SCIMBridgeTypeInfo{
{
Type: coredata.SCIMBridgeTypeGoogleWorkspace,
Oauth2Scopes: googleworkspace.OAuth2Scopes,
},
}, nil
}
// AuditLogEntries is the resolver for the auditLogEntries field.