@owlmeans/client-iam 0.1.5 → 0.1.6
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/build/append.d.ts +16 -0
- package/build/append.d.ts.map +1 -0
- package/build/append.js +15 -0
- package/build/append.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/package.json +6 -3
- package/src/append.ts +22 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AppConfig, AppContext } from '@owlmeans/web-client';
|
|
2
|
+
import type { WithSharedConfig } from '@owlmeans/oidc';
|
|
3
|
+
type IamClientConfig = AppConfig & WithSharedConfig;
|
|
4
|
+
type IamClientContext<C extends IamClientConfig = IamClientConfig> = AppContext<C>;
|
|
5
|
+
/**
|
|
6
|
+
* One-call OIDC RP setup for a web client context.
|
|
7
|
+
*
|
|
8
|
+
* Replaces the explicit wiring pattern in the target template frontend:
|
|
9
|
+
* appendOidcGuard(context)
|
|
10
|
+
*
|
|
11
|
+
* The OIDC provider config (discovery URL, clientId, secret) is read from
|
|
12
|
+
* context.cfg.oidc.providers[] — populate it before calling appendIam().
|
|
13
|
+
*/
|
|
14
|
+
export declare const appendIam: <C extends IamClientConfig, T extends IamClientContext<C>>(context: T) => T;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=append.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../src/append.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,KAAK,eAAe,GAAG,SAAS,GAAG,gBAAgB,CAAA;AACnD,KAAK,gBAAgB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;AAElF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,eAAe,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAChF,SAAS,CAAC,KACT,CAGF,CAAA"}
|
package/build/append.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { appendOidcGuard } from '@owlmeans/web-oidc-rp';
|
|
2
|
+
/**
|
|
3
|
+
* One-call OIDC RP setup for a web client context.
|
|
4
|
+
*
|
|
5
|
+
* Replaces the explicit wiring pattern in the target template frontend:
|
|
6
|
+
* appendOidcGuard(context)
|
|
7
|
+
*
|
|
8
|
+
* The OIDC provider config (discovery URL, clientId, secret) is read from
|
|
9
|
+
* context.cfg.oidc.providers[] — populate it before calling appendIam().
|
|
10
|
+
*/
|
|
11
|
+
export const appendIam = (context) => {
|
|
12
|
+
appendOidcGuard(context);
|
|
13
|
+
return context;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=append.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"append.js","sourceRoot":"","sources":["../src/append.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAKvD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,OAAU,EACP,EAAE;IACL,eAAe,CAAO,OAAO,CAAC,CAAA;IAC9B,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,eAAe,CAAA;AAClC,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,eAAe,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/client-iam",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -22,8 +22,11 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@owlmeans/context": "^0.1.
|
|
26
|
-
"@owlmeans/iam": "^0.1.
|
|
25
|
+
"@owlmeans/context": "^0.1.6",
|
|
26
|
+
"@owlmeans/iam": "^0.1.6",
|
|
27
|
+
"@owlmeans/oidc": "^0.1.6",
|
|
28
|
+
"@owlmeans/web-client": "^0.1.6",
|
|
29
|
+
"@owlmeans/web-oidc-rp": "^0.1.6"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
32
|
"@owlmeans/dep-config": "workspace:*",
|
package/src/append.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AppConfig, AppContext } from '@owlmeans/web-client'
|
|
2
|
+
import type { WithSharedConfig } from '@owlmeans/oidc'
|
|
3
|
+
import { appendOidcGuard } from '@owlmeans/web-oidc-rp'
|
|
4
|
+
|
|
5
|
+
type IamClientConfig = AppConfig & WithSharedConfig
|
|
6
|
+
type IamClientContext<C extends IamClientConfig = IamClientConfig> = AppContext<C>
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* One-call OIDC RP setup for a web client context.
|
|
10
|
+
*
|
|
11
|
+
* Replaces the explicit wiring pattern in the target template frontend:
|
|
12
|
+
* appendOidcGuard(context)
|
|
13
|
+
*
|
|
14
|
+
* The OIDC provider config (discovery URL, clientId, secret) is read from
|
|
15
|
+
* context.cfg.oidc.providers[] — populate it before calling appendIam().
|
|
16
|
+
*/
|
|
17
|
+
export const appendIam = <C extends IamClientConfig, T extends IamClientContext<C>>(
|
|
18
|
+
context: T
|
|
19
|
+
): T => {
|
|
20
|
+
appendOidcGuard<C, T>(context)
|
|
21
|
+
return context
|
|
22
|
+
}
|
package/src/index.ts
CHANGED