scimgateway 5.1.0 → 5.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/.github/workflows/test-master.yml +28 -0
- package/.github/workflows/test-release.yml +25 -0
- package/.travis.yml +1 -1
- package/README.md +10 -5
- package/lib/helper-rest.ts +2 -3
- package/lib/scimgateway.ts +16 -4
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Test Master Branch
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v3
|
|
18
|
+
|
|
19
|
+
- name: Install Bun
|
|
20
|
+
run: |
|
|
21
|
+
curl -fsSL https://bun.sh/install | bash
|
|
22
|
+
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: bun install
|
|
26
|
+
|
|
27
|
+
- name: Run master tests
|
|
28
|
+
run: bun run test
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Test Release Workflow
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- published
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v3
|
|
15
|
+
|
|
16
|
+
- name: Install Bun
|
|
17
|
+
run: |
|
|
18
|
+
curl -fsSL https://bun.sh/install | bash
|
|
19
|
+
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: bun install
|
|
23
|
+
|
|
24
|
+
- name: Run release tests
|
|
25
|
+
run: bun run test
|
package/.travis.yml
CHANGED
package/README.md
CHANGED
|
@@ -59,10 +59,8 @@ Shows how to implement a highly configurable multi tenant or multi endpoint solu
|
|
|
59
59
|
|
|
60
60
|
* **SCIM** (REST Webservice)
|
|
61
61
|
Demonstrates user provisioning towards REST-Based endpoint (type SCIM)
|
|
62
|
-
Using plugin Loki as SCIM endpoint
|
|
62
|
+
Using plugin Loki as SCIM endpoint through HelperRest
|
|
63
63
|
Can be used as SCIM version-gateway e.g. 1.1=>2.0 or 2.0=>1.1
|
|
64
|
-
Can be used to chain several gateways
|
|
65
|
-
|
|
66
64
|
|
|
67
65
|
* **Soap** (SOAP Webservice)
|
|
68
66
|
Demonstrates user provisioning towards SOAP-Based endpoint
|
|
@@ -78,7 +76,7 @@ Demonstrates SAP HANA specific user provisioning
|
|
|
78
76
|
|
|
79
77
|
* **Entra ID** (REST Webservices)
|
|
80
78
|
Entra ID user provisioning including license management (App Service plans) e.g. Office 365
|
|
81
|
-
Using Microsoft Graph API
|
|
79
|
+
Using Microsoft Graph API through HelperRest
|
|
82
80
|
Using customized SCIM attributes according to Microsoft Graph API
|
|
83
81
|
Includes Symantec/Broadcom/CA ConnectorXpress metafile for creating provisioning "Azure - ScimGateway" endpoint type
|
|
84
82
|
|
|
@@ -88,7 +86,7 @@ Pre-configured for Microsoft Active Directory
|
|
|
88
86
|
Using endpointMapper (like plugin-entra-id) for attribute mapping flexibility
|
|
89
87
|
|
|
90
88
|
* **API** (REST Webservices)
|
|
91
|
-
Demonstrates API Gateway/plugin functionality using post/put/patch/get/delete
|
|
89
|
+
Demonstrates API Gateway/plugin functionality using post/put/patch/get/delete combined with HelperRest
|
|
92
90
|
None SCIM plugin, becomes what you want it to become.
|
|
93
91
|
Methods included can also be used in standard SCIM plugins
|
|
94
92
|
Endpoint complexity could be put in this plugin, and client could instead communicate through Gateway using your own simplified REST specification.
|
|
@@ -210,6 +208,7 @@ Below shows an example of config\plugin-saphana.json
|
|
|
210
208
|
"scimgateway": {
|
|
211
209
|
"port": 8884,
|
|
212
210
|
"localhostonly": false,
|
|
211
|
+
"chainingBaseUrl": null,
|
|
213
212
|
"scim": {
|
|
214
213
|
"version": "2.0",
|
|
215
214
|
"skipTypeConvert" : false,
|
|
@@ -1183,6 +1182,12 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
|
|
|
1183
1182
|
|
|
1184
1183
|
## Change log
|
|
1185
1184
|
|
|
1185
|
+
### v5.1.1
|
|
1186
|
+
|
|
1187
|
+
[Fixed]
|
|
1188
|
+
|
|
1189
|
+
- SCIM Gateway failed to start on linux using Bun >= v1.1.43
|
|
1190
|
+
|
|
1186
1191
|
### v5.1.0
|
|
1187
1192
|
|
|
1188
1193
|
[Improved]
|
package/lib/helper-rest.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { HttpsProxyAgent } from 'https-proxy-agent'
|
|
|
11
11
|
import { URL } from 'url'
|
|
12
12
|
import { Buffer } from 'node:buffer'
|
|
13
13
|
import { samlAssertion } from './samlAssertion.ts'
|
|
14
|
-
import
|
|
14
|
+
import * as jsonwebtoken from 'jsonwebtoken'
|
|
15
15
|
import fs from 'node:fs'
|
|
16
16
|
import querystring from 'querystring'
|
|
17
17
|
import * as utils from './utils.ts'
|
|
@@ -173,7 +173,7 @@ export class HelperRest {
|
|
|
173
173
|
|
|
174
174
|
form = {
|
|
175
175
|
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
|
|
176
|
-
assertion:
|
|
176
|
+
assertion: jsonwebtoken.sign(jwtAttr, privateKey, { algorithm: 'RS256' }),
|
|
177
177
|
}
|
|
178
178
|
break
|
|
179
179
|
|
|
@@ -525,7 +525,6 @@ export class HelperRest {
|
|
|
525
525
|
const timeout = setTimeout(() => controller.abort(), options.abortTimeout ? options.abortTimeout * 1000 : this.idleTimeout * 1000) // 120 seconds default abort timeout
|
|
526
526
|
options.signal = signal
|
|
527
527
|
const url = `${options.protocol}//${options.host}${options.port ? ':' + options.port : ''}${options.path}`
|
|
528
|
-
if (path.includes(')?$') && !options.headers['Accept-Encoding']) options.headers['Accept-Encoding'] = 'identity' // workaround for bun fetch error: "Decompression error: ShortRead" - have seen this error using OData with "<some-path>('xxx')?$expand=" or "<some-path>('xxx')?$select=" ref: https://github.com/oven-sh/bun/issues/8017
|
|
529
528
|
// execute request
|
|
530
529
|
const f = await fetch(url, options)
|
|
531
530
|
clearTimeout(timeout)
|
package/lib/scimgateway.ts
CHANGED
|
@@ -319,15 +319,27 @@ export class ScimGateway {
|
|
|
319
319
|
break
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
+
/*
|
|
323
|
+
const testCases = [ // Bun >= 1.1.43 and node.js
|
|
324
|
+
' at C:\\xxx\\yyy\\scimgateway\\lib\\plugin-loki.ts:41:21',
|
|
325
|
+
' at /xxx/yyy/scimgateway/lib/plugin-loki.ts:41:21',
|
|
326
|
+
' at file:///C:/xxx/yyy/scimgateway/lib/plugin-loki.ts:41:21',
|
|
327
|
+
];
|
|
328
|
+
|
|
329
|
+
const testCases = [ // Bun < v1.1.43;
|
|
330
|
+
' at module code (C:\\xxx\\yyy\\scimgateway\\lib\\plugin-loki.ts:41:21)',
|
|
331
|
+
' at module code (/xxx/yyy/scimgateway/lib/plugin-loki.ts:41:21)',
|
|
332
|
+
];
|
|
333
|
+
*/
|
|
322
334
|
if (callerLine) {
|
|
323
|
-
let match = callerLine.match(/(
|
|
335
|
+
let match = callerLine.match(/at\s+(?:file:\/\/\/)?((?:[A-Za-z]:[\\/]|\/)[^:]+)/) // Bun >= v1.1.43 and node.js
|
|
324
336
|
if (match && match[1]) {
|
|
325
337
|
requester = match[1]
|
|
326
338
|
}
|
|
327
339
|
if (!requester) {
|
|
328
|
-
match = callerLine.match(
|
|
329
|
-
if (match && match[
|
|
330
|
-
requester = match[
|
|
340
|
+
match = callerLine.match(/\((.+?):\d+:\d+\)/) // Bun < v1.1.43
|
|
341
|
+
if (match && match[1]) {
|
|
342
|
+
requester = match[1]
|
|
331
343
|
}
|
|
332
344
|
}
|
|
333
345
|
}
|
package/package.json
CHANGED