@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.
@@ -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"}
@@ -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
@@ -1,3 +1,4 @@
1
1
  export type * from '@owlmeans/iam';
2
2
  export * from './consts.js';
3
+ export * from './append.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -1,2 +1,3 @@
1
1
  export * from './consts.js';
2
+ export * from './append.js';
2
3
  //# sourceMappingURL=index.js.map
@@ -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.5",
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.5",
26
- "@owlmeans/iam": "^0.1.5"
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
@@ -1,2 +1,3 @@
1
1
  export type * from '@owlmeans/iam'
2
2
  export * from './consts.js'
3
+ export * from './append.js'