Identity Config Operator - Permission Specification Set Support¶
Overview¶
The Identity Config Operator has been extended to support permissionSpecificationSetAPI in addition to the existing partyRoleAPI support. This allows ODA Components to expose dynamic permission/role management through permission specification sets.
Changes Made¶
1. Identity Config Operator (identityConfigOperatorKeycloak.py)¶
Extended listener registration: The operator now checks for both
partyRoleAPIandpermissionSpecificationSetAPIin the IdentityConfig specDual registration support: If either API is present, the operator registers a listener with the respective API’s hub endpoint
Improved status reporting: The
listenerRegisteredstatus is now set totrueif either API listener is successfully registered
2. Identity Listener (identity-listener-keycloak.py)¶
Unified event handling: The Flask listener now handles both party role and permission specification set events
New event constants: Added support for:
PermissionSpecificationSetCreationNotificationPermissionSpecificationSetAttributeValueChangeNotificationPermissionSpecificationSetRemoveNotification
Modular event processing: Separated handling into discrete functions for maintainability
Usage¶
IdentityConfig Resource Example¶
apiVersion: oda.tmforum.org/v1
kind: IdentityConfig
metadata:
name: my-component
spec:
canvasSystemRole: CanvasRole
# For dynamic party roles
partyRoleAPI:
implementation: my-component-service
path: /my-component/partyRoleManagement/v4
port: 8080
# For dynamic permission specifications
permissionSpecificationSetAPI:
implementation: my-component-service
path: /my-component/rolesAndPermissionsManagement/v5
port: 8080
Event Structure¶
Permission Specification Set Events¶
Events should follow this structure:
{
"eventType": "PermissionSpecificationSetCreationNotification",
"event": {
"permissionSpecificationSet": {
"@baseType": "PermissionSpecificationSet",
"name": "MyNewRole",
"href": "/my-component/rolesAndPermissionsManagement/v5/permissionSpecificationSet/123"
}
}
}
Behavior¶
Component Registration: When an IdentityConfig is created/updated:
The operator creates a Keycloak client for the component
If
partyRoleAPIis present, registers listener for party role eventsIf
permissionSpecificationSetAPIis present, registers listener for permission specification set eventsBoth APIs can be present simultaneously
Event Processing: When events are received:
Creation events: New roles are added to the component’s Keycloak client
Deletion events: Roles are removed from the component’s Keycloak client
Update events: Currently ignored (no action taken)
Error Handling: Failed operations are logged with CloudEvents-formatted messages and retried according to the operator’s retry policy
Compatibility¶
This extension is backward compatible. Existing IdentityConfig resources using only partyRoleAPI will continue to work unchanged.