scimgateway 5.2.3 → 5.2.4

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
@@ -395,6 +395,8 @@ Definitions in `endpoint` object are customized according to our plugin code. Pl
395
395
 
396
396
  - **log.loglevel.push** - off, debug, info, warn or error. Default info. Push to stream that can be used by client subscriber
397
397
 
398
+ - **log.logDirectory** - custom defined log directory e.g. `/var/log/scimgateway` that will override default `<scimgateway path>/logs`. If not exist it will be created.
399
+
398
400
  - **log.customMasking** - array of attributes to be masked e.g. `"customMasking": ["SSN", "weight"]`. By default SCIM Gateway includes masking of some standard attributes like password.
399
401
 
400
402
  - **log.colorize** - default true, gives colorized and minimized console output, if redirected to stdout/stderr standard JSON formatted output and no colors. Set to false give standard JSON
@@ -1401,6 +1403,14 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1401
1403
 
1402
1404
  ## Change log
1403
1405
 
1406
+ ### v5.2.4
1407
+
1408
+ [Improved]
1409
+
1410
+ - New configuration `log.logDirectory` for custom defined log directory e.g. `/var/log/scimgateway` that will override default `<scimgateway path>/logs`.
1411
+ **Thanks to [@Gerrit Lansing](https://github.com/gerritlansing)**
1412
+ - Base URL like `/scim/v1` and `/scim/v2` is now supported, also with baseEntity e.g. `/scim/v2/client1/Users`
1413
+
1404
1414
  ### v5.2.3
1405
1415
 
1406
1416
  [Fixed]
@@ -334,7 +334,6 @@ export class ScimGateway {
334
334
  const configFile = path.join(`${configDir}`, `${pluginName}.json`) // config name prefix same as pluging name prefix
335
335
  const gwName = path.basename(fileURLToPath(import.meta.url)).split('.')[0] // prefix of current file - using fileURLToPath because using "__filename" is not supported by nodejs typescript
336
336
  const gwPath = path.dirname(fileURLToPath(import.meta.url))
337
- const logDir = path.join(pluginDir, '..', 'logs')
338
337
 
339
338
  this.config = {}
340
339
  // exposed outside class
@@ -356,6 +355,7 @@ export class ScimGateway {
356
355
  found = this.processConfig()
357
356
  } catch (err) { configErr = err }
358
357
 
358
+ const logDir = this.config?.scimgateway?.log?.logDirectory || path.join(pluginDir, '..', 'logs')
359
359
  const logger = new Logger(
360
360
  pluginName,
361
361
  {
@@ -2174,7 +2174,13 @@ export class ScimGateway {
2174
2174
  const method = request.method
2175
2175
  const url = new URL(request.url)
2176
2176
 
2177
- let [, baseEntity, handle, id, rest]: string[] = url.pathname.split('/')
2177
+ let pathname = url.pathname
2178
+ const match = pathname.match(/.*\/scim\/v(1|2)(\/.*)/)
2179
+ if (match) {
2180
+ pathname = match[2] // the part after /scim/vX
2181
+ }
2182
+
2183
+ let [, baseEntity, handle, id, rest]: string[] = pathname.split('/')
2178
2184
  if (baseEntity && handlers.includes(baseEntity.toLowerCase())) {
2179
2185
  rest = id
2180
2186
  id = handle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scimgateway",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "type": "module",
5
5
  "description": "Using SCIM protocol as a gateway for user provisioning to other endpoints",
6
6
  "author": "Jarle Elshaug <jarle.elshaug@gmail.com> (https://elshaug.xyz)",