@owlmeans/server-auth 0.1.18-rc.20 → 0.1.18-rc.21

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.
Files changed (38) hide show
  1. package/README.md +8 -2
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/server-auth/SKILL.md +4 -4
  4. package/build/actions/service.d.ts +6 -2
  5. package/build/actions/service.d.ts.map +1 -1
  6. package/build/actions/service.js +5 -4
  7. package/build/actions/service.js.map +1 -1
  8. package/build/entrypoints.d.ts +4 -2
  9. package/build/entrypoints.d.ts.map +1 -1
  10. package/build/entrypoints.js +5 -7
  11. package/build/entrypoints.js.map +1 -1
  12. package/build/manager/actions/manager.d.ts +17 -5
  13. package/build/manager/actions/manager.d.ts.map +1 -1
  14. package/build/manager/actions/manager.js +7 -6
  15. package/build/manager/actions/manager.js.map +1 -1
  16. package/build/manager/entrypoints.d.ts +8 -1
  17. package/build/manager/entrypoints.d.ts.map +1 -1
  18. package/build/manager/entrypoints.js +17 -14
  19. package/build/manager/entrypoints.js.map +1 -1
  20. package/build/manager/exports.d.ts +1 -2
  21. package/build/manager/exports.d.ts.map +1 -1
  22. package/build/manager/exports.js +1 -2
  23. package/build/manager/exports.js.map +1 -1
  24. package/build/model/rely/consumer.d.ts +3 -1
  25. package/build/model/rely/consumer.d.ts.map +1 -1
  26. package/build/model/rely/consumer.js.map +1 -1
  27. package/build/model/rely/provider.d.ts +3 -1
  28. package/build/model/rely/provider.d.ts.map +1 -1
  29. package/build/model/rely/provider.js.map +1 -1
  30. package/package.json +25 -25
  31. package/src/actions/service.ts +9 -8
  32. package/src/entrypoints.ts +8 -13
  33. package/src/manager/README.md +13 -17
  34. package/src/manager/actions/manager.ts +15 -13
  35. package/src/manager/entrypoints.ts +20 -23
  36. package/src/manager/exports.ts +1 -2
  37. package/src/model/rely/consumer.ts +3 -1
  38. package/src/model/rely/provider.ts +3 -1
package/README.md CHANGED
@@ -33,9 +33,15 @@ Reference the guard by alias when protecting routes:
33
33
 
34
34
  ```typescript
35
35
  import { DAUTH_GUARD } from '@owlmeans/server-app'
36
+ import { contract, protocol, typed } from '@owlmeans/entrypoint'
37
+ import { route } from '@owlmeans/route'
36
38
  // same as DEFAULT_ALIAS from @owlmeans/server-auth
37
39
 
38
- const adminEntrypoint = entrypoint(route('admin', '/admin'), guard(DAUTH_GUARD))
40
+ const adminProtocol = protocol(
41
+ route('admin', '/admin'),
42
+ contract(typed<AdminResponse>()),
43
+ { guards: DAUTH_GUARD },
44
+ )
39
45
  ```
40
46
 
41
47
  ## API
@@ -76,7 +82,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
76
82
  your project's skill store (`.agents/skills/`):
77
83
 
78
84
  ```sh
79
- npx @owlmeans/agent-skills@^0.1.18-rc.14
85
+ npx @owlmeans/agent-skills@^0.1.18-rc.15
80
86
  ```
81
87
 
82
88
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/server-auth",
4
- "version": "0.1.18-rc.20",
5
- "generatedAt": "2026-09-10T23:12:07.508Z",
4
+ "version": "0.1.18-rc.21",
5
+ "generatedAt": "2026-09-12T08:39:52.721Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/server-auth
9
9
 
10
10
  **Layer:** Server
11
- **Install:** `"@owlmeans/server-auth": "^0.1.18-rc.20"` in `dependencies`
11
+ **Install:** `"@owlmeans/server-auth": "^0.1.18-rc.21"` in `dependencies`
12
12
 
13
13
  Two halves, deliberately split by subpath:
14
14
 
@@ -25,7 +25,7 @@ An ordinary service imports the root. Only the auth manager imports `./manager`.
25
25
  |--------|-------------|
26
26
  | `appendAuthService(ctx, alias?)` | Register the guard on a server context and expose it as `context.auth()`. Registers a static `AUTH_CACHE` resource when the context has none |
27
27
  | `makeAuthService(alias?)` | The guard service itself: `match`, `handle`, `unpack(token)`, `authenticate(token)` |
28
- | `entrypoints` | `DISPATCHER` and `DISPATCHER_AUTHEN`, elevated — spread these into a service that accepts a manager-issued credential and exchanges it for a bearer |
28
+ | `entrypoints` | `DISPATCHER` and `DISPATCHER_AUTHEN`, server-bound — spread these into a service that accepts a manager-issued credential and exchanges it for a bearer |
29
29
  | `DEFAULT_ALIAS` | `'auth'` — the guard's service alias, matching `DEFAULT_GUARD` |
30
30
  | `AUTH_CACHE` | `'auth-cache'` — the single-use challenge store |
31
31
  | `AUTH_SRV_KEY` | `'auth-service'` — the TRUSTED record whose key signs credential envelopes |
@@ -40,14 +40,14 @@ An ordinary service imports the root. Only the auth manager imports `./manager`.
40
40
  | `makeContext(cfg, customize?)` | A server context preconfigured with the API server, API client, socket service and static `AUTH_CACHE` |
