scimgateway 4.1.0 → 4.1.1

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 CHANGED
@@ -1139,28 +1139,42 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1139
1139
 
1140
1140
  ## Change log
1141
1141
 
1142
+ ### v4.1.1
1143
+ [Added]
1144
+
1145
+ - plugin-ldap support userFilter/groupFilter configuration for restricting scope
1146
+
1147
+ Configuration example:
1148
+
1149
+ {
1150
+ ...
1151
+ "userFilter": "(memberOf=CN=grp1,OU=Groups,DC=test,DC=com)(!(memberOf=CN=Domain Admins,CN=Users,DC=test,DC=com))",
1152
+ "groupFilter": "(!(cn=grp2))",
1153
+ ...
1154
+ }
1155
+
1142
1156
  ### v4.1.0
1143
1157
  [Added]
1144
1158
 
1145
1159
  - Supporting OAuth Client Credentials authentication
1146
1160
 
1147
- Configuration example:
1161
+ Configuration example:
1148
1162
 
1149
- "bearerOAuth": [
1150
- {
1151
- "client_id": "my_client_id",
1152
- "client_secret": "my_client_secret",
1153
- "readOnly": false,
1154
- "baseEntities": []
1155
- }
1156
- ]
1163
+ "bearerOAuth": [
1164
+ {
1165
+ "client_id": "my_client_id",
1166
+ "client_secret": "my_client_secret",
1167
+ "readOnly": false,
1168
+ "baseEntities": []
1169
+ }
1170
+ ]
1157
1171
 
1158
1172
 
1159
- In example above, client using SCIM Gateway must have OAuth configuration:
1173
+ In example above, client using SCIM Gateway must have OAuth configuration:
1160
1174
 
1161
- client_id = my_client_id
1162
- client_secret = my_client_secret
1163
- token request url = http(s)://<host>:<port>/oauth/token
1175
+ client_id = my_client_id
1176
+ client_secret = my_client_secret
1177
+ token request url = http(s)://<host>:<port>/oauth/token
1164
1178
 
1165
1179
 
1166
1180
  ### v4.0.1
@@ -94,6 +94,8 @@
94
94
  "ldap": {
95
95
  "userBase": "CN=Users,DC=test,DC=com",
96
96
  "groupBase": "OU=Groups,DC=test,DC=com",
97
+ "userFilter": null,
98
+ "groupFilter": null,
97
99
  "userNamingAttr": "CN",
98
100
  "groupNamingAttr": "CN",
99
101
  "userObjectClasses": [
@@ -23,6 +23,13 @@
23
23
  // "type": "string"
24
24
  // }
25
25
  //
26
+ // Additional user/group filtering for restricting scope may be configured in endpoint.entity.xxx.ldap e.g:
27
+ // {
28
+ // ...
29
+ // "userFilter": "(memberOf=CN=grp1,OU=Groups,DC=test,DC=com)(!(memberOf=CN=Domain Admins,CN=Users,DC=test,DC=com))",
30
+ // "groupFilter": "(!(cn=grp2))",
31
+ // ...
32
+ // }
26
33
  //
27
34
  // Attributes according to map definition in the configuration file plugin-ldap.json:
28
35
  //
@@ -190,6 +197,7 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes) => {
190
197
  scope: scope,
191
198
  attributes: attrs
192
199
  }
200
+ if (config.entity[baseEntity].ldap.userFilter) ldapOptions.filter += config.entity[baseEntity].ldap.userFilter
193
201
  }
194
202
  }
195
203
  } else if (getObj.operator === 'eq' && getObj.attribute === 'group.value') {
@@ -209,6 +217,7 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes) => {
209
217
  scope: scope,
210
218
  attributes: attrs
211
219
  }
220
+ if (config.entity[baseEntity].ldap.userFilter) ldapOptions.filter += config.entity[baseEntity].ldap.userFilter
212
221
  }
213
222
  // end mandatory if-else logic
214
223
 
@@ -558,6 +567,7 @@ scimgateway.getGroups = async (baseEntity, getObj, attributes) => {
558
567
  scope: scope,
559
568
  attributes: attrs
560
569
  }
570
+ if (config.entity[baseEntity].ldap.groupFilter) ldapOptions.filter += config.entity[baseEntity].ldap.groupFilter
561
571
  }
562
572
  }
563
573
  } else if (getObj.operator === 'eq' && getObj.attribute === 'members.value') {
@@ -578,6 +588,7 @@ scimgateway.getGroups = async (baseEntity, getObj, attributes) => {
578
588
  scope: scope,
579
589
  attributes: attrs
580
590
  }
591
+ if (config.entity[baseEntity].ldap.groupFilter) ldapOptions.filter += config.entity[baseEntity].ldap.groupFilter
581
592
  }
582
593
  // mandatory if-else logic - end
583
594
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scimgateway",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
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",