@owlmeans/server-auth 0.1.4 → 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.
@@ -3,4 +3,5 @@ export * from './basic-ed25519.js';
3
3
  export * from './re-captcha.js';
4
4
  export * from './basic-rely.js';
5
5
  export * from './utils.js';
6
+ export { plugins, registerPlugin } from './index.js';
6
7
  //# sourceMappingURL=export.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/export.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/export.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}
@@ -2,4 +2,5 @@ export * from './basic-ed25519.js';
2
2
  export * from './re-captcha.js';
3
3
  export * from './basic-rely.js';
4
4
  export * from './utils.js';
5
+ export { plugins, registerPlugin } from './index.js';
5
6
  //# sourceMappingURL=export.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/manager/plugins/export.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/manager/plugins/export.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}
@@ -1,4 +1,6 @@
1
1
  import type { AuthPlugin } from './types.js';
2
2
  import type { AppContext, AppConfig } from '../types.js';
3
3
  export declare const plugins: Record<string, <C extends AppConfig, T extends AppContext<C>>(context: T) => AuthPlugin>;
4
+ /** Register an external AuthPlugin factory under a custom type string. */
5
+ export declare const registerPlugin: (type: string, factory: <C extends AppConfig, T extends AppContext<C>>(context: T) => AuthPlugin) => void;
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIxD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,UAAU,CAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIxD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,UAAU,CAAM,CAAA;AAMnH,0EAA0E;AAC1E,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,EACZ,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,UAAU,KAChF,IAEF,CAAA"}
@@ -6,4 +6,8 @@ export const plugins = {};
6
6
  plugins[AuthenticationType.BasicEd25519] = basicEd25519;
7
7
  plugins[AuthenticationType.ReCaptcha] = reCaptcha;
8
8
  plugins[AuthenticationType.RelyHandshake] = basicRely;
9
+ /** Register an external AuthPlugin factory under a custom type string. */
10
+ export const registerPlugin = (type, factory) => {
11
+ plugins[type] = factory;
12
+ };
9
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,OAAO,GAA6F,EAAE,CAAA;AAEnH,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,YAAoD,CAAA;AAC/F,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAiD,CAAA;AACzF,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,GAAG,SAAiD,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/manager/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,OAAO,GAA6F,EAAE,CAAA;AAEnH,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,YAAoD,CAAA;AAC/F,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAiD,CAAA;AACzF,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,GAAG,SAAiD,CAAA;AAE7F,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAY,EACZ,OAAiF,EAC3E,EAAE;IACR,OAAO,CAAC,IAAI,CAAC,GAAG,OAA+C,CAAA;AACjE,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-auth",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -37,29 +37,29 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@noble/hashes": "^1.5.0",
40
- "@owlmeans/api": "^0.1.4",
41
- "@owlmeans/api-config-server": "^0.1.4",
42
- "@owlmeans/auth": "^0.1.4",
43
- "@owlmeans/auth-common": "^0.1.4",
44
- "@owlmeans/basic-envelope": "^0.1.4",
45
- "@owlmeans/basic-ids": "^0.1.4",
46
- "@owlmeans/basic-keys": "^0.1.4",
47
- "@owlmeans/client-config": "^0.1.4",
48
- "@owlmeans/client-entrypoint": "^0.1.4",
49
- "@owlmeans/config": "^0.1.4",
50
- "@owlmeans/context": "^0.1.4",
51
- "@owlmeans/kluster": "^0.1.4",
52
- "@owlmeans/entrypoint": "^0.1.4",
53
- "@owlmeans/redis-resource": "^0.1.4",
54
- "@owlmeans/resource": "^0.1.4",
55
- "@owlmeans/route": "^0.1.4",
56
- "@owlmeans/server-api": "^0.1.4",
57
- "@owlmeans/server-context": "^0.1.4",
58
- "@owlmeans/server-entrypoint": "^0.1.4",
59
- "@owlmeans/server-route": "^0.1.4",
60
- "@owlmeans/server-socket": "^0.1.4",
61
- "@owlmeans/socket": "^0.1.4",
62
- "@owlmeans/static-resource": "^0.1.4",
40
+ "@owlmeans/api": "^0.1.6",
41
+ "@owlmeans/api-config-server": "^0.1.6",
42
+ "@owlmeans/auth": "^0.1.6",
43
+ "@owlmeans/auth-common": "^0.1.6",
44
+ "@owlmeans/basic-envelope": "^0.1.6",
45
+ "@owlmeans/basic-ids": "^0.1.6",
46
+ "@owlmeans/basic-keys": "^0.1.6",
47
+ "@owlmeans/client-config": "^0.1.6",
48
+ "@owlmeans/client-entrypoint": "^0.1.6",
49
+ "@owlmeans/config": "^0.1.6",
50
+ "@owlmeans/context": "^0.1.6",
51
+ "@owlmeans/kluster": "^0.1.6",
52
+ "@owlmeans/entrypoint": "^0.1.6",
53
+ "@owlmeans/redis-resource": "^0.1.6",
54
+ "@owlmeans/resource": "^0.1.6",
55
+ "@owlmeans/route": "^0.1.6",
56
+ "@owlmeans/server-api": "^0.1.6",
57
+ "@owlmeans/server-context": "^0.1.6",
58
+ "@owlmeans/server-entrypoint": "^0.1.6",
59
+ "@owlmeans/server-route": "^0.1.6",
60
+ "@owlmeans/server-socket": "^0.1.6",
61
+ "@owlmeans/socket": "^0.1.6",
62
+ "@owlmeans/static-resource": "^0.1.6",
63
63
  "@scure/base": "^1.1.9"
64
64
  },
65
65
  "peerDependencies": {
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@owlmeans/dep-config": "workspace:*",
70
- "@owlmeans/test-auth": "^0.1.4",
70
+ "@owlmeans/test-auth": "^0.1.6",
71
71
  "@types/bun": "^1.3.0",
72
72
  "@types/node": "^24.10.1",
73
73
  "nodemon": "^3.1.11",
@@ -4,3 +4,4 @@ export * from './basic-ed25519.js'
4
4
  export * from './re-captcha.js'
5
5
  export * from './basic-rely.js'
6
6
  export * from './utils.js'
7
+ export { plugins, registerPlugin } from './index.js'
@@ -11,3 +11,11 @@ plugins[AuthenticationType.BasicEd25519] = basicEd25519 as typeof plugins[keyof
11
11
  plugins[AuthenticationType.ReCaptcha] = reCaptcha as typeof plugins[keyof typeof plugins]
12
12
  plugins[AuthenticationType.RelyHandshake] = basicRely as typeof plugins[keyof typeof plugins]
13
13
 
14
+ /** Register an external AuthPlugin factory under a custom type string. */
15
+ export const registerPlugin = (
16
+ type: string,
17
+ factory: <C extends AppConfig, T extends AppContext<C>>(context: T) => AuthPlugin
18
+ ): void => {
19
+ plugins[type] = factory as typeof plugins[keyof typeof plugins]
20
+ }
21
+