scimgateway 6.0.2 → 6.1.0
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 +116 -16
- package/bun.lock +199 -175
- package/index.ts +13 -14
- package/lib/plugin-api.ts +3 -21
- package/lib/plugin-entra-id.ts +2 -20
- package/lib/plugin-ldap.ts +1 -11
- package/lib/plugin-loki.ts +1 -10
- package/lib/plugin-mongodb.ts +1 -10
- package/lib/plugin-mssql.ts +1 -10
- package/lib/plugin-saphana.ts +1 -10
- package/lib/plugin-scim.ts +2 -21
- package/lib/plugin-soap.ts +1 -10
- package/lib/scimgateway.ts +30 -73
- package/lib/utils-scim.ts +40 -22
- package/package.json +12 -14
- package/test/index.ts +4 -4
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Validated through IdP's:
|
|
|
16
16
|
|
|
17
17
|
Latest news:
|
|
18
18
|
|
|
19
|
+
- tsx is now included, allowing SCIM Gateway to be run as a module in Node.js. Bun binary build is now supported. A single binary can be compiled that includes both the gateway and the plugin.
|
|
19
20
|
- Major release **v6.0.0** introduces changes to API method response bodies (not SCIM-related) and a new method `publicApi()` for handling public path `/pub/api` requests with no authentication required. In addition, the configuration option `bearerJwtAzure.tenantIdGUID` has been replaced by `bearerJwt.azureTenantId`. See the version history for details.
|
|
20
21
|
- Entra ID [Federated Identity Credentials](https://learn.microsoft.com/en-us/graph/api/resources/federatedidentitycredentials-overview?view=graph-rest-1.0) is now supported. Identity federation allows SCIM Gateway to access Microsoft Entra protected resources without needing to manage secrets
|
|
21
22
|
- External JWKS (JSON Web Key Set) is now supported by JWT Authentication. These are public and typically frequent rotated by modern identity providers
|
|
@@ -160,8 +161,8 @@ If internet connection is blocked, we could install on another machine and copy
|
|
|
160
161
|
|
|
161
162
|
>Tip, take a look at bun test scripts located in `node_modules\scimgateway\test\lib`
|
|
162
163
|
|
|
163
|
-
> If using Node.js instead of Bun,
|
|
164
|
-
`node --
|
|
164
|
+
> If using Node.js instead of Bun, startup will then be:
|
|
165
|
+
`node --import=tsx ./index.ts`
|
|
165
166
|
|
|
166
167
|
#### Upgrade SCIM Gateway
|
|
167
168
|
|
|
@@ -190,20 +191,20 @@ For Node.js (and also Bun), we might set the property `scimgateway_postinstall_s
|
|
|
190
191
|
|
|
191
192
|
## Configuration
|
|
192
193
|
|
|
193
|
-
**index.ts** defines one or more plugins to be started by the `
|
|
194
|
+
**index.ts** defines one or more plugins to be started by the `import statement`.
|
|
194
195
|
|
|
195
|
-
//
|
|
196
|
-
//
|
|
196
|
+
// start one or more plugins:
|
|
197
|
+
// import './lib/plugin-scim.ts'
|
|
198
|
+
// import './lib/plugin-entra-id.ts'
|
|
199
|
+
// import './lib/plugin-ldap.ts'
|
|
200
|
+
// import './lib/plugin-mongodb.ts'
|
|
201
|
+
// import './lib/plugin-api.ts'
|
|
202
|
+
// import './lib/plugin-mssql.ts'
|
|
203
|
+
// import './lib/plugin-saphana.ts'
|
|
204
|
+
// import './lib/plugin-soap.ts'
|
|
197
205
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
for (const plugin of plugins) {
|
|
201
|
-
try {
|
|
202
|
-
await import(`./lib/plugin-${plugin}.ts`)
|
|
203
|
-
} catch (err: any) {
|
|
204
|
-
console.error(err)
|
|
205
|
-
}
|
|
206
|
-
}
|
|
206
|
+
import './lib/plugin-loki.ts'
|
|
207
|
+
export {}
|
|
207
208
|
|
|
208
209
|
|
|
209
210
|
Each endpoint plugin needs a TypeScript file (.ts) and a configuration file (.json).
|
|
@@ -913,6 +914,21 @@ GET `https://<namespace-name>.servicebus.windows.net/<hybrid-connection-name>/<b
|
|
|
913
914
|
|
|
914
915
|
If several SCIM Gateway´s (same plugin) connect listeners using the same Azure Relay connectionUrl, there will be load-balancing and round-robin distribution
|
|
915
916
|
|
|
917
|
+
### Configuration notes - running SCIM Gateway as a single binary
|
|
918
|
+
|
|
919
|
+
A single binary can be compiled that includes both the gateway and the plugin. The binary must have the same name (prefix) as the configuration file in the config directory, and this directory must be located in the same folder as the binary.
|
|
920
|
+
|
|
921
|
+
cd my-scimgateway
|
|
922
|
+
bun build --compile --target=bun-darwin-arm64 --outfile ./build/plugin-loki ./lib/plugin-loki.ts
|
|
923
|
+
// for target options, see: https://bun.com/docs/bundler/executables#cross-compile-to-other-platforms
|
|
924
|
+
|
|
925
|
+
cp -r ./config ./build
|
|
926
|
+
// build directory now have what is needed and can be put into production
|
|
927
|
+
cd build
|
|
928
|
+
// run the binary - note, binary must have same name (prefix) as the configuration file in the config directory
|
|
929
|
+
./plugin-loki
|
|
930
|
+
|
|
931
|
+
|
|
916
932
|
|
|
917
933
|
## Manual startup
|
|
918
934
|
|
|
@@ -963,7 +979,7 @@ Verification:
|
|
|
963
979
|
|
|
964
980
|
Installing Docker Desktop may be an alternative for creating and testing docker images and containers
|
|
965
981
|
|
|
966
|
-
There are two options: run SCIM Gateway in a single image, or use Docker Compose, which allows
|
|
982
|
+
There are two options: run SCIM Gateway in a single image, or use Docker Compose, which allows configuration and data outside the image and including other images as dependencies (e.g., MSSQL)
|
|
967
983
|
|
|
968
984
|
### Docker single image
|
|
969
985
|
|
|
@@ -1021,7 +1037,7 @@ docker-compose**
|
|
|
1021
1037
|
**Dockerfile** <== Main dockerfile
|
|
1022
1038
|
**DataDockerfile** <== Handles volume mapping
|
|
1023
1039
|
**docker-compose-debug.yml** <== Debugging
|
|
1024
|
-
**docker-compose-mssql.yml** <== Example including MSSQL docker image
|
|
1040
|
+
**docker-compose-mssql.yml** <== Example including MSSQL docker image
|
|
1025
1041
|
**.dockerignore** <== Files to exclude from the build context
|
|
1026
1042
|
|
|
1027
1043
|
- Create a scimgateway user on your Linux VM.
|
|
@@ -1518,6 +1534,7 @@ In addition following general API methods are available for use:
|
|
|
1518
1534
|
* scimgateway.patchApi()
|
|
1519
1535
|
* scimgateway.getApi()
|
|
1520
1536
|
* scimgateway.deleteApi()
|
|
1537
|
+
* scimgateway.publicApi()
|
|
1521
1538
|
|
|
1522
1539
|
In code editor (e.g., Visual Studio Code), method details and documentation are shown by IntelliSense
|
|
1523
1540
|
|
|
@@ -1528,6 +1545,89 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
|
|
|
1528
1545
|
|
|
1529
1546
|
## Change log
|
|
1530
1547
|
|
|
1548
|
+
### v6.1.0
|
|
1549
|
+
|
|
1550
|
+
[Improved]
|
|
1551
|
+
|
|
1552
|
+
- tsx is now included, allowing SCIM Gateway to be run as a module in Node.js. The mandatory plugin section, which previously required complex dynamic loading, can now be simplified using static imports
|
|
1553
|
+
|
|
1554
|
+
**Old plugin-xxx.ts:**
|
|
1555
|
+
|
|
1556
|
+
// start - mandatory plugin initialization
|
|
1557
|
+
const ScimGateway: typeof import('scimgateway').ScimGateway = await (async () => {
|
|
1558
|
+
try {
|
|
1559
|
+
return (await import('scimgateway')).ScimGateway
|
|
1560
|
+
} catch (err) {
|
|
1561
|
+
const source = './scimgateway.ts'
|
|
1562
|
+
return (await import(source)).ScimGateway
|
|
1563
|
+
}
|
|
1564
|
+
})()
|
|
1565
|
+
const scimgateway = new ScimGateway()
|
|
1566
|
+
const config = scimgateway.getConfig()
|
|
1567
|
+
scimgateway.authPassThroughAllowed = false
|
|
1568
|
+
// end - mandatory plugin initialization
|
|
1569
|
+
|
|
1570
|
+
**New plugin-xxx.ts:**
|
|
1571
|
+
|
|
1572
|
+
// start - mandatory plugin initialization
|
|
1573
|
+
import { ScimGateway } from 'scimgateway'
|
|
1574
|
+
const scimgateway = new ScimGateway()
|
|
1575
|
+
const config = scimgateway.getConfig()
|
|
1576
|
+
scimgateway.authPassThroughAllowed = false
|
|
1577
|
+
// end - mandatory plugin initialization
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
**Old Node.js startup:**
|
|
1581
|
+
|
|
1582
|
+
node --experimental-strip-types c:\scimgateway\index.ts // scimgateway downloaded from github
|
|
1583
|
+
|
|
1584
|
+
**New Node.js startup:**
|
|
1585
|
+
|
|
1586
|
+
node --import=tsx ./index.ts // running in local package
|
|
1587
|
+
|
|
1588
|
+
- index.ts now using static import instead of dynamic
|
|
1589
|
+
|
|
1590
|
+
**Old index.ts:**
|
|
1591
|
+
|
|
1592
|
+
const plugins = ['loki']
|
|
1593
|
+
for (const plugin of plugins) {
|
|
1594
|
+
try {
|
|
1595
|
+
await import(`./lib/plugin-${plugin}.ts`)
|
|
1596
|
+
} catch (err: any) {
|
|
1597
|
+
console.error(err)
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
**New index.ts:**
|
|
1602
|
+
|
|
1603
|
+
// start one or more plugins:
|
|
1604
|
+
// import './lib/plugin-scim.ts'
|
|
1605
|
+
// import './lib/plugin-entra-id.ts'
|
|
1606
|
+
// import './lib/plugin-ldap.ts'
|
|
1607
|
+
// import './lib/plugin-mongodb.ts'
|
|
1608
|
+
// import './lib/plugin-api.ts'
|
|
1609
|
+
// import './lib/plugin-mssql.ts'
|
|
1610
|
+
// import './lib/plugin-saphana.ts'
|
|
1611
|
+
// import './lib/plugin-soap.ts'
|
|
1612
|
+
|
|
1613
|
+
import './lib/plugin-loki.ts'
|
|
1614
|
+
export {}
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
- Bun binary build is now supported. A single binary can be compiled that includes both the gateway and the plugin. The binary must have the same name (prefix) as the configuration file in the config directory, and this directory must be located in the same folder as the binary.
|
|
1618
|
+
|
|
1619
|
+
cd my-scimgateway
|
|
1620
|
+
bun build --compile --target=bun-darwin-arm64 --outfile ./build/plugin-loki ./lib/plugin-loki.ts
|
|
1621
|
+
// for target options, see: https://bun.com/docs/bundler/executables#cross-compile-to-other-platforms
|
|
1622
|
+
|
|
1623
|
+
cp -r ./config ./build
|
|
1624
|
+
// build directory now have what is needed and can be put into production
|
|
1625
|
+
cd build
|
|
1626
|
+
// run the binary - note, binary must have same name (prefix) as the configuration file in the config directory
|
|
1627
|
+
./plugin-loki
|
|
1628
|
+
|
|
1629
|
+
- Dependencies bump
|
|
1630
|
+
|
|
1531
1631
|
### v6.0.2
|
|
1532
1632
|
|
|
1533
1633
|
[Fixed]
|