scimgateway 4.5.8 → 4.5.9
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 +8 -2
- package/lib/plugin-api.js +2 -2
- package/lib/plugin-ldap.js +11 -4
- package/lib/utils.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Can be used to chain several gateways
|
|
|
65
65
|
|
|
66
66
|
* **Soap** (SOAP Webservice)
|
|
67
67
|
Demonstrates user provisioning towards SOAP-Based endpoint
|
|
68
|
-
|
|
68
|
+
Example WSDLs are included
|
|
69
69
|
Using endpoint "Forwardinc" as an example (comes with Symantec/Broadcom/CA IM SDK - SDKWS)
|
|
70
70
|
Shows how to implement a highly configurable multi tenant or multi endpoint solution through `baseEntity` in URL
|
|
71
71
|
|
|
@@ -84,7 +84,7 @@ Includes Symantec/Broadcom/CA ConnectorXpress metafile for creating provisioning
|
|
|
84
84
|
* **LDAP** (Directory)
|
|
85
85
|
Fully functional LDAP plugin
|
|
86
86
|
Pre-configured for Microsoft Active Directory
|
|
87
|
-
Using endpointMapper (like plugin-entra-id) for attribute flexibility
|
|
87
|
+
Using endpointMapper (like plugin-entra-id) for attribute mapping flexibility
|
|
88
88
|
|
|
89
89
|
* **API** (REST Webservices)
|
|
90
90
|
Demonstrates API Gateway/plugin functionality using post/put/patch/get/delete
|
|
@@ -1163,6 +1163,12 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
|
|
|
1163
1163
|
|
|
1164
1164
|
## Change log
|
|
1165
1165
|
|
|
1166
|
+
### v4.5.9
|
|
1167
|
+
|
|
1168
|
+
[Improved]
|
|
1169
|
+
|
|
1170
|
+
- Dependencies bump
|
|
1171
|
+
|
|
1166
1172
|
### v4.5.8
|
|
1167
1173
|
|
|
1168
1174
|
[Fixed]
|
package/lib/plugin-api.js
CHANGED
|
@@ -283,8 +283,8 @@ const getAccessToken = async (baseEntity, ctx) => {
|
|
|
283
283
|
lock.release()
|
|
284
284
|
throw (err)
|
|
285
285
|
}
|
|
286
|
-
if (config.entity[baseEntity].tokenAuth) { //
|
|
287
|
-
if (jbody.
|
|
286
|
+
if (config.entity[baseEntity].tokenAuth) { // custom access_token
|
|
287
|
+
if (jbody.accessToken) jbody.access_token = jbody.accessToken
|
|
288
288
|
}
|
|
289
289
|
if (!jbody.access_token) {
|
|
290
290
|
const err = new Error(`[${action}] Error message: Retrieved invalid token response`)
|
package/lib/plugin-ldap.js
CHANGED
|
@@ -209,8 +209,6 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes, ctx) => {
|
|
|
209
209
|
const users = await doRequest(baseEntity, method, base, ldapOptions, ctx) // ignoring SCIM paging startIndex/count - get all
|
|
210
210
|
result.totalResults = users.length
|
|
211
211
|
result.Resources = await Promise.all(users.map(async (user) => { // Promise.all because of async map
|
|
212
|
-
if (user.name) delete user.name // because mapper converts to SCIM name.xxx
|
|
213
|
-
|
|
214
212
|
// endpoint spesific attribute handling
|
|
215
213
|
// "active" must be handled separate
|
|
216
214
|
if (user.userAccountControl !== undefined) { // SCIM "active" - Active Directory
|
|
@@ -1221,8 +1219,6 @@ const getNamingAttribute = (baseEntity, type) => {
|
|
|
1221
1219
|
throw new Error(`getNamingAttribute error: invalid type ${type}`)
|
|
1222
1220
|
}
|
|
1223
1221
|
if (!Array.isArray(arr) || arr.length !== 1) throw new Error(`configuration missing namingAttribute definition for ${type}`)
|
|
1224
|
-
const [endpointAttr] = scimgateway.endpointMapper('outbound', arr[0].mapTo, config.map[type])
|
|
1225
|
-
if (!endpointAttr) throw new Error(`namingAttribute mapTo:${arr[0].mapTo} cannot be found in the map ${type} configuration`)
|
|
1226
1222
|
return [arr[0].attribute, arr[0].mapTo]
|
|
1227
1223
|
}
|
|
1228
1224
|
|
|
@@ -1533,6 +1529,12 @@ for (const key in config.entity) {
|
|
|
1533
1529
|
scimgateway.logger.error(`configuration missing attribute/mapTo: endpoint.entity.${key}.ldap.namingAttribute.user`)
|
|
1534
1530
|
throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
|
|
1535
1531
|
}
|
|
1532
|
+
const [endpointAttr] = scimgateway.endpointMapper('outbound', usrArr[0].mapTo, config.map.user)
|
|
1533
|
+
if (!endpointAttr) {
|
|
1534
|
+
scimgateway.logger.error(`configuration namingAttribute mapTo:${usrArr[0].mapTo} cannot be found in the map user configuration`)
|
|
1535
|
+
throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1536
1538
|
let grpArr = config.entity[key]?.ldap?.namingAttribute?.group
|
|
1537
1539
|
if (config?.map?.group && Object.keys(config.map.group).length > 0) {
|
|
1538
1540
|
if (!grpArr || !Array.isArray(grpArr)) { // check for legacy
|
|
@@ -1551,6 +1553,11 @@ for (const key in config.entity) {
|
|
|
1551
1553
|
scimgateway.logger.error(`configuration missing attribute/mapTo: endpoint.entity.${key}.ldap.namingAttribute.group`)
|
|
1552
1554
|
throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
|
|
1553
1555
|
}
|
|
1556
|
+
const [endpointAttr] = scimgateway.endpointMapper('outbound', grpArr[0].mapTo, config.map.group)
|
|
1557
|
+
if (!endpointAttr) {
|
|
1558
|
+
scimgateway.logger.error(`configuration namingAttribute mapTo:${grpArr[0].mapTo} cannot be found in the map group configuration`)
|
|
1559
|
+
throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
|
|
1560
|
+
}
|
|
1554
1561
|
}
|
|
1555
1562
|
}
|
|
1556
1563
|
|
package/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scimgateway",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.9",
|
|
4
4
|
"description": "Using SCIM protocol as a gateway for user provisioning to other endpoints",
|
|
5
5
|
"author": "Jarle Elshaug <jarle.elshaug@gmail.com> (https://elshaug.xyz)",
|
|
6
6
|
"homepage": "https://elshaug.xyz",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"callsite": "^1.0.0",
|
|
35
35
|
"dot-object": "^2.1.5",
|
|
36
36
|
"fold-to-ascii": "^5.0.1",
|
|
37
|
-
"https-proxy-agent": "^7.0.
|
|
37
|
+
"https-proxy-agent": "^7.0.5",
|
|
38
38
|
"is-in-subnet": "^4.0.1",
|
|
39
39
|
"jsonwebtoken": "^9.0.2",
|
|
40
40
|
"koa": "^2.15.3",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"koa-router": "^12.0.1",
|
|
43
43
|
"ldapjs": "^3.0.7",
|
|
44
44
|
"lokijs": "^1.5.12",
|
|
45
|
-
"mongodb": "^6.
|
|
45
|
+
"mongodb": "^6.9.0",
|
|
46
46
|
"nats": "^2.28.2",
|
|
47
47
|
"node-machine-id": "1.1.9",
|
|
48
|
-
"nodemailer": "^6.9.
|
|
48
|
+
"nodemailer": "^6.9.15",
|
|
49
49
|
"passport": "^0.7.0",
|
|
50
50
|
"passport-azure-ad": "^4.3.5",
|
|
51
|
-
"tedious": "^18.
|
|
52
|
-
"winston": "^3.
|
|
51
|
+
"tedious": "^18.6.1",
|
|
52
|
+
"winston": "^3.14.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"chai": "^4.2.0",
|