scimgateway 6.1.11 → 6.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/config/plugin-entra-id.json +1 -1
- package/lib/azure-license-mapping.json +76 -98
- package/lib/plugin-entra-id.ts +16 -3
- package/lib/scimgateway.ts +6 -1
- package/lib/utils-scim.ts +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1304,6 +1304,13 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
|
|
|
1304
1304
|
|
|
1305
1305
|
## Change log
|
|
1306
1306
|
|
|
1307
|
+
### v6.1.12
|
|
1308
|
+
|
|
1309
|
+
[Improved]
|
|
1310
|
+
|
|
1311
|
+
- filter operator `pr` (precense) now sent to plugin (previoulsy rejected)
|
|
1312
|
+
- plugin-entra-id: now handles the pr filter operator for entitlements
|
|
1313
|
+
|
|
1307
1314
|
### v6.1.11
|
|
1308
1315
|
|
|
1309
1316
|
[Fixed]
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"type": "string",
|
|
161
161
|
"comment":"If using AI Agent and mcp tools, change the below description '@elshaug.xyz' to your domain.",
|
|
162
162
|
"x-agent-schema": {
|
|
163
|
-
|
|
163
|
+
"description": "Required for user creation. The user's userPrincipalName (globally unique identifier). If 'userName' is not provided, the agent MUST generate it by concatenating 'givenName.familyName@elshaug.xyz', all in lowercase and normalizing special characters. For example, for 'Barbara Jensen', the userName is 'barbara.jensen@elshaug.xyz'. This field is also subject to a mandatory, autonomous conflict resolution policy. If an attempt to create a user fails because the 'userName' already exists (HTTP code 409), the agent MUST NOT ask for confirmation. Instead, it MUST autonomously append an incrementing number to the 'userName' (e.g., 'barbara.jensen1@elshaug.xyz') and retry the creation until it succeeds. This entire process is mandatory and must be performed without user interaction.",
|
|
164
164
|
"x-agent-hints": {
|
|
165
165
|
"uniqueSuffixOnConflict": true,
|
|
166
166
|
"doNotPromptOnConflict": true
|
|
@@ -1,100 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"WIN_DEF_ATP": { "displayName": "Windows Defender ATP", "category": "Security" },
|
|
79
|
-
|
|
80
|
-
"RMS_S_ENTERPRISE": { "displayName": "Azure Information Protection Premium P1", "category": "Security" },
|
|
81
|
-
"RMS_S_PREMIUM": { "displayName": "Azure Information Protection Premium P2", "category": "Security" },
|
|
82
|
-
|
|
83
|
-
"INTUNE_A": { "displayName": "Microsoft Intune", "category": "Device Management" },
|
|
84
|
-
"INTUNE_SMB": { "displayName": "Microsoft Intune for SMB", "category": "Device Management" },
|
|
85
|
-
|
|
86
|
-
"STREAM": { "displayName": "Microsoft Stream", "category": "Collaboration" },
|
|
87
|
-
"STREAM_P2": { "displayName": "Microsoft Stream Plan 2", "category": "Collaboration" },
|
|
88
|
-
|
|
89
|
-
"YAMMER_ENTERPRISE": { "displayName": "Yammer Enterprise", "category": "Collaboration" },
|
|
90
|
-
|
|
91
|
-
"WHITEBOARD_PLAN1": { "displayName": "Microsoft Whiteboard", "category": "Collaboration" },
|
|
92
|
-
|
|
93
|
-
"BOOKINGS": { "displayName": "Microsoft Bookings", "category": "Collaboration" },
|
|
94
|
-
|
|
95
|
-
"FORMS_PRO": { "displayName": "Dynamics 365 Customer Voice", "category": "Dynamics" },
|
|
96
|
-
|
|
97
|
-
"PLANNERSTANDALONE": { "displayName": "Microsoft Planner", "category": "Collaboration" },
|
|
98
|
-
|
|
99
|
-
"ONEDRIVESTANDARD": { "displayName": "OneDrive for Business", "category": "Storage" }
|
|
2
|
+
"AAD_BASIC":{"displayName":"Azure Active Directory Basic","category":"Entra","licenseCategory":"Free","isBillable":false,"priceUSD":0,"includes":[]},
|
|
3
|
+
"AAD_PREMIUM":{"displayName":"Microsoft Entra ID P1","category":"Entra","licenseCategory":"Paid","isBillable":true,"priceUSD":6,"includes":[]},
|
|
4
|
+
"AAD_PREMIUM_P2":{"displayName":"Microsoft Entra ID P2","category":"Entra","licenseCategory":"Paid","isBillable":true,"priceUSD":9,"includes":["AAD_PREMIUM"]},
|
|
5
|
+
"EMS":{"displayName":"Enterprise Mobility + Security E3","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":10,"includes":["AAD_PREMIUM","INTUNE_A","RMS_S_ENTERPRISE"]},
|
|
6
|
+
"EMSPREMIUM":{"displayName":"Enterprise Mobility + Security E5","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":16,"includes":["AAD_PREMIUM_P2","INTUNE_A","IDENTITY_THREAT_PROTECTION","DEFENDER_CLOUD_APPS"]},
|
|
7
|
+
"ENTERPRISEPACK":{"displayName":"Microsoft 365 E3","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":36,"includes":["EXCHANGEENTERPRISE","SHAREPOINTENTERPRISE","MCOSTANDARD","ONEDRIVESTANDARD","INTUNE_A","AAD_PREMIUM"]},
|
|
8
|
+
"ENTERPRISEPREMIUM":{"displayName":"Microsoft 365 E5","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":57,"includes":["ENTERPRISEPACK","MDE_ADVANCED","DEFENDER_OFFICE_365","POWER_BI_PRO","IDENTITY_THREAT_PROTECTION","DEFENDER_CLOUD_APPS"]},
|
|
9
|
+
"SPE_E3":{"displayName":"Microsoft 365 E3 (SPE)","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":36,"includes":["EXCHANGEENTERPRISE","SHAREPOINTENTERPRISE","MCOSTANDARD","ONEDRIVESTANDARD","INTUNE_A","AAD_PREMIUM"]},
|
|
10
|
+
"SPE_E5":{"displayName":"Microsoft 365 E5","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":57,"includes":["SPE_E3","MDE_ADVANCED","DEFENDER_OFFICE_365","POWER_BI_PRO","IDENTITY_THREAT_PROTECTION"]},
|
|
11
|
+
"M365_E3":{"displayName":"Microsoft 365 E3","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":36,"includes":["EXCHANGEENTERPRISE","SHAREPOINTENTERPRISE","MCOSTANDARD","ONEDRIVESTANDARD","INTUNE_A","AAD_PREMIUM"]},
|
|
12
|
+
"M365_E5":{"displayName":"Microsoft 365 E5","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":57,"includes":["M365_E3","MDE_ADVANCED","DEFENDER_OFFICE_365","POWER_BI_PRO","IDENTITY_THREAT_PROTECTION","DEFENDER_CLOUD_APPS"]},
|
|
13
|
+
"STANDARDPACK":{"displayName":"Office 365 E1","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":["EXCHANGESTANDARD","SHAREPOINTSTANDARD","MCOSTANDARD","ONEDRIVESTANDARD"]},
|
|
14
|
+
"STANDARDWOFFPACK":{"displayName":"Office 365 E2","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":15,"includes":["EXCHANGESTANDARD","SHAREPOINTSTANDARD","MCOSTANDARD","ONEDRIVESTANDARD"]},
|
|
15
|
+
"ENTERPRISEPACKLRG":{"displayName":"Office 365 E3","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":23,"includes":["EXCHANGEENTERPRISE","SHAREPOINTENTERPRISE","MCOSTANDARD","ONEDRIVESTANDARD"]},
|
|
16
|
+
"ENTERPRISEWITHSCAL":{"displayName":"Office 365 E4 (retired)","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":30,"includes":["EXCHANGEENTERPRISE","SHAREPOINTENTERPRISE","MCOSTANDARD","ONEDRIVESTANDARD"]},
|
|
17
|
+
"DESKLESSPACK":{"displayName":"Microsoft 365 F3","category":"Microsoft 365","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":["EXCHANGESTANDARD","SHAREPOINTSTANDARD","MCOSTANDARD","ONEDRIVESTANDARD"]},
|
|
18
|
+
"Microsoft_Entra_Suite": { "displayName": "Microsoft Entra Suite", "category": "Entra", "licenseCategory": "Paid", "isBillable": true, "priceUSD": 9.00, "includes": ["AAD_PREMIUM_P1","AAD_PREMIUM_P2"] },
|
|
19
|
+
"O365_w/o_Teams_Bundle_M5": { "displayName": "Office 365 without Teams Bundle M5", "category": "Microsoft 365", "licenseCategory": "Paid", "isBillable": true, "priceUSD": 28.00, "includes": ["ENTERPRISEPACK","EXCHANGESTANDARD","SHAREPOINTSTANDARD"] },
|
|
20
|
+
"Microsoft_Teams_EEA_New": { "displayName": "Microsoft Teams EEA New", "category": "Collaboration", "licenseCategory": "Paid", "isBillable": true, "priceUSD": 4.00, "includes": [] },
|
|
21
|
+
"POWERAPPS_DEV": { "displayName": "Power Apps Developer Plan", "category": "Power Platform", "licenseCategory": "Free", "isBillable": false, "priceUSD": 0.00, "includes": [] },
|
|
22
|
+
"EXCHANGESTANDARD":{"displayName":"Exchange Online Plan 1","category":"Exchange","licenseCategory":"Paid","isBillable":true,"priceUSD":4,"includes":[]},
|
|
23
|
+
"EXCHANGEENTERPRISE":{"displayName":"Exchange Online Plan 2","category":"Exchange","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
24
|
+
"EXCHANGEARCHIVE_ADDON":{"displayName":"Exchange Online Archiving","category":"Exchange","licenseCategory":"Paid","isBillable":true,"priceUSD":3,"includes":[]},
|
|
25
|
+
"SHAREPOINTSTANDARD":{"displayName":"SharePoint Online Plan 1","category":"SharePoint","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
26
|
+
"SHAREPOINTENTERPRISE":{"displayName":"SharePoint Online Plan 2","category":"SharePoint","licenseCategory":"Paid","isBillable":true,"priceUSD":10,"includes":[]},
|
|
27
|
+
"MCOSTANDARD":{"displayName":"Microsoft Teams","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
28
|
+
"MCOEV":{"displayName":"Microsoft Teams Phone Standard","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
29
|
+
"PHONESYSTEM_VIRTUALUSER":{"displayName":"Microsoft Teams Phone Resource Account","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":0,"includes":[]},
|
|
30
|
+
"MCOPSTN1":{"displayName":"Microsoft Teams Domestic Calling Plan","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
31
|
+
"MCOPSTN2":{"displayName":"Microsoft Teams International Calling Plan","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":12,"includes":[]},
|
|
32
|
+
"POWER_BI_STANDARD":{"displayName":"Microsoft Fabric (Free)","category":"Power Platform","licenseCategory":"Free","isBillable":false,"priceUSD":0,"includes":[]},
|
|
33
|
+
"POWER_BI_PRO":{"displayName":"Power BI Pro","category":"Power Platform","licenseCategory":"Paid","isBillable":true,"priceUSD":13,"includes":[]},
|
|
34
|
+
"POWER_BI_PREMIUM_PER_USER":{"displayName":"Power BI Premium Per User","category":"Power Platform","licenseCategory":"Paid","isBillable":true,"priceUSD":20,"includes":["POWER_BI_PRO"]},
|
|
35
|
+
"POWERAPPS_PER_USER":{"displayName":"Power Apps Per User","category":"Power Platform","licenseCategory":"Paid","isBillable":true,"priceUSD":10,"includes":[]},
|
|
36
|
+
"POWERAPPS_PER_APP":{"displayName":"Power Apps Per App","category":"Power Platform","licenseCategory":"Paid","isBillable":true,"priceUSD":7,"includes":[]},
|
|
37
|
+
"POWERAPPS_VIRAL":{"displayName":"Power Apps Trial","category":"Power Platform","licenseCategory":"Trial","isBillable":false,"priceUSD":0,"includes":[]},
|
|
38
|
+
"FLOW_FREE":{"displayName":"Microsoft Power Automate Free","category":"Power Platform","licenseCategory":"Free","isBillable":false,"priceUSD":0,"includes":[]},
|
|
39
|
+
"FLOW_PER_USER":{"displayName":"Power Automate Per User","category":"Power Platform","licenseCategory":"Paid","isBillable":true,"priceUSD":10,"includes":[]},
|
|
40
|
+
"PROJECT_P1":{"displayName":"Project Plan 1","category":"Project","licenseCategory":"Paid","isBillable":true,"priceUSD":7,"includes":[]},
|
|
41
|
+
"PROJECT_P3":{"displayName":"Project Plan 3","category":"Project","licenseCategory":"Paid","isBillable":true,"priceUSD":15,"includes":[]},
|
|
42
|
+
"PROJECT_P5":{"displayName":"Project Plan 5","category":"Project","licenseCategory":"Paid","isBillable":true,"priceUSD":30,"includes":[]},
|
|
43
|
+
"VISIO_P1":{"displayName":"Visio Plan 1","category":"Visio","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
44
|
+
"VISIO_P2":{"displayName":"Visio Plan 2","category":"Visio","licenseCategory":"Paid","isBillable":true,"priceUSD":12,"includes":[]},
|
|
45
|
+
"MDE_ADVANCED":{"displayName":"Microsoft Defender for Endpoint","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
46
|
+
"DEFENDER_OFFICE_365":{"displayName":"Microsoft Defender for Office 365","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
47
|
+
"IDENTITY_THREAT_PROTECTION":{"displayName":"Microsoft Defender for Identity","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":6,"includes":[]},
|
|
48
|
+
"DEFENDER_CLOUD_APPS":{"displayName":"Microsoft Defender for Cloud Apps","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":7,"includes":[]},
|
|
49
|
+
"M365_COPILOT":{"displayName":"Microsoft 365 Copilot","category":"AI","licenseCategory":"Paid","isBillable":true,"priceUSD":30,"includes":[]},
|
|
50
|
+
"COPILOT_STUDIO":{"displayName":"Copilot Studio","category":"AI","licenseCategory":"Paid","isBillable":true,"priceUSD":20,"includes":[]},
|
|
51
|
+
"VIVA_CONNECTIONS":{"displayName":"Microsoft Viva Connections","category":"Viva","licenseCategory":"Paid","isBillable":true,"priceUSD":3,"includes":[]},
|
|
52
|
+
"VIVA_INSIGHTS":{"displayName":"Microsoft Viva Insights","category":"Viva","licenseCategory":"Paid","isBillable":true,"priceUSD":3,"includes":[]},
|
|
53
|
+
"VIVA_LEARNING":{"displayName":"Microsoft Viva Learning","category":"Viva","licenseCategory":"Paid","isBillable":true,"priceUSD":4,"includes":[]},
|
|
54
|
+
"VIVA_TOPICS":{"displayName":"Microsoft Viva Topics","category":"Viva","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
55
|
+
"VIVA_GOALS":{"displayName":"Microsoft Viva Goals","category":"Viva","licenseCategory":"Paid","isBillable":true,"priceUSD":6,"includes":[]},
|
|
56
|
+
"VIVA_EMPLOYEE_COMMUNICATIONS":{"displayName":"Microsoft Viva Employee Communications","category":"Viva","licenseCategory":"Paid","isBillable":true,"priceUSD":3,"includes":[]},
|
|
57
|
+
"DYN365_TEAM_MEMBERS":{"displayName":"Dynamics 365 Team Members","category":"Dynamics","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
58
|
+
"DYN365_SALES_ENTERPRISE":{"displayName":"Dynamics 365 Sales Enterprise","category":"Dynamics","licenseCategory":"Paid","isBillable":true,"priceUSD":40,"includes":[]},
|
|
59
|
+
"DYN365_CUSTOMER_SERVICE_ENTERPRISE":{"displayName":"Dynamics 365 Customer Service Enterprise","category":"Dynamics","licenseCategory":"Paid","isBillable":true,"priceUSD":40,"includes":[]},
|
|
60
|
+
"DYN365_FIELD_SERVICE":{"displayName":"Dynamics 365 Field Service","category":"Dynamics","licenseCategory":"Paid","isBillable":true,"priceUSD":50,"includes":[]},
|
|
61
|
+
"DYN365_MARKETING":{"displayName":"Dynamics 365 Marketing","category":"Dynamics","licenseCategory":"Paid","isBillable":true,"priceUSD":80,"includes":[]},
|
|
62
|
+
"ENTRA_PRIVATE_ACCESS":{"displayName":"Microsoft Entra Private Access","category":"Entra","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
63
|
+
"ENTRA_INTERNET_ACCESS":{"displayName":"Microsoft Entra Internet Access","category":"Entra","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
64
|
+
"WINDOWS_STORE":{"displayName":"Microsoft Store for Business","category":"Windows","licenseCategory":"Free","isBillable":false,"priceUSD":0,"includes":[]},
|
|
65
|
+
"WIN_DEF_ATP":{"displayName":"Windows Defender ATP","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
66
|
+
"RMS_S_ENTERPRISE":{"displayName":"Azure Information Protection Premium P1","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":6,"includes":[]},
|
|
67
|
+
"RMS_S_PREMIUM":{"displayName":"Azure Information Protection Premium P2","category":"Security","licenseCategory":"Paid","isBillable":true,"priceUSD":9,"includes":["RMS_S_ENTERPRISE"]},
|
|
68
|
+
"INTUNE_A":{"displayName":"Microsoft Intune","category":"Device Management","licenseCategory":"Paid","isBillable":true,"priceUSD":8,"includes":[]},
|
|
69
|
+
"INTUNE_SMB":{"displayName":"Microsoft Intune for SMB","category":"Device Management","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
70
|
+
"STREAM":{"displayName":"Microsoft Stream","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":0,"includes":[]},
|
|
71
|
+
"STREAM_P2":{"displayName":"Microsoft Stream Plan 2","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":3,"includes":[]},
|
|
72
|
+
"YAMMER_ENTERPRISE":{"displayName":"Yammer Enterprise","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":3,"includes":[]},
|
|
73
|
+
"WHITEBOARD_PLAN1":{"displayName":"Microsoft Whiteboard","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":0,"includes":[]},
|
|
74
|
+
"BOOKINGS":{"displayName":"Microsoft Bookings","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":2,"includes":[]},
|
|
75
|
+
"FORMS_PRO":{"displayName":"Dynamics 365 Customer Voice","category":"Dynamics","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]},
|
|
76
|
+
"PLANNERSTANDALONE":{"displayName":"Microsoft Planner","category":"Collaboration","licenseCategory":"Paid","isBillable":true,"priceUSD":0,"includes":[]},
|
|
77
|
+
"ONEDRIVESTANDARD":{"displayName":"OneDrive for Business","category":"Storage","licenseCategory":"Paid","isBillable":true,"priceUSD":5,"includes":[]}
|
|
100
78
|
}
|
package/lib/plugin-entra-id.ts
CHANGED
|
@@ -176,6 +176,8 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes, ctx) => {
|
|
|
176
176
|
} else if (getObj.operator === 'eq' && getObj.attribute === 'group.value') {
|
|
177
177
|
// optional - only used when groups are member of users, not default behavior - correspond to getGroupUsers() in versions < 4.x.x
|
|
178
178
|
throw new Error(`${action} error: not supporting groups member of user filtering: ${getObj.rawFilter}`)
|
|
179
|
+
} else if (getObj.operator === 'pr' && getObj.attribute === 'entitlements') { // pr - presence of (only return objects having getObj.attribute)
|
|
180
|
+
path = `/users?$top=${getObj.count}&$count=true&filter=assignedLicenses/$count ne 0& &$select=${selectAttributes.join(',')}`
|
|
179
181
|
} else {
|
|
180
182
|
// optional - simpel filtering
|
|
181
183
|
if (getObj.attribute) {
|
|
@@ -190,7 +192,7 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes, ctx) => {
|
|
|
190
192
|
|
|
191
193
|
const arr = getObj.attribute.split('.')
|
|
192
194
|
if (arr.length === 2) {
|
|
193
|
-
if (config.map.user[arr[0]] && config.map.user[arr[0]]?.type
|
|
195
|
+
if (config.map.user[arr[0]] && ['complexArray', 'complexObject'].includes(config.map.user[arr[0]]?.type)) {
|
|
194
196
|
if (arr[0] === 'entitlements') { // using entitlements for license
|
|
195
197
|
const skuIdDefs = await getSkuIdDefs(baseEntity, {}, [], ctx)
|
|
196
198
|
const skuIdArr = searchSkuIdDefs(skuIdDefs, getObj)
|
|
@@ -276,6 +278,8 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes, ctx) => {
|
|
|
276
278
|
if (response.body.value[i].assignedLicenses && Array.isArray(response.body.value[i].assignedLicenses)) {
|
|
277
279
|
if (!response.body.value[i][entitlementsAttr]) response.body.value[i][entitlementsAttr] = []
|
|
278
280
|
for (const lic of response.body.value[i].assignedLicenses) {
|
|
281
|
+
const entitlement = skuIdDefs[lic.skuId]
|
|
282
|
+
delete entitlement.licenseInfo
|
|
279
283
|
if (lic.skuId && skuIdDefs[lic.skuId]) response.body.value[i][entitlementsAttr].push(skuIdDefs[lic.skuId])
|
|
280
284
|
}
|
|
281
285
|
}
|
|
@@ -825,13 +829,22 @@ scimgateway.getEntitlements = async (baseEntity, getObj, attributes, ctx) => {
|
|
|
825
829
|
if (!response.body.value) {
|
|
826
830
|
throw new Error('got empty response on REST request')
|
|
827
831
|
}
|
|
828
|
-
|
|
829
832
|
for (let i = 0; i < response.body.value.length; i++) {
|
|
830
833
|
const skuPartNumber = response.body.value[i].skuPartNumber
|
|
831
834
|
const displayName = licenseMapping[skuPartNumber] ? licenseMapping[skuPartNumber].displayName : skuPartNumber
|
|
832
835
|
const used = response.body.value[i].consumedUnits
|
|
833
836
|
const available = response.body.value[i].prepaidUnits?.enabled
|
|
834
|
-
|
|
837
|
+
|
|
838
|
+
const licenseInfo: Record<string, any> = {}
|
|
839
|
+
licenseInfo.usage = { used, available }
|
|
840
|
+
if (licenseMapping[skuPartNumber]) {
|
|
841
|
+
licenseInfo.licenseCategory = licenseMapping[skuPartNumber].licenseCategory
|
|
842
|
+
licenseInfo.isBillable = licenseMapping[skuPartNumber].isBillable
|
|
843
|
+
licenseInfo.priceUSD = licenseMapping[skuPartNumber].priceUSD
|
|
844
|
+
licenseInfo.includes = licenseMapping[skuPartNumber].includes
|
|
845
|
+
}
|
|
846
|
+
ret.Resources.push({
|
|
847
|
+
type: skuPartNumber, value: response.body.value[i].skuId, display: displayName, licenseInfo })
|
|
835
848
|
}
|
|
836
849
|
|
|
837
850
|
if (searchAttr && ret.Resources.length > 0) {
|
package/lib/scimgateway.ts
CHANGED
|
@@ -1481,6 +1481,9 @@ export class ScimGateway {
|
|
|
1481
1481
|
getObj.operator = arrFilter[1].toLowerCase() // eq
|
|
1482
1482
|
const value = arrFilter.slice(2).join(' ').replace(/"/g, '')
|
|
1483
1483
|
getObj.value = value
|
|
1484
|
+
} else if (arrFilter.length === 2 && arrFilter[1] === 'pr') {
|
|
1485
|
+
getObj.attribute = arrFilter[0]
|
|
1486
|
+
getObj.operator = arrFilter[1] // pr - presence of (only return objects having getObj.attribute)
|
|
1484
1487
|
}
|
|
1485
1488
|
}
|
|
1486
1489
|
|
|
@@ -1490,7 +1493,9 @@ export class ScimGateway {
|
|
|
1490
1493
|
}
|
|
1491
1494
|
if (!err && getObj.attribute) {
|
|
1492
1495
|
if (this.multiValueTypes.includes(getObj.attribute) || getObj.attribute === 'roles') {
|
|
1493
|
-
|
|
1496
|
+
if (getObj.operator !== 'pr') {
|
|
1497
|
+
getObj.attribute = `${getObj.attribute}.value` // emails => emails.value
|
|
1498
|
+
}
|
|
1494
1499
|
} else if (getObj.attribute.includes('[')) { // e.g. rawFilter = emails[type eq "work"]
|
|
1495
1500
|
const rePattern = /^(.*)\[(.*) (.*) (.*)\]$/
|
|
1496
1501
|
const arrMatches = ctx.query?.filter?.match(rePattern)
|
package/lib/utils-scim.ts
CHANGED
|
@@ -554,7 +554,14 @@ export function endpointMapper(direction: string, parseObj: any, mapObj: any) {
|
|
|
554
554
|
break
|
|
555
555
|
} else if (val === attr.split('.')[0] && ['complexArray', 'complexObject'].includes(mapObj[key].type)) {
|
|
556
556
|
found = true
|
|
557
|
-
|
|
557
|
+
const a = attr.split('.') // entitlements.value
|
|
558
|
+
if (a.length > 0) {
|
|
559
|
+
let tmp = key
|
|
560
|
+
for (let pos = 1; pos < a.length; pos++) {
|
|
561
|
+
tmp += `.${a[pos]}`
|
|
562
|
+
}
|
|
563
|
+
if (!resArr.includes(tmp)) resArr.push(tmp)
|
|
564
|
+
} else if (!resArr.includes(key)) resArr.push(key)
|
|
558
565
|
break
|
|
559
566
|
} else if (val.split('.')[0] === attr) { // roles.value, manager.managerId
|
|
560
567
|
found = true
|
package/package.json
CHANGED