Implementing a AWS cloud directory user store extension for WSO2 IS using REST API
I'm working on $Subject. This extension will allow users to use AWS cloud directory as the user store for product IS using REST API . Cloud Directory is a specialized graph-based directory store that provides a foundational building block for developers. With Cloud Directory, we can organize directory objects into multiple hierarchies to support many organizational pivots and relationships across directory information.
For this user store chart, I have created a hierarchy as shown in the following image . The first step in using Cloud Directory is to define a schema , which describes the data that will be stored in the directory. In my case, I define the schema by providing a JSON. The schema has four facets: GROUP , UM_USER , UM_ROLE , UM_USER_ATTRIBUTE .
Steps to create user store chart in AWS cloud directory
For the user management related things I have planned to add UM_USER, UM_ROLE, UM_USER_ATTRIBUTE objects and their attributes as an initial step.
Create a directory by using the schema I just published.
Create UM_USER, UM_ROLE, UM_USER_ATTRIBUTE group objects with object type as NODE (with GROUP facet), which are created under the root node of the directory.
Create user objects for User_1 and User_2 with object type as LEAF_NODE under the UM_USER (NODE) group (with UM_USER facet), role objects for Role_1 and Role_2 with object type as LEAF_NODE under the UM_ROLE (NODE) group (with UM_ROLE facet), user attribute objects for Attribute_1 and Attribute_2 with object type as LEAF_NODE under the UM_USER_ATTRIBUTE (NODE) group (with UM_USER_ATTRIBUTE facet).
When creating the user objects under UM_USER Node, I define attribute values for UM_USER_NAME, UM_USER_PASSWORD, UM_SALT_VALUE, UM_REQUIRE_CHANGE, UM_CHANGED_TIME, UM_TENANT_ID.
When creating the role objects under UM_ROLE Node, I define attribute values for UM_ROLE_NAME, UM_TENANT_ID, UM_SHARED_ROLE.
When creating the user attribute objects under UM_USER_ATTRIBUTE Node, I define attribute values for UM_ATTR_NAME, UM_ATTR_VALUE, UM_PROFILE_NAME, UM_TENANT_ID.
To create unique objects under each Node,
For user object - I'm creating child link as (c)/(d) with the link name userName + tenantId. So with this link name we can add unique objects with userName and tenantId combination.
For role object - I'm creating child link as (e)/(f) with the link name roleName + tenantId
For user attribute object - I'm creating child link as (g)/(h) with the link name profileName + attributeName + tenantId
To create object-to-object relationships across hierarchies (In here user to role and user to user attribute relationships), I'm using typed links for this as in below image . Here we can have a set of attributes on the links to store additional information about the relationship between the source object and the destination object. Typed links help to maintain referential data integrity by ensuring objects with existing relationships to other objects are not deleted inadvertently.
For user to role relationship, Create Typed link as (L1)/(L3)/(L4) with attributes UM_USER_NAME, UM_TENANT_ID, UM_ROLE_NAME.
10. For user to user attributes relationship, Create Typed link as (L2) with attributes UM_USER_NAME, UM_TENANT_ID, UM_PROFILE_NAME, UM_ATTR_NAME.
Any comments and suggestions would be appreciated.