41
41
  | `main(ctx)` | Register the manager entrypoints, configure, init and listen |
42
42
  | `entrypoints` | `AUTHEN`, `AUTHEN_INIT`, `AUTHEN_AUTHEN`, `AUTHEN_RELY`, the api-config entrypoints and the reCAPTCHA siteverify entrypoint |
43
- | `authenticationInit`, `authenticate`, `rely` | The handlers those entrypoints elevate to: `init(request)` → challenge, `authenticate(credential)` → signed credential envelope, and the rely socket |
43
+ | `authenticationInit`, `authenticate`, `rely` | Implementations bound to auth protocols: `init(request)` → challenge, `authenticate(credential)` → signed credential envelope, and the rely socket |
44
44
  | `plugins`, `registerPlugin(type, factory)` | The plugin registry (also on `./manager/plugins`) |
45
45
  | `appendSupervisorAuth(ctx, opts?)`, `setupInternalTokenCoguard(entrypoints, guard?)` | PK supervisor login — see the `supervisor-auth` skill |
46
46
  | `createRelyService(alias?)`, `DEFAULT_RELY`, `RELY_TUNNEL` | The rely guard service |
47
47
  | `AppConfig`, `AppContext`, `AuthModel`, `RelyService`, `RelyAllowanceRequest`, `RelyLinker`, `RelyCarrier` | Types |
48
48
 
49
49
  `./manager` also re-exports the handful of symbols a manager application needs from elsewhere
