@@ -10,6 +10,100 @@ connect:
1010 user : " ${DB_USER}"
1111 password : " ${DB_PASSWORD}"
1212
13+ actions :
14+ enable_user :
15+ name : Enable User
16+ description : Enable a disabled user account
17+ action_type :
18+ - account_enable
19+ arguments :
20+ user_id :
21+ name : User ID
22+ type : string
23+ required : true
24+ description : The ID of the user to enable
25+ query : |
26+ UPDATE users SET status = 'active' WHERE username = ?<user_id>
27+ disable_user :
28+ name : Disable User
29+ description : Disable a user account
30+ action_type :
31+ - account_disable
32+ arguments :
33+ user_id :
34+ name : User ID
35+ type : string
36+ required : true
37+ description : The ID of the user to disable
38+ query : |
39+ UPDATE users SET status = 'disabled' WHERE username = ?<user_id>
40+ update_user_attributes :
41+ name : Update User Attributes
42+ description : Update the attributes of a user. Only provide the attributes you want to update.
43+ action_type :
44+ - account
45+ - account_update_profile
46+ arguments :
47+ user_id :
48+ name : User ID
49+ type : string
50+ required : true
51+ description : The ID of the user to update
52+ attrs :
53+ name : Attributes
54+ type : string_map
55+ required : true
56+ description : The updated attribute data (map of attribute names to values)
57+ attrs_update_mask :
58+ name : Attributes Update Mask
59+ type : string_list
60+ required : true
61+ description : The attributes to update (list of attribute names from attrs to actually update)
62+ vars :
63+ # Map each attribute in the attrs argument to a variable and a flag to indicate if the attribute should be updated
64+ manager_id : " 'manager_id' in input.attrs ? input.attrs['manager_id'] : null"
65+ update_manager_id : " 'manager_id' in input.attrs_update_mask"
66+ first_name : " 'first_name' in input.attrs ? input.attrs['first_name'] : null"
67+ update_first_name : " 'first_name' in input.attrs_update_mask"
68+ middle_name : " 'middle_name' in input.attrs ? input.attrs['middle_name'] : null"
69+ update_middle_name : " 'middle_name' in input.attrs_update_mask"
70+ last_name : " 'last_name' in input.attrs ? input.attrs['last_name'] : null"
71+ update_last_name : " 'last_name' in input.attrs_update_mask"
72+ display_name : " 'display_name' in input.attrs ? input.attrs['display_name'] : null"
73+ update_display_name : " 'display_name' in input.attrs_update_mask"
74+ job_title : " 'job_title' in input.attrs ? input.attrs['job_title'] : null"
75+ update_job_title : " 'job_title' in input.attrs_update_mask"
76+ department : " 'department' in input.attrs ? input.attrs['department'] : null"
77+ update_department : " 'department' in input.attrs_update_mask"
78+ division : " 'division' in input.attrs ? input.attrs['division'] : null"
79+ update_division : " 'division' in input.attrs_update_mask"
80+ company : " 'company' in input.attrs ? input.attrs['company'] : null"
81+ update_company : " 'company' in input.attrs_update_mask"
82+ employee_id : " 'employee_id' in input.attrs ? input.attrs['employee_id'] : null"
83+ update_employee_id : " 'employee_id' in input.attrs_update_mask"
84+ employee_number : " 'employee_number' in input.attrs ? input.attrs['employee_number'] : null"
85+ update_employee_number : " 'employee_number' in input.attrs_update_mask"
86+ employment_type : " 'employment_type' in input.attrs ? input.attrs['employment_type'] : null"
87+ update_employment_type : " 'employment_type' in input.attrs_update_mask"
88+ # We define the whole update logic with conditional attributes
89+ query : |
90+ UPDATE users
91+ SET
92+ manager_id = DECODE(?<update_manager_id>, '1', ?<manager_id>, manager_id),
93+ attr_first_name = DECODE(?<update_first_name>, '1', ?<first_name>, attr_first_name),
94+ attr_middle_name = DECODE(?<update_middle_name>, '1', ?<middle_name>, attr_middle_name),
95+ attr_last_name = DECODE(?<update_last_name>, '1', ?<last_name>, attr_last_name),
96+ attr_display_name = DECODE(?<update_display_name>, '1', ?<display_name>, attr_display_name),
97+ attr_job_title = DECODE(?<update_job_title>, '1', ?<job_title>, attr_job_title),
98+ attr_department = DECODE(?<update_department>, '1', ?<department>, attr_department),
99+ attr_division = DECODE(?<update_division>, '1', ?<division>, attr_division),
100+ attr_company = DECODE(?<update_company>, '1', ?<company>, attr_company),
101+ employee_id = DECODE(?<update_employee_id>, '1', ?<employee_id>, employee_id),
102+ attr_employee_number = DECODE(?<update_employee_number>, '1', ?<employee_number>, attr_employee_number),
103+ attr_employment_type = DECODE(?<update_employment_type>, '1', ?<employment_type>, attr_employment_type)
104+ WHERE
105+ username = ?<user_id>
106+
13107# Definition of different resource types managed by this connector
14108resource_types :
15109 # Configuration for "user" resources in Oracle
@@ -31,7 +125,17 @@ resource_types:
31125 account_type as "account_type",
32126 created_at as "created_at",
33127 last_login as "last_login",
34- manager_id as "manager_id"
128+ manager_id as "manager_id",
129+ attr_first_name as "attr_first_name",
130+ attr_middle_name as "attr_middle_name",
131+ attr_last_name as "attr_last_name",
132+ attr_display_name as "attr_display_name",
133+ attr_job_title as "attr_job_title",
134+ attr_department as "attr_department",
135+ attr_division as "attr_division",
136+ attr_company as "attr_company",
137+ attr_employee_number as "attr_employee_number",
138+ attr_employment_type as "attr_employment_type"
35139 FROM
36140 users
37141 ORDER BY id
@@ -65,6 +169,25 @@ resource_types:
65169 - " .employee_id"
66170 # Last login timestamp mapping
67171 last_login : " .last_login"
172+ # Manager information
173+ manager_id : " .manager_id"
174+
175+ # Profile details for the user
176+ profile :
177+ user_id : " .id"
178+ created_at : " .created_at"
179+ last_login : " .last_login"
180+ manager_id : " .manager_id"
181+ attr_first_name : " .attr_first_name"
182+ attr_middle_name : " .attr_middle_name"
183+ attr_last_name : " .attr_last_name"
184+ attr_display_name : " .attr_display_name"
185+ attr_job_title : " .attr_job_title"
186+ attr_department : " .attr_department"
187+ attr_division : " .attr_division"
188+ attr_company : " .attr_company"
189+ attr_employee_number : " .attr_employee_number"
190+ attr_employment_type : " .attr_employment_type"
68191 account_provisioning :
69192 # Schema definition for account creation form
70193 schema :
@@ -324,4 +447,4 @@ resource_types:
324447 - skip_if: ".PRIVILEGE != resource.ID || .ADMIN_OPTION != 'YES'" # Condition for admin-level privilege mapping
325448 principal_id: ".USERNAME" # Map the USERNAME to the principal ID
326449 principal_type: "user" # Define the principal type as user
327- entitlement_id: "admin" # Apply the 'admin' entitlement when administrative rights are present
450+ entitlement_id: "admin" # Apply the 'admin' entitlement when administrative rights are present
0 commit comments