APPUiO Control API: Organization Adapter and Identity Provider
At the core of APPUiO Cloud user management is an OIDC enabled Identity Provider (IdP) that stores the identity of every APPUiO Cloud user and provides OIDC tokens to authenticate users to APPUiO Zones and the APPUiO Control API. For the VSHN-managed APPUiO Cloud instance and throughout parts of this documentations this IdP is Keycloak, but in general this could be any IdP with OIDC integration.
Regardless of what IdP is being used the APPUiO Control API needs to be able to manage organizations, teams, as well as user preferences.
The interaction between the state in the APPUiO Control API, represented by User, Team, and Organization resources, is managed by the Organization Adapter.
First and foremost the adapter needs to make sure that the information on user preferences and organizations in the APPUiO Control API is available in every APPUiO Zone and that user data from the IdP is available to the APPUiO Control API.
This document should give a high level specification of what an APPUiO IdP and its adapter needs to be able to do. The implementation details and which part of these requirements are fulfilled by which system might vary.
|
The requirement level keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" used in this document are to be interpreted as described in RFC 2119. In this document, such keywords are highlighted using bold font. |
Identity Provider
For APPUiO Cloud the two main features of the IdP is that it provides the user identities for every APPUiO Cloud user and that it authenticates them to APPUiO Zones and the APPUiO Control API. That means the APPUiO Control API is not authoritative for users but get its user information from the IdP.
| It is helpful if the IdP has some notion of groups and sub-groups which can be correlated to organizations and teams, but such a data model is not strictly required. |
-
The IdP must hold the identities of APPUiO Cloud users.
-
The IdP must provide OIDC tokens authenticating APPUiO Cloud users to APPUiO Zones.
-
The IdP must provide OIDC tokens authenticating APPUiO Cloud users to the APPUiO Control API.
-
The IdP should have a notion of groups and sub-groups containing users which can be added as claims in the OIDC token.
-
The IdP should provide means to on-board new users to APPUiO Cloud.
Organization Adapter
As long as the Identity Provider is not custom built, it is very unlikely to be able to interface with the APPUiO Control API. Providing this interface is the job of the Organization Adapter.
The adapter may be implemented as a Kubernetes aggregated API server that interfaces with the APPUiO Control API and the IdP.
The adapter may be implemented as Kubernetes Operator that interfaces with the four APPUiO Control API resources related to user management: Organizations and OrganizationMembers, Teams, and Users.
| Some of the following requirements may be implemented by or through the IdP itself or by a third system. |
Organizations
For each Organization and the corresponding OrganizationMembers resource
-
The adapter must make sure that an equivalent OpenShift
Groupwith the same name exists on every APPUiO Zone. -
The adapter must make sure that the users referenced in the corresponding
OrganizationMembersobject are part of thisGroup. -
The adapter must make sure that no other users are part of this
Group. -
The adapter should write the actual members of the corresponding IdP group to the
statusfield of theOrganizationMembersobject. -
The adapter must make sure that the corresponding
Groupis removed onOrganizationdeletion. -
The organization name must also be in the groups claim of the OIDC token provided to the APPUiO Control API for all organization members.
The adapter should provide the option to import existing groups from the IdP. If this feature is provided
| Imports might not be required if the resources are virtual and the IdP is the authoritative source. |
-
The adapter must create
Organizationresources for groups in the IdP that represent organizations if a correspondingOrganizationdoes not exist. -
The adapter must update the corresponding
OrganizationMembersresource of a newly createdOrganizationto represent the members of the group in the IdP. -
The adapter must not edit existing
OrganizationorOrganizationMembersresources as part of an import. -
The adapter should provide means to set RBAC for imported organizations, so that one or more users can manage the
Organizationin the APPUiO Control API. -
The adapter may mark imported organizations as externally managed.
The adapter may provide the option to mark one or more Organizations as to be managed externally by the IdP.
This means the Organization and OrganizationMembers resources are read-only and updated to the state in the external system.
If this feature is provided
-
The adapter must handle all
Organizationmarked with the annotationappuio.io/external: "true"as externally managed. -
The
specfields ofOrganizationandOrganizationMembersresources of externally managed organizations must be updated periodically to reflect the state in the IdP. -
The
specfields ofOrganizationandOrganizationMembersresources of externally managed organizations must be reverted when modified through the APPUiO Control API. -
The adapter must prevent the deletion of externally managed organizations through the APPUiO Control API.
-
When the group is deleted through the IdP, the adapter should remove the corresponding
Organizationresource.
Users
For each IdP user that represents an APPUiO user
-
The adapter must make sure that there is a
Userresource in the APPUiO Control API. -
The adapter must make sure that when deleting an IdP user the corresponding
Userresource is deleted. -
The adapter should write user information from the IdP such as
emailordisplayNameto thestatusof theUserresource.
For each User resource
-
The adapter must make sure that the users default organization name specified in the
Userresourcesspecis written to an annotationappuio.io/default-organizationon the corresponding OpenShiftUserresource on every APPUiO Zone.
Teams
For each Team resource
-
The adapter must make sure that an equivalent OpenShift
Groupexists on every APPUiO Zone and that theGroupis prefixed with name of theOrganizationcontaining the team. -
The adapter must make sure that the users referenced in the
Teamobject are part of this group. -
The adapter must make sure that no other users are part of this group.
-
The adapter should write the actual members of the group to the
statusfield of theTeamobject. -
The adapter must make sure that the corresponding group is removed on
Teamdeletion. -
The prefixed team name must also be in the groups claim of the OIDC token provided to the APPUiO Control API for all team members.
The adapter should provide the option to import existing groups from the IdP. If this feature is provided
| Imports might not be required if the resources are virtual and the IdP is the authoritative source. |
-
The adapter must create
Teamresources for groups in the IdP that represent teams if a correspondingTeamdoes not exist. -
The created
Teammust reference all the members of the group in the IdP. -
The created
Teammust be in theNamespaceof the organization containing the team. -
The adapter must not edit existing
Teamresources as part of an import. -
The adapter may mark imported teams as externally managed.
The adapter may provide the option to mark one or more Teams as to be managed externally by the IdP.
This means the Team resource is read-only and updated to the state in the external system.
If this feature is provided
-
The adapter must handle all
Teamsmarked by with the annotationappuio.io/external: "true"as externally managed. -
The
specfields of externally managedTeamsmust be updated periodically to reflect the state in the IdP. -
The
specfields of externally managedTeamsmust be reverted when modified through the APPUiO Control API. -
The adapter must prevent the deletion externally managed teams through the APPUiO Control API.
-
When the group is deleted through the IdP, the adapter should remove the corresponding
Teamresource.