50
- (`config`, `service`, `TRUSTED`, `elevate`, `handleBody` / `handleRequest`, `backend`,
50
+ (`config`, `service`, `TRUSTED`, `bind`, `handlers`, `backend`,
51
51
  `GUARD_ED25519`, `AUTHEN*` aliases, `TrustedRecord`), so a manager app can be written against this
52
52
  one import.
53
53
 
@@ -1,4 +1,8 @@
1
- import type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint';
1
+ import type { EntrypointProtocol } from '@owlmeans/entrypoint';
2
2
  import type { AuthToken } from '@owlmeans/auth';
3
- export declare const authenticate: RefedEntrypointHandler<AuthToken>;
3
+ export declare const authenticate: (protocol: EntrypointProtocol<{
4
+ body: AuthToken;
5
+ }, AuthToken>) => import("@owlmeans/server-entrypoint").BoundEntrypointHandler<EntrypointProtocol<{
6
+ body: AuthToken;
7
+ }, AuthToken>>;
4
8
  //# sourceMappingURL=service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/actions/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAS/C,eAAO,MAAM,YAAY,EAAE,sBAAsB,CAAC,SAAS,CAK1D,CAAA"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/actions/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAS/C,eAAO,MAAM,YAAY,aAAc,kBAAkB,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,EAAE,SAAS,CAAC;UAAvB,SAAS;cAKvE,CAAA"}
@@ -1,7 +1,8 @@
1
- import { handleBody } from '@owlmeans/server-api';
1
+ import { handlers } from '@owlmeans/server-api';
2
2
  import { assertContext } from '@owlmeans/context';
3
- export const authenticate = handleBody(async (payload, ctx) => {
4
- const context = assertContext(ctx, 'authenticate');
5
- return await context.auth().authenticate(payload);
3
+ const api = handlers();
4
+ export const authenticate = (protocol) => api.request(protocol, async (request, context) => {
5
+ const ctx = assertContext(context, 'authenticate');
6
+ return await ctx.auth().authenticate(request.body);
6
7
  });
7
8
  //# sourceMappingURL=service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/actions/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAKjD,MAAM,CAAC,MAAM,YAAY,GAAsC,UAAU,CACvE,KAAK,EAAE,OAAkB,EAAE,GAAG,EAAE,EAAE;IAChC,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,EAAE,cAAc,CAAY,CAAA;IAC7D,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;AACnD,CAAC,CACF,CAAA"}
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/actions/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAK/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD,MAAM,GAAG,GAAG,QAAQ,EAAW,CAAA;AAE/B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAA4D,EAAE,EAAE,CAC3F,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC/C,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,EAAE,cAAc,CAAY,CAAA;IAE7D,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA"}
@@ -1,3 +1,5 @@
1
- import type { ServerEntrypoint } from '@owlmeans/server-entrypoint';
2
- export declare const entrypoints: ServerEntrypoint<unknown>[];
1
+ import type { ServerProtocolEntrypoint } from '@owlmeans/server-entrypoint';
2
+ import type { EntrypointProtocolDeclaration } from '@owlmeans/entrypoint';
3
+ /** Server entrypoints required by the generic authentication service. */
4
+ export declare const entrypoints: ServerProtocolEntrypoint<EntrypointProtocolDeclaration>[];
3
5
  //# sourceMappingURL=entrypoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAOnE,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAKlD,CAAA"}
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAE3E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AAGzE,yEAAyE;AACzE,eAAO,MAAM,WAAW,EAAE,wBAAwB,CAAC,6BAA6B,CAAC,EAGhF,CAAA"}
@@ -1,11 +1,9 @@
1
- import { elevate } from '@owlmeans/server-entrypoint';
2
- import { entrypoints as list } from '@owlmeans/auth-common';
3
- import { DISPATCHER, DISPATCHER_AUTHEN } from '@owlmeans/auth';
1
+ import { bind } from '@owlmeans/server-entrypoint';
2
+ import { authProtocols } from '@owlmeans/auth-common';
4
3
  import { authenticate } from './actions/service.js';
5
- import { stab, elevate as celevate } from '@owlmeans/client-entrypoint';
6
- elevate(list, DISPATCHER_AUTHEN, authenticate);
7
- celevate(list, DISPATCHER, stab);
4
+ /** Server entrypoints required by the generic authentication service. */
8
5
  export const entrypoints = [
9
- ...list.filter((module) => [DISPATCHER, DISPATCHER_AUTHEN].includes(module.alias))
6
+ bind(authProtocols.dispatcher),
7
+ bind(authProtocols.dispatcherAuthenticate, authenticate(authProtocols.dispatcherAuthenticate)),
10
8
  ];
11
9
  //# sourceMappingURL=entrypoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,YAAY,CAAC,CAAA;AAC9C,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAgC;IACtD,GAAG,IAAI,CAAC,MAAM,CACZ,CAAC,MAAM,EAAuC,EAAE,CAC9C,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CACzD;CACF,CAAA"}
1
+ {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAA8D;IACpF,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;IAC9B,IAAI,CAAC,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAC/F,CAAA"}
@@ -1,6 +1,18 @@
1
- import type { AllowanceRequest, AuthCredentials } from '@owlmeans/auth';
2
- import type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint';
3
- export declare const authenticationInit: RefedEntrypointHandler<AllowanceRequest>;
4
- export declare const authenticate: RefedEntrypointHandler<AuthCredentials>;
5
- export declare const rely: RefedEntrypointHandler<void>;
1
+ import type { AllowanceRequest, AllowanceResponse, AuthCredentials, AuthToken } from '@owlmeans/auth';
2
+ import type { EntrypointProtocol } from '@owlmeans/entrypoint';
3
+ export declare const authenticationInit: (protocol: EntrypointProtocol<{
4
+ body: AllowanceRequest;
5
+ }, AllowanceResponse>) => import("@owlmeans/server-entrypoint").BoundEntrypointHandler<EntrypointProtocol<{
6
+ body: AllowanceRequest;
7
+ }, AllowanceResponse>>;
8
+ export declare const authenticate: (protocol: EntrypointProtocol<{
9
+ body: AuthCredentials;
10
+ }, AuthToken>) => import("@owlmeans/server-entrypoint").BoundEntrypointHandler<EntrypointProtocol<{
11
+ body: AuthCredentials;
12
+ }, AuthToken>>;
13
+ export declare const rely: (protocol: EntrypointProtocol<{
14
+ query: Partial<AuthToken>;
15
+ }, undefined>) => import("@owlmeans/server-entrypoint").BoundEntrypointHandler<EntrypointProtocol<{
16
+ query: Partial<AuthToken>;
17
+ }, undefined>>;
6
18
  //# sourceMappingURL=manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/manager/actions/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIzE,eAAO,MAAM,kBAAkB,EAAE,sBAAsB,CAAC,gBAAgB,CAGvE,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,sBAAsB,CAAC,eAAe,CAGhE,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAK7C,CAAA"}
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/manager/actions/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAQ9D,eAAO,MAAM,kBAAkB,aAAc,kBAAkB,CAAC;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,EAAE,iBAAiB,CAAC;UAAtC,gBAAgB;sBAGvF,CAAA;AAED,eAAO,MAAM,YAAY,aAAc,kBAAkB,CAAC;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,EAAE,SAAS,CAAC;UAA7B,eAAe;cAGhF,CAAA;AAED,eAAO,MAAM,IAAI,aAAc,kBAAkB,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAAE,EAAE,SAAS,CAAC;WAAhC,OAAO,CAAC,SAAS,CAAC;cAK5E,CAAA"}
@@ -1,10 +1,11 @@
1
- import { handleBody } from '@owlmeans/server-api';
1
+ import { handlers } from '@owlmeans/server-api';
2
2
  import { makeAuthModel } from '../model.js';
3
- import { handleConnection } from '@owlmeans/server-socket';
4
- export const authenticationInit = handleBody(async (payload, ctx) => await makeAuthModel(ctx).init(payload));
5
- export const authenticate = handleBody(async (payload, ctx) => await makeAuthModel(ctx).authenticate(payload));
6
- export const rely = handleConnection(
3
+ import { connection } from '@owlmeans/server-socket';
4
+ const api = handlers();
5
+ export const authenticationInit = (protocol) => api.body(protocol, async (body, context) => await makeAuthModel(context).init(body));
6
+ export const authenticate = (protocol) => api.body(protocol, async (body, context) => await makeAuthModel(context).authenticate(body));
7
+ export const rely = (protocol) => connection(protocol,
7
8
  // @TODO Request will contain information is there requrest
8
9
  // privileged or not (privileged request implies auth provider)
9
- async (conn, ctx, req) => await makeAuthModel(ctx).rely(conn, req.auth));
10
+ async (conn, context, request) => await makeAuthModel(context).rely(conn, request.auth));
10
11
  //# sourceMappingURL=manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/manager/actions/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D,MAAM,CAAC,MAAM,kBAAkB,GAA6C,UAAU,CACpF,KAAK,EAAE,OAAyB,EAAE,GAAG,EAAE,EAAE,CACvC,MAAM,aAAa,CAAC,GAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAClE,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAA4C,UAAU,CAC7E,KAAK,EAAE,OAAwB,EAAE,GAAG,EAAE,EAAE,CACtC,MAAM,aAAa,CAAC,GAA4B,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAC1E,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAiC,gBAAgB;AAChE,4DAA4D;AAC5D,+DAA+D;AAC/D,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CACvB,MAAM,aAAa,CAAC,GAA4B,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CACzE,CAAA"}
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/manager/actions/manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,MAAM,GAAG,GAAG,QAAQ,EAAyB,CAAA;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA2E,EAAE,EAAE,CAChH,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAC3C,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACxC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAkE,EAAE,EAAE,CACjG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAC3C,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAChD,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,QAAsE,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ;AACjH,4DAA4D;AAC5D,+DAA+D;AAC/D,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAC/B,MAAM,aAAa,CAAC,OAAgC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CACjF,CAAA"}
@@ -1,2 +1,9 @@
1
- export declare const entrypoints: import("@owlmeans/entrypoint").CommonEntrypoint[];
1
+ /** Server entrypoints for the full authentication manager. */
2
+ export declare const entrypoints: (import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<import("@owlmeans/entrypoint").OpenRequest, import("@owlmeans/entrypoint").OpenValue>> | import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
3
+ body: import("@owlmeans/auth").AllowanceRequest;
4
+ }, import("@owlmeans/auth").AllowanceResponse>> | import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
5
+ body: import("@owlmeans/auth").AuthCredentials;
6
+ }, import("@owlmeans/auth").AuthToken>> | import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
7
+ query: Partial<import("@owlmeans/auth").AuthToken>;
8
+ }, undefined>>)[];
2
9
  //# sourceMappingURL=entrypoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../../src/manager/entrypoints.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,WAAW,mDAAO,CAAA"}
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../../src/manager/entrypoints.ts"],"names":[],"mappings":"AAiBA,8DAA8D;AAC9D,eAAO,MAAM,WAAW;;;;;;iBAOvB,CAAA"}
@@ -1,21 +1,24 @@
1
- import { AUTHEN, AUTHEN_AUTHEN, AUTHEN_INIT, AUTHEN_RELY, MOD_RECAPTCHA } from '@owlmeans/auth';
2
- import { entrypoints as list } from '@owlmeans/auth-common';
3
- import { entrypoints as apiConfig } from '@owlmeans/api-config-server';
4
- import { elevate, guard } from '@owlmeans/server-entrypoint';
1
+ import { MOD_RECAPTCHA } from '@owlmeans/auth';
2
+ import { authProtocols } from '@owlmeans/auth-common';
3
+ import { entrypoints as apiConfigBindings } from '@owlmeans/api-config-server';
4
+ import { bind } from '@owlmeans/server-entrypoint';
5
+ import { decorateEntrypoint, openProtocol } from '@owlmeans/entrypoint';
5
6
  import * as actions from './actions/index.js';
6
- import { entrypoint } from '@owlmeans/client-entrypoint';
7
7
  import { backend, route, RouteMethod } from '@owlmeans/route';
8
- import { handleIntermediate } from '@owlmeans/server-api';
9
8
  import { DEFAULT_RELY } from './consts.js';
10
- elevate(list, AUTHEN, handleIntermediate(async (_, context) => context), { intermediate: true });
11
- elevate(list, AUTHEN_INIT, actions.authenticationInit);
12
- elevate(list, AUTHEN_AUTHEN, actions.authenticate);
13
- elevate(list, AUTHEN_RELY, actions.rely, guard(DEFAULT_RELY));
14
- export const entrypoints = list;
15
- list.push(...apiConfig);
16
- list.push(entrypoint(route(MOD_RECAPTCHA, '/api/siteverify', backend({
9
+ const relyProtocol = decorateEntrypoint(authProtocols.rely, { guards: DEFAULT_RELY });
10
+ const reCaptchaProtocol = openProtocol(route(MOD_RECAPTCHA, '/api/siteverify', backend({
17
11
  host: 'https://www.google.com',
18
12
  base: 'recaptcha',
19
13
  secure: true,
20
- }, RouteMethod.POST))));
14
+ }, RouteMethod.POST)));
15
+ /** Server entrypoints for the full authentication manager. */
16
+ export const entrypoints = [
17
+ bind(authProtocols.authen, undefined, { intermediate: true }),
18
+ bind(authProtocols.init, actions.authenticationInit(authProtocols.init)),
19
+ bind(authProtocols.authenticate, actions.authenticate(authProtocols.authenticate)),
20
+ bind(relyProtocol, actions.rely(relyProtocol)),
21
+ ...apiConfigBindings,
22
+ bind(reCaptchaProtocol),
23
+ ];
21
24
  //# sourceMappingURL=entrypoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../../src/manager/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC/F,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,WAAW,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,CACtC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAC9B,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;AAC1B,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;AACtD,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;AAClD,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAA;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAA;AAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;AACvB,IAAI,CAAC,IAAI,CACP,UAAU,CACR,KAAK,CAAC,aAAa,EAAE,iBAAiB,EAAE,OAAO,CAAC;IAC9C,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,IAAI;CACb,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CACtB,CACF,CAAA"}
1
+ {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../../src/manager/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,YAAY,GAAG,kBAAkB,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAA;AACrF,MAAM,iBAAiB,GAAG,YAAY,CAAC,KAAK,CAAC,aAAa,EAAE,iBAAiB,EAAE,OAAO,CAAC;IACrF,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,IAAI;CACb,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAEtB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAC7D,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACxE,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAClF,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,GAAG,iBAAiB;IACpB,IAAI,CAAC,iBAAiB,CAAC;CACxB,CAAA"}
@@ -4,8 +4,7 @@ export { addWebService } from '@owlmeans/client-config';
4
4
  export { service, TRUSTED } from '@owlmeans/config';
5
5
  export { AppType, assertContext } from '@owlmeans/context';
6
6
  export { klusterize } from '@owlmeans/kluster';
7
- export { elevate } from '@owlmeans/server-entrypoint';
8
- export { elevate as celevate, stab } from '@owlmeans/client-entrypoint';
7
+ export { stab } from '@owlmeans/client-entrypoint';
9
8
  export type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint';
10
9
  export { handleIntermediate, handleBody, handleRequest, handleParams } from '@owlmeans/server-api';
11
10
  export type { AbstractRequest, AbstractResponse } from '@owlmeans/entrypoint';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/manager/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACvE,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAClG,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/manager/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAClG,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
@@ -3,8 +3,7 @@ export { addWebService } from '@owlmeans/client-config';
3
3
  export { service, TRUSTED } from '@owlmeans/config';
4
4
  export { AppType, assertContext } from '@owlmeans/context';
5
5
  export { klusterize } from '@owlmeans/kluster';
6
- export { elevate } from '@owlmeans/server-entrypoint';
7
- export { elevate as celevate, stab } from '@owlmeans/client-entrypoint';
6
+ export { stab } from '@owlmeans/client-entrypoint';
8
7
  export { handleIntermediate, handleBody, handleRequest, handleParams } from '@owlmeans/server-api';
9
8
  export { backend } from '@owlmeans/route';
10
9
  export { AUTHEN, AUTHEN_AUTHEN, AUTHEN_INIT } from '@owlmeans/auth';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/manager/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/manager/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,3 +1,5 @@
1
+ import type { RelyToken } from '@owlmeans/auth';
2
+ import type { EnvelopeModel } from '@owlmeans/basic-envelope';
1
3
  import type { RelyOptions } from './types.js';
2
- export declare const makeConsumerRely: (opts?: RelyOptions) => import("@owlmeans/basic-envelope").EnvelopeModel<import("@owlmeans/auth").RelyToken>;
4
+ export declare const makeConsumerRely: (opts?: RelyOptions) => EnvelopeModel<RelyToken>;
3
5
  //# sourceMappingURL=consumer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consumer.d.ts","sourceRoot":"","sources":["../../../src/model/rely/consumer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,eAAO,MAAM,gBAAgB,UAAW,WAAW,yFAOlD,CAAA"}
1
+ {"version":3,"file":"consumer.d.ts","sourceRoot":"","sources":["../../../src/model/rely/consumer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,eAAO,MAAM,gBAAgB,UAAW,WAAW,KAAG,aAAa,CAAC,SAAS,CAO5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../../src/model/rely/consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAGzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAkB,EAAE,EAAE;IACrD,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,CAAA;IAC3B,OAAO,GAAG,CAAC,GAAG,CAAA;IACd,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAEf,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
1
+ {"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../../src/model/rely/consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAKzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAkB,EAA4B,EAAE;IAC/E,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,CAAA;IAC3B,OAAO,GAAG,CAAC,GAAG,CAAA;IACd,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAEf,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
@@ -1,3 +1,5 @@
1
+ import type { RelyToken } from '@owlmeans/auth';
2
+ import type { EnvelopeModel } from '@owlmeans/basic-envelope';
1
3
  import type { RelyOptions } from './types.js';
2
- export declare const makeProviderRely: (opts?: RelyOptions) => import("@owlmeans/basic-envelope").EnvelopeModel<import("@owlmeans/auth").RelyToken>;
4
+ export declare const makeProviderRely: (opts?: RelyOptions) => EnvelopeModel<RelyToken>;
3
5
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/model/rely/provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,eAAO,MAAM,gBAAgB,UAAW,WAAW,yFAIlD,CAAA"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/model/rely/provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,eAAO,MAAM,gBAAgB,UAAW,WAAW,KAAG,aAAa,CAAC,SAAS,CAI5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/model/rely/provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAGzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAkB,EAAE,EAAE;IACrD,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IAEjC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/model/rely/provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAKzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAkB,EAA4B,EAAE;IAC/E,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IAEjC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-auth",
3
- "version": "0.1.18-rc.20",
3
+ "version": "0.1.18-rc.21",
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.18-rc.15",
41
- "@owlmeans/api-config-server": "^0.1.18-rc.19",
42
- "@owlmeans/auth": "^0.1.18-rc.11",
43
- "@owlmeans/auth-common": "^0.1.18-rc.15",
44
- "@owlmeans/basic-envelope": "^0.1.18-rc.14",
45
- "@owlmeans/basic-ids": "^0.1.18-rc.11",
46
- "@owlmeans/basic-keys": "^0.1.18-rc.14",
47
- "@owlmeans/client-config": "^0.1.18-rc.14",
48
- "@owlmeans/client-entrypoint": "^0.1.18-rc.15",
49
- "@owlmeans/config": "^0.1.18-rc.14",
50
- "@owlmeans/context": "^0.1.18-rc.10",
51
- "@owlmeans/kluster": "^0.1.18-rc.14",
52
- "@owlmeans/entrypoint": "^0.1.18-rc.13",
53
- "@owlmeans/redis-resource": "^0.1.18-rc.14",
54
- "@owlmeans/resource": "^0.1.18-rc.11",
55
- "@owlmeans/route": "^0.1.18-rc.11",
56
- "@owlmeans/server-api": "^0.1.18-rc.19",
57
- "@owlmeans/server-context": "^0.1.18-rc.14",
58
- "@owlmeans/server-entrypoint": "^0.1.18-rc.13",
59
- "@owlmeans/server-route": "^0.1.18-rc.11",
60
- "@owlmeans/server-socket": "^0.1.18-rc.20",
61
- "@owlmeans/socket": "^0.1.18-rc.11",
62
- "@owlmeans/static-resource": "^0.1.18-rc.11",
40
+ "@owlmeans/api": "^0.1.18-rc.16",
41
+ "@owlmeans/api-config-server": "^0.1.18-rc.20",
42
+ "@owlmeans/auth": "^0.1.18-rc.12",
43
+ "@owlmeans/auth-common": "^0.1.18-rc.16",
44
+ "@owlmeans/basic-envelope": "^0.1.18-rc.15",
45
+ "@owlmeans/basic-ids": "^0.1.18-rc.12",
46
+ "@owlmeans/basic-keys": "^0.1.18-rc.15",
47
+ "@owlmeans/client-config": "^0.1.18-rc.15",
48
+ "@owlmeans/client-entrypoint": "^0.1.18-rc.16",
49
+ "@owlmeans/config": "^0.1.18-rc.15",
50
+ "@owlmeans/context": "^0.1.18-rc.11",
51
+ "@owlmeans/kluster": "^0.1.18-rc.15",
52
+ "@owlmeans/entrypoint": "^0.1.18-rc.14",
53
+ "@owlmeans/redis-resource": "^0.1.18-rc.15",
54
+ "@owlmeans/resource": "^0.1.18-rc.12",
55
+ "@owlmeans/route": "^0.1.18-rc.12",
56
+ "@owlmeans/server-api": "^0.1.18-rc.20",
57
+ "@owlmeans/server-context": "^0.1.18-rc.15",
58
+ "@owlmeans/server-entrypoint": "^0.1.18-rc.14",
59
+ "@owlmeans/server-route": "^0.1.18-rc.12",
60
+ "@owlmeans/server-socket": "^0.1.18-rc.21",
61
+ "@owlmeans/socket": "^0.1.18-rc.12",
62
+ "@owlmeans/static-resource": "^0.1.18-rc.12",
63
63
  "@scure/base": "^2.3.0"
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.18-rc.15",
70
+ "@owlmeans/test-auth": "^0.1.18-rc.16",
71
71
  "@types/bun": "^1.4.0",
72
72
  "@types/node": "^26.1.0",
73
73
  "nodemon": "^3.1.14",
@@ -1,16 +1,17 @@
1
- import type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint'
1
+ import { handlers } from '@owlmeans/server-api'
2
+ import type { EntrypointProtocol } from '@owlmeans/entrypoint'
2
3
  import type { AuthToken } from '@owlmeans/auth'
3
- import { handleBody } from '@owlmeans/server-api'
4
4
  import { AuthServiceAppend } from '../types.js'
5
5
  import type { ServerConfig, ServerContext } from '@owlmeans/server-context'
6
6
  import { assertContext } from '@owlmeans/context'
7
7
 
8
8
  type Config = ServerConfig
9
9
  type Context = ServerContext<Config> & AuthServiceAppend
10
+ const api = handlers<Context>()
10
11
 
11
- export const authenticate: RefedEntrypointHandler<AuthToken> = handleBody(
12
- async (payload: AuthToken, ctx) => {
13
- const context = assertContext(ctx, 'authenticate') as Context
14
- return await context.auth().authenticate(payload)
15
- }
16
- )
12
+ export const authenticate = (protocol: EntrypointProtocol<{ body: AuthToken }, AuthToken>) =>
13
+ api.request(protocol, async (request, context) => {
14
+ const ctx = assertContext(context, 'authenticate') as Context
15
+
16
+ return await ctx.auth().authenticate(request.body)
17
+ })
@@ -1,17 +1,12 @@
1
1
 
2
- import { elevate } from '@owlmeans/server-entrypoint'
3
- import { entrypoints as list } from '@owlmeans/auth-common'
4
- import { DISPATCHER, DISPATCHER_AUTHEN } from '@owlmeans/auth'
5
- import type { ServerEntrypoint } from '@owlmeans/server-entrypoint'
2
+ import { bind } from '@owlmeans/server-entrypoint'
3
+ import type { ServerProtocolEntrypoint } from '@owlmeans/server-entrypoint'
4
+ import { authProtocols } from '@owlmeans/auth-common'
5
+ import type { EntrypointProtocolDeclaration } from '@owlmeans/entrypoint'
6
6
  import { authenticate } from './actions/service.js'
7
- import { stab, elevate as celevate } from '@owlmeans/client-entrypoint'
8
7
 
9
- elevate(list, DISPATCHER_AUTHEN, authenticate)
10
- celevate(list, DISPATCHER, stab)
11
-
12
- export const entrypoints: ServerEntrypoint<unknown>[] = [
13
- ...list.filter(
14
- (module): module is ServerEntrypoint<unknown> =>
15
- [DISPATCHER, DISPATCHER_AUTHEN].includes(module.alias)
16
- )
8
+ /** Server entrypoints required by the generic authentication service. */
9
+ export const entrypoints: ServerProtocolEntrypoint<EntrypointProtocolDeclaration>[] = [
10
+ bind(authProtocols.dispatcher),
11
+ bind(authProtocols.dispatcherAuthenticate, authenticate(authProtocols.dispatcherAuthenticate)),
17
12
  ]
@@ -27,11 +27,11 @@ A specialized guard service that enables authentication token relay between micr
27
27
  - **Wallet DID Authentication**: Decentralized identity authentication support
28
28
  - **Challenge Validation**: Anti-replay protection using challenge-response mechanisms
29
29
 
30
- ### Module-Based Architecture
31
- The manager is built on the OwlMeans module system, providing:
30
+ ### Entrypoint-Based Architecture
31
+ The manager is built on the OwlMeans entrypoint system, providing:
32
32
  - **Route Management**: Standardized API endpoints for authentication operations
33
- - **Handler Registration**: Modular request handlers for different authentication flows
34
- - **Guard Integration**: Automatic security enforcement at the module level
33
+ - **Handler Registration**: Protocol-backed request handlers for different authentication flows
34
+ - **Guard Integration**: Automatic security enforcement at the entrypoint level
35
35
 
36
36
  ## Installation
37
37
 
@@ -317,20 +317,16 @@ await authModel.rely(connection, authToken.auth)
317
317
 
318
318
  ### API Integration
319
319
 
320
- ```typescript
321
- import { modules } from '@owlmeans/server-auth/manager'
322
-
323
- // The manager automatically registers these API endpoints:
320
+ `main(context)` registers the manager's immutable `entrypoints` and starts the API server. For a
321
+ custom bootstrap, register the exported collection yourself; the manager's protocols are then
322
+ addressed through the same `context.entrypoint(protocol)` lookup as application endpoints.
324
323
 
325
- // POST /api/auth/init - Authentication initialization
326
- // POST /api/auth/authenticate - User authentication
327
- // WebSocket /api/auth/rely - Authentication relay
324
+ ```typescript
325
+ import { entrypoints, makeContext } from '@owlmeans/server-auth/manager'
328
326
 
329
- // Access modules for custom routing
330
- modules.forEach(module => {
331
- console.log(`Route: ${module.getPath()}`)
332
- console.log(`Method: ${module.route.method}`)
333
- })
327
+ const context = makeContext(config)
328
+ context.registerEntrypoints(entrypoints)
329
+ await context.configure().init()
334
330
  ```
335
331
 
336
332
  ## API Endpoints
@@ -504,4 +500,4 @@ This manager app depends on:
504
500
  - [`@owlmeans/server-auth`](../../../README.md) - Parent server authentication package
505
501
  - [`@owlmeans/auth`](../../../auth/README.md) - Core authentication library
506
502
  - [`@owlmeans/client-auth`](../../../client-auth/README.md) - Client-side authentication
507
- - [`@owlmeans/context`](../../../context/README.md) - Context management system
503
+ - [`@owlmeans/context`](../../../context/README.md) - Context management system
@@ -1,23 +1,25 @@
1
- import type { AllowanceRequest, AuthCredentials } from '@owlmeans/auth'
2
- import { handleBody } from '@owlmeans/server-api'
1
+ import type { AllowanceRequest, AllowanceResponse, AuthCredentials, AuthToken } from '@owlmeans/auth'
2
+ import type { EntrypointProtocol } from '@owlmeans/entrypoint'
3
+ import { handlers } from '@owlmeans/server-api'
3
4
  import { makeAuthModel } from '../model.js'
4
- import type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint'
5
5
  import type { AppContext, AppConfig } from '../types.js'
6
- import { handleConnection } from '@owlmeans/server-socket'
6
+ import { connection } from '@owlmeans/server-socket'
7
7
 
8
- export const authenticationInit: RefedEntrypointHandler<AllowanceRequest> = handleBody(
9
- async (payload: AllowanceRequest, ctx) =>
10
- await makeAuthModel(ctx as AppContext<AppConfig>).init(payload)
8
+ const api = handlers<AppContext<AppConfig>>()
9
+
10
+ export const authenticationInit = (protocol: EntrypointProtocol<{ body: AllowanceRequest }, AllowanceResponse>) =>
11
+ api.body(protocol, async (body, context) =>
12
+ await makeAuthModel(context).init(body)
11
13
  )
12
14
 
13
- export const authenticate: RefedEntrypointHandler<AuthCredentials> = handleBody(
14
- async (payload: AuthCredentials, ctx) =>
15
- await makeAuthModel(ctx as AppContext<AppConfig>).authenticate(payload)
15
+ export const authenticate = (protocol: EntrypointProtocol<{ body: AuthCredentials }, AuthToken>) =>
16
+ api.body(protocol, async (body, context) =>
17
+ await makeAuthModel(context).authenticate(body)
16
18
  )
17
19
 
18
- export const rely: RefedEntrypointHandler<void> = handleConnection(
20
+ export const rely = (protocol: EntrypointProtocol<{ query: Partial<AuthToken> }, undefined>) => connection(protocol,
19
21
  // @TODO Request will contain information is there requrest
20
22
  // privileged or not (privileged request implies auth provider)
21
- async (conn, ctx, req) =>
22
- await makeAuthModel(ctx as AppContext<AppConfig>).rely(conn, req.auth)
23
+ async (conn, context, request) =>
24
+ await makeAuthModel(context as AppContext<AppConfig>).rely(conn, request.auth)
23
25
  )
@@ -1,29 +1,26 @@
1
1
 
2
- import { AUTHEN, AUTHEN_AUTHEN, AUTHEN_INIT, AUTHEN_RELY, MOD_RECAPTCHA } from '@owlmeans/auth'
3
- import { entrypoints as list } from '@owlmeans/auth-common'
4
- import { entrypoints as apiConfig } from '@owlmeans/api-config-server'
5
- import { elevate, guard } from '@owlmeans/server-entrypoint'
2
+ import { MOD_RECAPTCHA } from '@owlmeans/auth'
3
+ import { authProtocols } from '@owlmeans/auth-common'
4
+ import { entrypoints as apiConfigBindings } from '@owlmeans/api-config-server'
5
+ import { bind } from '@owlmeans/server-entrypoint'
6
+ import { decorateEntrypoint, openProtocol } from '@owlmeans/entrypoint'
6
7
  import * as actions from './actions/index.js'
7
- import { entrypoint } from '@owlmeans/client-entrypoint'
8
8
  import { backend, route, RouteMethod } from '@owlmeans/route'
9
- import { handleIntermediate } from '@owlmeans/server-api'
10
9
  import { DEFAULT_RELY } from './consts.js'
11
10
 
12
- elevate(list, AUTHEN, handleIntermediate(
13
- async (_, context) => context
14
- ), { intermediate: true })
15
- elevate(list, AUTHEN_INIT, actions.authenticationInit)
16
- elevate(list, AUTHEN_AUTHEN, actions.authenticate)
17
- elevate(list, AUTHEN_RELY, actions.rely, guard(DEFAULT_RELY))
11
+ const relyProtocol = decorateEntrypoint(authProtocols.rely, { guards: DEFAULT_RELY })
12
+ const reCaptchaProtocol = openProtocol(route(MOD_RECAPTCHA, '/api/siteverify', backend({
13
+ host: 'https://www.google.com',
14
+ base: 'recaptcha',
15
+ secure: true,
16
+ }, RouteMethod.POST)))
18
17
 
19
- export const entrypoints = list
20
- list.push(...apiConfig)
21
- list.push(
22
- entrypoint(
23
- route(MOD_RECAPTCHA, '/api/siteverify', backend({
24
- host: 'https://www.google.com',
25
- base: 'recaptcha',
26
- secure: true,
27
- }, RouteMethod.POST))
28
- )
29
- )
18
+ /** Server entrypoints for the full authentication manager. */
19
+ export const entrypoints = [
20
+ bind(authProtocols.authen, undefined, { intermediate: true }),
21
+ bind(authProtocols.init, actions.authenticationInit(authProtocols.init)),
22
+ bind(authProtocols.authenticate, actions.authenticate(authProtocols.authenticate)),
23
+ bind(relyProtocol, actions.rely(relyProtocol)),
24
+ ...apiConfigBindings,
25
+ bind(reCaptchaProtocol),
26
+ ]
@@ -5,8 +5,7 @@ export { addWebService } from '@owlmeans/client-config'
5
5
  export { service, TRUSTED } from '@owlmeans/config'
6
6
  export { AppType, assertContext } from '@owlmeans/context'
7
7
  export { klusterize } from '@owlmeans/kluster'
8
- export { elevate } from '@owlmeans/server-entrypoint'
9
- export { elevate as celevate, stab } from '@owlmeans/client-entrypoint'
8
+ export { stab } from '@owlmeans/client-entrypoint'
10
9
  export type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint'
11
10
  export { handleIntermediate, handleBody, handleRequest, handleParams } from '@owlmeans/server-api'
12
11
  export type { AbstractRequest, AbstractResponse } from '@owlmeans/entrypoint'
@@ -1,7 +1,9 @@
1
1
  import { makeRelyModel } from './peer.js'
2
+ import type { RelyToken } from '@owlmeans/auth'
3
+ import type { EnvelopeModel } from '@owlmeans/basic-envelope'
2
4
  import type { RelyOptions } from './types.js'
3
5
 
4
- export const makeConsumerRely = (opts?: RelyOptions) => {
6
+ export const makeConsumerRely = (opts?: RelyOptions): EnvelopeModel<RelyToken> => {
5
7
  const model = makeRelyModel(opts)
6
8
  const msg = model.message()
7
9
  delete msg.pin
@@ -1,8 +1,10 @@
1
1
 
2
2
  import { makeRelyModel } from './peer.js'
3
+ import type { RelyToken } from '@owlmeans/auth'
4
+ import type { EnvelopeModel } from '@owlmeans/basic-envelope'
3
5
  import type { RelyOptions } from './types.js'
4
6
 
5
- export const makeProviderRely = (opts?: RelyOptions) => {
7
+ export const makeProviderRely = (opts?: RelyOptions): EnvelopeModel<RelyToken> => {
6
8
  const model = makeRelyModel(opts)
7
9
 
8
10
  return model