@owlmeans/server-auth 0.1.18-rc.4 → 0.1.18-rc.41

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 (111) hide show
  1. package/README.md +184 -38
  2. package/agent-meta/manifest.json +9 -2
  3. package/agent-meta/skills/server-auth/SKILL.md +101 -22
  4. package/agent-meta/skills/supervisor-auth/SKILL.md +128 -0
  5. package/build/actions/service.d.ts +6 -2
  6. package/build/actions/service.d.ts.map +1 -1
  7. package/build/actions/service.js +5 -4
  8. package/build/actions/service.js.map +1 -1
  9. package/build/entrypoints.d.ts +5 -0
  10. package/build/entrypoints.d.ts.map +1 -0
  11. package/build/entrypoints.js +9 -0
  12. package/build/entrypoints.js.map +1 -0
  13. package/build/index.d.ts +1 -1
  14. package/build/index.d.ts.map +1 -1
  15. package/build/index.js +1 -1
  16. package/build/index.js.map +1 -1
  17. package/build/manager/actions/manager.d.ts +17 -5
  18. package/build/manager/actions/manager.d.ts.map +1 -1
  19. package/build/manager/actions/manager.js +7 -6
  20. package/build/manager/actions/manager.js.map +1 -1
  21. package/build/manager/context.d.ts.map +1 -1
  22. package/build/manager/context.js +0 -1
  23. package/build/manager/context.js.map +1 -1
  24. package/build/manager/entrypoints.d.ts +9 -0
  25. package/build/manager/entrypoints.d.ts.map +1 -0
  26. package/build/manager/entrypoints.js +24 -0
  27. package/build/manager/entrypoints.js.map +1 -0
  28. package/build/manager/exports.d.ts +1 -2
  29. package/build/manager/exports.d.ts.map +1 -1
  30. package/build/manager/exports.js +1 -2
  31. package/build/manager/exports.js.map +1 -1
  32. package/build/manager/index.d.ts +1 -1
  33. package/build/manager/index.d.ts.map +1 -1
  34. package/build/manager/index.js +1 -1
  35. package/build/manager/index.js.map +1 -1
  36. package/build/manager/main.js +2 -2
  37. package/build/manager/main.js.map +1 -1
  38. package/build/manager/model.d.ts.map +1 -1
  39. package/build/manager/model.js +26 -10
  40. package/build/manager/model.js.map +1 -1
  41. package/build/manager/plugins/basic-ed25519.js.map +1 -1
  42. package/build/manager/plugins/basic-rely.d.ts.map +1 -1
  43. package/build/manager/plugins/basic-rely.js +5 -5
  44. package/build/manager/plugins/basic-rely.js.map +1 -1
  45. package/build/manager/plugins/export.d.ts +1 -0
  46. package/build/manager/plugins/export.d.ts.map +1 -1
  47. package/build/manager/plugins/export.js +1 -0
  48. package/build/manager/plugins/export.js.map +1 -1
  49. package/build/manager/plugins/re-captcha.js +1 -1
  50. package/build/manager/plugins/re-captcha.js.map +1 -1
  51. package/build/manager/plugins/replay-policy.d.ts +8 -0
  52. package/build/manager/plugins/replay-policy.d.ts.map +1 -0
  53. package/build/manager/plugins/replay-policy.js +9 -0
  54. package/build/manager/plugins/replay-policy.js.map +1 -0
  55. package/build/manager/plugins/supervisor.js +3 -3
  56. package/build/manager/plugins/supervisor.js.map +1 -1
  57. package/build/manager/plugins/types.d.ts +6 -0
  58. package/build/manager/plugins/types.d.ts.map +1 -1
  59. package/build/manager/rely/flow.js +1 -1
  60. package/build/manager/rely/flow.js.map +1 -1
  61. package/build/manager/supervisor.d.ts +5 -5
  62. package/build/manager/supervisor.d.ts.map +1 -1
  63. package/build/manager/supervisor.js +4 -4
  64. package/build/manager/supervisor.js.map +1 -1
  65. package/build/model/rely/consumer.d.ts +3 -1
  66. package/build/model/rely/consumer.d.ts.map +1 -1
  67. package/build/model/rely/consumer.js.map +1 -1
  68. package/build/model/rely/provider.d.ts +3 -1
  69. package/build/model/rely/provider.d.ts.map +1 -1
  70. package/build/model/rely/provider.js.map +1 -1
  71. package/build/service.d.ts.map +1 -1
  72. package/build/service.js +116 -9
  73. package/build/service.js.map +1 -1
  74. package/package.json +28 -26
  75. package/src/actions/service.ts +9 -8
  76. package/src/entrypoints.ts +12 -0
  77. package/src/index.ts +1 -1
  78. package/src/manager/README.md +14 -18
  79. package/src/manager/actions/manager.ts +15 -13
  80. package/src/manager/context.ts +0 -2
  81. package/src/manager/entrypoints.ts +26 -0
  82. package/src/manager/exports.ts +1 -2
  83. package/src/manager/index.ts +1 -1
  84. package/src/manager/main.ts +2 -2
  85. package/src/manager/model.ts +28 -10
  86. package/src/manager/plugins/basic-ed25519.ts +2 -2
  87. package/src/manager/plugins/basic-rely.ts +7 -6
  88. package/src/manager/plugins/export.ts +1 -0
  89. package/src/manager/plugins/re-captcha.ts +3 -3
  90. package/src/manager/plugins/replay-policy.ts +7 -0
  91. package/src/manager/plugins/supervisor.ts +4 -4
  92. package/src/manager/plugins/types.ts +6 -0
  93. package/src/manager/rely/flow.ts +1 -1
  94. package/src/manager/supervisor.ts +6 -6
  95. package/src/model/rely/consumer.ts +3 -1
  96. package/src/model/rely/provider.ts +3 -1
  97. package/src/service.ts +114 -11
  98. package/tests/context.ts +3 -2
  99. package/tests/replay-policy.spec.ts +36 -0
  100. package/tests/supervisor.spec.ts +6 -4
  101. package/build/.gitkeep +0 -0
  102. package/build/manager/modules.d.ts +0 -2
  103. package/build/manager/modules.d.ts.map +0 -1
  104. package/build/manager/modules.js +0 -21
  105. package/build/manager/modules.js.map +0 -1
  106. package/build/modules.d.ts +0 -3
  107. package/build/modules.d.ts.map +0 -1
  108. package/build/modules.js +0 -11
  109. package/build/modules.js.map +0 -1
  110. package/src/manager/modules.ts +0 -29
  111. package/src/modules.ts +0 -17
package/README.md CHANGED
@@ -1,72 +1,218 @@
1
1
  # @owlmeans/server-auth
2
2
 
3
- Server-side Ed25519 authentication service for OwlMeans backends.
4
-
5
- ## Overview
6
-
7
- - Implements the `GuardService` interface for Ed25519-signed token verification
8
- - `appendAuthService()` registers the auth guard into a server context
9
- - `DEFAULT_ALIAS` (`'auth'`) is the service alias and re-exported as `DAUTH_GUARD` via `@owlmeans/server-app`
10
- - Handles token caching via a static resource identified by `AUTH_CACHE`
3
+ The server side of OwlMeans authentication, in two halves. The root export is what every protected
4
+ API service needs: the guard that verifies an Ed25519-signed bearer token and resolves
5
+ `request.auth`, and the dispatcher bindings that exchange a credential issued by the auth manager
6
+ for a bearer of this service. The `./manager` subpath is the auth manager application itself — the
7
+ challenge endpoints, the authentication plugin registry, the signed credential envelope and the rely
8
+ handshake. An ordinary service imports the root (usually implicitly, through
9
+ `@owlmeans/server-app`'s `makeContext`); only the auth manager imports `./manager`. OIDC tokens are
10
+ `@owlmeans/server-oidc-rp`, long-lived API keys `@owlmeans/server-auth-token`, local
11
+ account/profile records `@owlmeans/server-auth-identity`, and the browser side `@owlmeans/client-auth`.
11
12
 
12
13
  ## Installation
13
14
 
14
15
  ```bash
15
- bun add @owlmeans/server-auth
16
+ bun add @owlmeans/server-auth@^0.1.18-rc.41
16
17
  ```
17
18
 
19
+ ## Concepts
20
+
21
+ - **Guard** — the `AuthService` registered as `auth` (the value of `DEFAULT_GUARD`). `match` hits a
22
+ request carrying an `ed25519-basic-token`; `handle` verifies it against this service's own trusted
23
+ key (`cfg.alias ?? cfg.service`) and resolves the `Auth`. It authenticates only — authorization is
24
+ gates and handlers.
25
+ - **Token exchange** — `authenticate(token)` verifies a credential envelope against the
26
+ `auth-service` trusted record (`AUTH_SRV_KEY`), burns its challenge into `AUTH_CACHE`, and returns
27
+ a bearer signed by this service.
28
+ - **`AUTH_CACHE`** — the anti-replay store: each challenge is created once with an
29
+ `AUTHEN_TIMEFRAME` TTL. A static in-process resource by default.
30
+ - **Auth manager** — the `./manager` application: `init(request)` returns a challenge,
31
+ `authenticate(credential)` returns a signed credential envelope, and the slug on the credential is
32
+ canonicalized through the entity resolver before signing.
33
+ - **Authentication plugin** — `{ type, init, authenticate }` registered under an
34
+ `AuthenticationType`; the manager dispatches by the request's `type`.
35
+ - **Rely** — the wallet handshake that lets one authenticated party vouch for another over a socket
36
+ (`DEFAULT_RELY` guard, `RELY_TUNNEL`).
37
+
18
38
  ## Usage
19
39
 
20
- Registered automatically by `makeContext()` from `@owlmeans/server-app`. To customize, pass `customize: true` and append manually:
40
+ ### Protect routes on an ordinary service
21
41
 
22
- ```typescript
23
- import { makeContext } from '@owlmeans/server-app'
24
- import { appendAuthService, AUTH_CACHE } from '@owlmeans/server-auth'
42
+ `@owlmeans/server-app`'s `makeContext(cfg)` registers the guard. A protocol opts in with `guards`,
43
+ and everything declared under it inherits them.
25
44
 
26
- const context = makeContext(appConfig, true) // skip default auth
45
+ ```ts
46
+ import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint'
47
+ import { route, RouteMethod } from '@owlmeans/route'
48
+ import { DEFAULT_GUARD } from '@owlmeans/auth-common'
27
49
 
28
- // Append auth with custom config
29
- appendAuthService(context)
50
+ const invoiceBase = openProtocol(route('my-app:api:invoice', '/invoice'), { guards: DEFAULT_GUARD })
51
+
52
+ export const invoiceProtocols = {
53
+ base: invoiceBase,
54
+ list: protocol(
55
+ route('my-app:api:invoice:list', '/', { parent: invoiceBase, method: RouteMethod.GET }),
56
+ contract(typed<Invoice[]>()),
57
+ ),
58
+ }
30
59
  ```
31
60
 
32
- Reference the guard by alias when protecting routes:
61
+ ```ts
62
+ import { handlers } from '@owlmeans/server-app'
63
+ import { requireEntityKey } from '@owlmeans/auth-common'
33
64
 
34
- ```typescript
35
- import { DAUTH_GUARD } from '@owlmeans/server-app'
36
- // same as DEFAULT_ALIAS from @owlmeans/server-auth
65
+ const api = handlers<Context>()
37
66
 
38
- const adminModule = module(route('admin', '/admin'), guard(DAUTH_GUARD))
67
+ export const list = api.request(invoiceProtocols.list, async (request, context) => {
68
+ // request.auth is the verified Auth: userId, profileId, role, scopes, entitySlug
69
+ const { items } = await context.invoice().list({ entityId: requireEntityKey(request) })
70
+ return items
71
+ })
39
72
  ```
40
73
 
41
- ## API
74
+ ### Scaled deployment
75
+
76
+ Replace the in-process cache with a shared one before registering the guard, and declare the trusted
77
+ keys the guard verifies against.
78
+
79
+ ```ts
80
+ import { makeContext as makeAppContext } from '@owlmeans/server-app'
81
+ import { appendRedis } from '@owlmeans/redis'
82
+ import { makeRedisResource } from '@owlmeans/redis-resource'
83
+ import { appendAuthService, AUTH_CACHE, AUTH_SRV_KEY } from '@owlmeans/server-auth'
84
+ import { appendAuthIdentityResources } from '@owlmeans/server-auth-identity'
85
+
86
+ // config.ts — keys are loaded from the environment, never committed
87
+ cfg.trusted.push({
88
+ id: process.env.AUTH_SERVICE_DID!, name: AUTH_SRV_KEY,
89
+ credential: process.env.AUTH_SERVICE_PUB!, scopes: ['*'],
90
+ })
91
+ cfg.trusted.push({
92
+ id: process.env.MY_APP_API_DID!, name: MY_APP_API,
93
+ credential: process.env.MY_APP_API_PUB!, secret: process.env.MY_APP_API_PK!, scopes: ['*'],
94
+ })
95
+
96
+ // context.ts
97
+ export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T => {
98
+ const context = makeAppContext<C, T>(cfg, true)
99
+ appendRedis<C, T>(context)
100
+
101
+ context.registerResource(makeRedisResource(AUTH_CACHE))
102
+ appendAuthService<C, T>(context)
103
+ appendAuthIdentityResources(context)
104
+
105
+ return context
106
+ }
107
+ ```
42
108
 
43
- ### `appendAuthService<C, T>(context): void`
109
+ ### Verify a token outside the HTTP pipeline
44
110
 
45
- Registers the Ed25519 auth service and its nonce cache resource into the context.
111
+ ```ts
112
+ import type { AuthServiceAppend } from '@owlmeans/server-auth'
46
113
 
47
- ### `makeAuthService(alias?): AuthService`
114
+ const readAuth = async (context: Context & AuthServiceAppend, authorization: string) =>
115
+ context.auth().unpack(authorization) // 'ED25519-BASIC-TOKEN <envelope>' -> Auth, or throws
116
+ ```
48
117
 
49
- Creates the auth service directly (used internally by `appendAuthService`).
118
+ ### Run the auth manager
50
119
 
51
- ### `DEFAULT_ALIAS`
120
+ ```ts
121
+ import { config, makeContext, main } from '@owlmeans/server-auth/manager'
122
+ import type { AppConfig } from '@owlmeans/server-auth/manager'
123
+ import '@owlmeans/server-oidc-rp/auth/plugins' // optional: OIDC and Google login plugins
52
124
 
53
- The auth service alias: `'auth'`. Re-exported as `DAUTH_GUARD` from `@owlmeans/server-app`.
125
+ const cfg = config<AppConfig>(MY_APP_AUTH, commonConfig as AppConfig)
126
+ const context = makeContext(cfg)
54
127
 
55
- ### `AUTH_CACHE`
128
+ await main(context)
129
+ ```
56
130
 
57
- Resource alias for the nonce replay-prevention cache.
131
+ ### Add an authentication method
58
132
 
59
- ## Product-Viable Integration Notes
133
+ ```ts
134
+ import { registerPlugin } from '@owlmeans/server-auth/manager/plugins'
135
+ import type { AuthPlugin } from '@owlmeans/server-auth/manager/plugins'
60
136
 
61
- - Register `appendAuthService(context)` before `appendAuthIdentityResources(context)` and product-specific gate services.
62
- - Register `AUTH_CACHE` explicitly as a Redis resource when customizing the backend context.
63
- - This package verifies bearer tokens and populates `request.auth`; authorization remains the job of module gates and handler-level entity checks.
64
- - Pair it with `@owlmeans/server-auth-identity` when external provider login should produce durable local account/profile/credentials records.
137
+ registerPlugin('my-method', context => ({
138
+ type: 'my-method',
139
+ init: async request => ({ challenge: /* unique per request */ '' }),
140
+ authenticate: async credential => {
141
+ // verify credential.credential, then set userId / profileId / entitySlug / role / scopes
142
+ return { token: '' } // '' keeps the manager's own challenge as the credential token
143
+ },
144
+ }) as AuthPlugin)
145
+ ```
65
146
 
66
- ## Related Packages
147
+ ## API
67
148
 
68
- - [`@owlmeans/auth-common`](../auth-common) — `GUARD_ED25519` constant and auth modules
149
+ ### Root export
150
+
151
+ | Symbol | Kind | Purpose |
152
+ |---|---|---|
153
+ | `appendAuthService(ctx, alias = DEFAULT_ALIAS)` | function | Register the guard as `context.auth()`; registers a static `AUTH_CACHE` when the context has none |
154
+ | `makeAuthService(alias?)` | function | The guard: `match`, `handle`, `unpack(token)`, `authenticate(token)` |
155
+ | `entrypoints` | const | Server bindings of `authProtocols.dispatcher` and `authProtocols.dispatcherAuthenticate` |
156
+ | `DEFAULT_ALIAS` | const | `'auth'` — equals `DEFAULT_GUARD`; re-exported as `DAUTH_GUARD` by `@owlmeans/server-app` |
157
+ | `AUTH_CACHE` | const | `'auth-cache'` — the single-use challenge store |
158
+ | `AUTH_SRV_KEY` | const | `'auth-service'` — the trusted record whose key signs credential envelopes |
159
+ | `AUTHEN_TIMEFRAME` | const | `15 * 60 * 1000` ms — challenge lifetime and anti-replay window |
160
+ | `makeRelyModel`, `makeProviderRely`, `makeConsumerRely` | function | Rely envelope models |
161
+ | `AuthService`, `AuthServiceAppend`, `AuthSpent`, `RelyOptions` | type | Guard service, context mixin, cache record, rely options |
162
+
163
+ ### `./manager`
164
+
165
+ | Symbol | Kind | Purpose |
166
+ |---|---|---|
167
+ | `makeContext(cfg, customize?)` | function | Server context with API server, API client, socket service, rely guard and static `AUTH_CACHE` |
168
+ | `main(ctx)` | function | Register the manager entrypoints, init and listen |
169
+ | `entrypoints` | const | Bindings for authen, init, authenticate, rely, api-config and reCAPTCHA siteverify |
170
+ | `authenticationInit`, `authenticate`, `rely` | function | Implementations bound to the auth protocols |
171
+ | `plugins`, `registerPlugin(type, factory)` | const / function | The plugin registry |
172
+ | `appendSupervisorAuth(ctx, opts?)`, `setupInternalTokenCoguard(entrypoints, guard?)` | function | PK supervisor login (development only by default) |
173
+ | `createRelyService(alias?)`, `createRelyFlow(context, conn, auth?)` | function | Rely guard service and socket authentication flow |
174
+ | `DEFAULT_RELY`, `RELY_TUNNEL` | const | `'auth-rely'`, `'rely-tunnel'` |
175
+ | `config`, `service`, `TRUSTED`, `addWebService`, `AppType`, `assertContext`, `klusterize`, `stab`, `backend`, `filterObject` | re-export | Config and context helpers for a manager app |
176
+ | `handleIntermediate`, `handleBody`, `handleRequest`, `handleParams` | re-export | `@owlmeans/server-api` wrappers |
177
+ | `AUTHEN`, `AUTHEN_AUTHEN`, `AUTHEN_INIT`, `GUARD_ED25519`, `BED255_CASHE_RESOURCE` | re-export | Auth aliases |
178
+ | `AppConfig`, `AppContext`, `AuthModel`, `RelyService`, `RelyAllowanceRequest`, `RelyLinker`, `RelyCarrier` | type | Manager shapes |
179
+ | `SupervisorAuthOptions`, `SupervisorUserResolver`, `SupervisorUserResolution`, `SupervisorPluginOptions` | type | Supervisor options |
180
+ | `TrustedRecord`, `RefedEntrypointHandler`, `AbstractRequest`, `AbstractResponse` | type | Re-exported types |
181
+
182
+ ### `./manager/plugins`
183
+
184
+ | Symbol | Kind | Purpose |
185
+ |---|---|---|
186
+ | `registerPlugin(type, factory)`, `plugins` | function / const | The module-level registry |
187
+ | `getPlugin(type, context)`, `assertType(type, plugin)` | function | Resolution; `getPlugin` throws `AuthUnknown(type)` for an unregistered type |
188
+ | `basicEd25519`, `reCaptcha`, `basicRely` | function | Built-in plugins |
189
+ | `makeSupervisorPlugin(context, opts)` | function | PK supervisor plugin factory |
190
+ | `AuthPlugin`, `RecpatchaResponse`, `RecaptchaRequest`, `RelyRecord`, `AuthRedisResource` | type | Plugin shapes |
191
+
192
+ ## Common pitfalls
193
+
194
+ - The guard verifies a bearer and sets `request.auth`; it decides nothing about ownership. Pair it
195
+ with gates and keep a handler-level organization check.
196
+ - The default static `AUTH_CACHE` is correct for one replica only. Register a Redis resource under
197
+ the same alias before `appendAuthService` in any scaled deployment.
198
+ - A plugin's `init` must return a challenge unique per request; a repeated challenge collides in
199
+ `AUTH_CACHE` and fails as `AuthenFailed('challenge')`.
200
+ - The manager replaces whatever slug a plugin sets on `credential.entitySlug` with the current slug;
201
+ an unresolvable value fails as `AuthenFailed('entity')`. A token carries `entitySlug`, never an
202
+ entity id.
203
+ - Register `appendAuthService` before `appendAuthIdentityResources` and product gate services.
204
+ - Import `./manager` only in the auth manager process.
205
+
206
+ ## Related packages
207
+
208
+ - [`@owlmeans/auth`](../auth) — `Auth`, `AuthCredentials`, error classes
209
+ - [`@owlmeans/auth-common`](../auth-common) — `DEFAULT_GUARD`, `authProtocols`, `trust()`, entity helpers
210
+ - [`@owlmeans/server-auth-identity`](../server-auth-identity) — local identity records and the entity resolver
211
+ - [`@owlmeans/server-oidc-rp`](../server-oidc-rp) — OIDC login plugins and guard
212
+ - [`@owlmeans/server-auth-otp`](../server-auth-otp) — email OTP plugin
213
+ - [`@owlmeans/server-auth-token`](../server-auth-token) — long-lived access tokens
69
214
  - [`@owlmeans/server-app`](../server-app) — `makeContext` calls `appendAuthService` by default
215
+ - [`@owlmeans/client-auth`](../client-auth) — the browser side
70
216
 
71
217
  <!-- owlmeans:agent-guidance:start -->
72
218
  ## Agent guidance
@@ -76,7 +222,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
76
222
  your project's skill store (`.agents/skills/`):
77
223
 
78
224
  ```sh
79
- npx @owlmeans/agent-skills
225
+ npx @owlmeans/agent-skills@^0.1.18-rc.34
80
226
  ```
81
227
 
82
228
  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.0",
5
- "generatedAt": "2026-08-16T22:20:50.502Z",
4
+ "version": "0.1.18-rc.41",
5
+ "generatedAt": "2026-09-22T20:45:24.048Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -11,6 +11,13 @@
11
11
  "category": "package-specific",
12
12
  "file": "skills/server-auth/SKILL.md",
13
13
  "canonicalPath": ".agents/skills/server-auth/SKILL.md"
14
+ },
15
+ {
16
+ "kind": "skill",
17
+ "name": "supervisor-auth",
18
+ "category": "multi-package",
19
+ "file": "skills/supervisor-auth/SKILL.md",
20
+ "canonicalPath": ".agents/skills/supervisor-auth/SKILL.md"
14
21
  }
15
22
  ]
16
23
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: server-auth
3
- description: How to use @owlmeans/server-auth — server-side authentication manager, AUTH_API alias, setupAuthServiceModules() to wire auth modules into your app. Auto-invoked when importing auth manager primitives.
3
+ description: How to use @owlmeans/server-auth — the server side of OwlMeans authentication. Two halves in one package - appendAuthService/makeAuthService, which verify Ed25519 bearer tokens on an ordinary API server, and the ./manager subpath, which IS the auth manager service (challenge, plugin registry, credential envelope, rely). Auto-invoked when importing the server auth guard, registering an auth plugin, or building the auth manager.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,41 +8,120 @@ user-invocable: false
8
8
  # @owlmeans/server-auth
9
9
 
10
10
  **Layer:** Server
11
- **Install:** `"@owlmeans/server-auth": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/server-auth": "^0.1.18-rc.41"` in `dependencies`
12
12
 
13
- ## Key Exports
13
+ Two halves, deliberately split by subpath:
14
+
15
+ - the **root** export is what every protected API server needs — the guard that verifies an
16
+ `Ed25519BasicToken` bearer and resolves an `Auth`;
17
+ - **`./manager`** is the auth manager application itself — it serves `/authentication/init` and
18
+ `/authentication/authenticate`, owns the plugin registry, and signs the credential envelope.
19
+
20
+ An ordinary service imports the root. Only the auth manager imports `./manager`.
21
+
22
+ ## Key Exports — root
23
+
24
+ | Export | Description |
25
+ |--------|-------------|
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
+ | `makeAuthService(alias?)` | The guard service itself: `match`, `handle`, `unpack(token)`, `authenticate(token)` |
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
+ | `DEFAULT_ALIAS` | `'auth'` — the guard's service alias, matching `DEFAULT_GUARD` |
30
+ | `AUTH_CACHE` | `'auth-cache'` — the single-use challenge store |
31
+ | `AUTH_SRV_KEY` | `'auth-service'` — the TRUSTED record whose key signs credential envelopes |
32
+ | `AUTHEN_TIMEFRAME` | `15 * 60 * 1000` — challenge lifetime and anti-replay window, in ms |
33
+ | `AUTH_SESSION_MANAGER` / `appendMemoryAuthSessionManager` | Seven-day session registry contract and the process-local default; use the Redis implementation from `@owlmeans/server-auth-session` for a shared authority |
34
+ | `AuthService`, `AuthServiceAppend`, `AuthSpent` | Types |
35
+ | `makeRelyModel`, `makeProviderRely`, `makeConsumerRely`, `RelyOptions` | The rely (wallet handshake) models |
36
+
37
+ ## Key Exports — `./manager`
14
38
 
15
39
  | Export | Description |
16
40
  |--------|-------------|
17
- | `setupAuthServiceModules(modules, alias)` | Wire auth modules into your app modules array |
18
- | `AUTH_API` (re-exported) | Auth service alias |
19
- | Auth service factory | Backend auth manager |
20
- | Plugin types | Pluggable auth verifiers |
41
+ | `makeContext(cfg, customize?)` | A server context preconfigured with the API server, API client, socket service and static `AUTH_CACHE` |
42
+ | `main(ctx)` | Register the manager entrypoints, configure, init and listen |
43
+ | `entrypoints` | `AUTHEN`, `AUTHEN_INIT`, `AUTHEN_AUTHEN`, `AUTHEN_RELY`, the api-config entrypoints and the reCAPTCHA siteverify entrypoint |
44
+ | `authenticationInit`, `authenticate`, `rely` | Implementations bound to auth protocols: `init(request)` → challenge, `authenticate(credential)` → signed credential envelope, and the rely socket |
45
+ | `plugins`, `registerPlugin(type, factory)` | The plugin registry (also on `./manager/plugins`) |
46
+ | `appendSupervisorAuth(ctx, opts?)`, `setupInternalTokenCoguard(entrypoints, guard?)` | PK supervisor login — see the `supervisor-auth` skill |
47
+ | `createRelyService(alias?)`, `DEFAULT_RELY`, `RELY_TUNNEL` | The rely guard service |
48
+ | `AppConfig`, `AppContext`, `AuthModel`, `RelyService`, `RelyAllowanceRequest`, `RelyLinker`, `RelyCarrier` | Types |
49
+
50
+ `./manager` also re-exports the handful of symbols a manager application needs from elsewhere
51
+ (`config`, `service`, `TRUSTED`, `bind`, `handlers`, `backend`,
52
+ `GUARD_ED25519`, `AUTHEN*` aliases, `TrustedRecord`), so a manager app can be written against this
53
+ one import.
21
54
 
22
- ## Subpath Exports
55
+ ## Key Exports — `./manager/plugins`
23
56
 
24
- - `./manager` — auth manager service implementation
25
- - `./manager/plugins` — pluggable manager plugins
57
+ | Export | Description |
58
+ |--------|-------------|
59
+ | `AuthPlugin` | `{ type, init(request), authenticate(credential) }` — `AuthModel` minus `rely` |
60
+ | `registerPlugin(type, factory)` | Add a plugin under a type string. The registry is a module-level singleton |
61
+ | `plugins` | The registry map |
62
+ | `getPlugin(type, context)`, `assertType(type, plugin)` | Resolution; `getPlugin` throws `AuthUnknown(type)` for an unregistered type |
63
+ | `basicEd25519`, `reCaptcha`, `basicRely` | The plugins registered out of the box, for `AuthenticationType.BasicEd25519`, `ReCaptcha` and `RelyHandshake` |
64
+ | `makeSupervisorPlugin(context, opts)` | The PK supervisor plugin factory |
65
+ | `RecpatchaResponse`, `RecaptchaRequest`, `RelyRecord`, `AuthRedisResource` | Types |
26
66
 
27
67
  ## Usage
28
68
 
69
+ Protect an ordinary API server:
70
+
71
+ ```typescript
72
+ import { appendAuthService } from '@owlmeans/server-auth'
73
+ import { appendAuthIdentityResources } from '@owlmeans/server-auth-identity'
74
+
75
+ // in makeContext, after the db/cache services are appended:
76
+ appendAuthService(context)
77
+ appendAuthIdentityResources(context)
78
+ ```
79
+
80
+ Add an authentication method to the manager:
81
+
29
82
  ```typescript
30
- import { setupAuthServiceModules } from '@owlmeans/server-auth'
31
- import { AUTH_API } from '@owlmeans/auth-common'
83
+ import { registerPlugin } from '@owlmeans/server-auth/manager/plugins'
84
+ import type { AuthPlugin } from '@owlmeans/server-auth/manager/plugins'
32
85
 
33
- setupAuthServiceModules(appModules, AUTH_API)
86
+ registerPlugin('my-method', context => ({
87
+ type: 'my-method',
88
+ init: async request => ({ challenge: /* unique per request */ '' }),
89
+ authenticate: async credential => {
90
+ // verify credential.credential, then set userId / profileId / entitySlug / role / scopes
91
+ return { token: '' } // '' keeps the manager's own challenge as the credential token
92
+ },
93
+ }) as AuthPlugin)
34
94
  ```
35
95
 
36
- ## Product-Viable Usage Notes
96
+ ## Rules
37
97
 
38
- - Backend context registers `appendAuthService(context)` before identity resources and product-specific gate services.
39
- - `AUTH_CACHE` must be registered as a Redis resource when the backend context does not rely on the default `server-app` setup.
40
- - `server-auth` verifies bearer tokens and populates `req.auth`; it does not decide product ownership or permissions by itself.
41
- - Pair this package with `@owlmeans/server-auth-identity` when an external provider such as Google should map into local account/profile/credentials records.
42
- - Pair it with `@owlmeans/entrypoint` gates for authorization, and keep handler-level `entityId` checks as a second line of defense.
98
+ - The guard verifies a bearer token and populates `req.auth`. It decides nothing about ownership or
99
+ permissions — pair it with `@owlmeans/entrypoint` gates, and keep a handler-level organization
100
+ check as a second line of defence.
101
+ - `AUTH_CACHE` is the anti-replay store: the manager burns each decoded challenge into it as a
102
+ create-once record with `AUTHEN_TIMEFRAME` TTL. `appendAuthService` registers a **static**
103
+ (in-process) resource when the context has none, which is correct for a single replica only —
104
+ register a Redis resource under the same alias before calling it in any scaled deployment.
105
+ - A plugin's `init` must return a challenge that is unique per request. A challenge that repeats
106
+ across independent attempts collides in `AUTH_CACHE` and surfaces as `AuthenFailed('challenge')`.
107
+ - Bearers issued by this service carry an absolute seven-day expiry and an opaque session id. In a
108
+ context with `AUTH_SESSION_MANAGER`, the guard rejects an absent, expired, pending or revoked
109
+ session and re-signs fresh profile claims after a registry revision. Registry or identity-store
110
+ failure is `AuthUnavailable` (503), never a false 401/logout.
111
+ - `appendAuthService` installs the memory session manager only as a single-process default. A
112
+ central or multi-replica issuer registers `appendRedisAuthSessionManager(context)` before it;
113
+ the manager is the authority that fences, refreshes or revokes an organization profile's sessions.
114
+ - The manager canonicalizes the organization entity: whatever slug (current, retired, or the frozen
115
+ key) a plugin leaves on `credential.entitySlug` is resolved through `ENTITY_RESOLVER` and replaced
116
+ with the current slug before the envelope is signed. An unresolvable value throws
117
+ `AuthenFailed('entity')`. Where no resolver is registered the value is passed through untouched.
118
+ - Pair this package with `@owlmeans/server-auth-identity` when an external provider (Google, OIDC,
119
+ email OTP) must map onto local account/profile/credential records.
43
120
 
44
121
  ## Depends On
45
122
 
46
- - `@owlmeans/auth`, `@owlmeans/auth-common`
47
- - `@owlmeans/server-entrypoint`, `@owlmeans/server-context`
48
- - `@owlmeans/basic-keys` — Ed25519 verification
123
+ - `@owlmeans/auth`, `@owlmeans/auth-common` — types, aliases, `trust()`, `extractAuthToken`
124
+ - `@owlmeans/basic-envelope`, `@owlmeans/basic-keys` — envelope signing and Ed25519 verification
125
+ - `@owlmeans/server-context`, `@owlmeans/server-entrypoint`, `@owlmeans/server-api`
126
+ - `@owlmeans/config` — the `TRUSTED` config resource
127
+ - `@owlmeans/static-resource` — the default `AUTH_CACHE` backing
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: supervisor-auth
3
+ description: PK-based supervisor authentication — a development-only login where a holder of one of the project's trusted private keys mints a token for any user id/email (registering them on first use), bypassing external IdPs. Primary use is end-to-end tests. Covers appendSupervisorAuth (server + web), the supervisor plugin, and the @owlmeans/test-ui helpers. Use when wiring or testing supervisor auth.
4
+ user-invocable: false
5
+ ---
6
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
+
8
+ # PK-Based Supervisor Authentication
9
+
10
+ **Layer:** Server (`@owlmeans/server-auth`) + Web (`@owlmeans/web-auth`) + Tests (`@owlmeans/test-ui`)
11
+
12
+ A privileged, **development-only** auth path: a holder of one of the project's trusted private keys
13
+ (the allowlisted "supervisors") signs a server challenge to mint a valid owlmeans token for an
14
+ arbitrary user id / email — **without** Google/OIDC. Unknown users are **registered** on first use.
15
+ The primary purpose is deterministic **end-to-end tests** that authenticate against real environments.
16
+
17
+ It reuses the existing flow end-to-end: the plugin only **verifies the supervisor signature and
18
+ resolves/registers the user**, then hands the mutated credential back to the auth manager's own
19
+ model (which signs the credential envelope) and to the project's auth service (which exchanges it
20
+ for the final `Ed25519BasicToken` bearer). No new token-minting code.
21
+
22
+ ## Type & payload
23
+
24
+ - `AuthenticationType.Supervisor = 'pk-supervisor'` (in `@owlmeans/auth`).
25
+ - Shared signed payload: `buildSupervisorPayload(challenge, userId, salt)` (in `@owlmeans/auth`) —
26
+ binds the signature to the **single-use server challenge** (replay protection), the target
27
+ `userId`, and a fresh client `salt`. The front-end packs `{ salt, signature }` (JSON) into
28
+ `AuthCredentials.credential`.
29
+
30
+ ## Server: `appendSupervisorAuth` (from `@owlmeans/server-auth/manager`)
31
+
32
+ Call once on the **auth-manager** context (the one that serves `AUTHEN_INIT`/`AUTHEN_AUTHEN` and holds
33
+ `AUTH_SRV_KEY`), beside other plugin appends (e.g. `appendOtpPlugin`).
34
+
35
+ ```ts
36
+ import { appendSupervisorAuth } from '@owlmeans/server-auth/manager'
37
+
38
+ appendSupervisorAuth(context, {
39
+ supervisors: ['master-key', 'super-user', 'shared-key'], // TRUSTED record `name`s allowed to sign
40
+ resolveUser: async (userId, ctx, { register }) => { // find-or-create the target identity
41
+ // wire to your identity store; return { userId, profileId?, entitySlug?, role?, scopes? }
42
+ },
43
+ allowRegistration: true, // default true
44
+ enabled: undefined, // default: development only (cfg.debug.all || cfg.debug.supervisor)
45
+ acceptInternalTokens: true, // default true — see below
46
+ })
47
+ ```
48
+
49
+ Options:
50
+ - `supervisors` — TRUSTED-record `name`s authorized to sign. Default `['master','superuser']`. The
51
+ matching **public** key must be in the project's TRUSTED config; the **private** key is what the
52
+ front-end signs with. Pick aliases whose private keys you actually have (e.g. in `.env.dev.secrets`).
53
+ - `resolveUser` — `(userId, context, { register }) => Promise<SupervisorUserResolution>`. Default:
54
+ trust the id as-is (`{ userId }`). Wire it to `@owlmeans/server-auth-identity`'s
55
+ `IdentityLinkingService` (`getLinkedProfile` / `linkProfile`) to find-or-create a real profile and
56
+ organization entity. `SupervisorUserResolution` is `{ userId }` plus optional `profileId`,
57
+ `entitySlug`, `role` and `scopes` — the organization value is a SLUG, the renameable public name
58
+ that a token carries, never the stable `entityId`. `profileId` defaults to `userId`, `scopes` to
59
+ the credential's own or `[ALL_SCOPES]`, and `role` to `AuthRole.User`.
60
+ - `enabled` — force on/off. Default is development only. **Never enable in real production.**
61
+ - `acceptInternalTokens` — when `true`, appends the internal `Ed25519BasicToken` guard
62
+ (`DEFAULT_GUARD`) as a coguard on every already-guarded backend entrypoint, so internal OwlMeans
63
+ tokens keep working where another guard (OIDC, say) is the primary one. The primary guard stays
64
+ first; the internal guard only matches an `Ed25519BasicToken` authorization header. Also exposed
65
+ standalone as `setupInternalTokenCoguard(entrypoints, guard?)`. Set `false` when the entrypoints
66
+ already use `DEFAULT_GUARD` as their primary guard.
67
+ - `guard` — which guard alias `acceptInternalTokens` appends. Default `DEFAULT_GUARD` (`'auth'`).
68
+
69
+ ## Web: `appendSupervisorAuth` (from `@owlmeans/web-auth`)
70
+
71
+ Call once on the web client context. Registers the self-contained login form plugin; the form renders
72
+ at the standard typed route `SUPERVISOR_LOGIN_PATH` = `/authentication/login/pk-supervisor`.
73
+
74
+ ```ts
75
+ import { appendSupervisorAuth } from '@owlmeans/web-auth'
76
+
77
+ appendSupervisorAuth(context) // dev-only by default; or appendSupervisorAuth(context, { enabled })
78
+ ```
79
+
80
+ The form (`data-testid="supervisor-auth-form"`, inputs `supervisor-user-id`, `supervisor-pk`, button
81
+ `supervisor-submit`, error `supervisor-error`) fetches a challenge, signs it, exchanges it for a
82
+ bearer, stores it, and redirects HOME — mirroring the Google plugin. (Alternatively, the side-effect
83
+ import `@owlmeans/web-auth/auth/plugins` always-registers it.)
84
+
85
+ The web append reads `cfg.debug.supervisor` alone; the server append accepts either
86
+ `cfg.debug.all` or `cfg.debug.supervisor`. A deployment that wants the operator login therefore sets
87
+ `debug.supervisor` — it is the flag both halves honour, and the only one that does not arrive by
88
+ accident. The plugin is `restricted`, so `appendSupervisorAuth` also writes
89
+ `cfg.security.auth.login.overrides` to make it offerable; `{ offer: false }` registers it without
90
+ advertising it.
91
+
92
+ ## Tests: `@owlmeans/test-ui` helpers
93
+
94
+ - `authenticateViaSupervisorApi({ apiBaseUrl, userId, pk })` — drives the live API
95
+ (`/authentication/init` → sign → `/authentication/authenticate` → `/authenticate`) and returns the
96
+ final bearer. **No browser**; registers the user on first use. The "set a token directly via API" path.
97
+ - `loginViaSupervisorForm(page, { baseUrl, userId, pk })` — Playwright: drives the real login form
98
+ end-to-end (faithful path that exercises the plugin + registration).
99
+ - `loginViaDispatcher(page, baseUrl, token)` — inject a pregenerated bearer via the standard
100
+ `/dispatcher?token=` route (apps that override DISPATCHER, e.g. for a forced IdP, can't use this —
101
+ use the form).
102
+ - `pregenerateAuthToken({ userId, pk, scopes?, role?, profileId?, source?, ... })` — offline mint via
103
+ `@owlmeans/test-auth`'s `makeBearer`, using the project's **own** trusted signing key (lowest-level
104
+ primitive). No plugin, no registration.
105
+
106
+ `loginViaSupervisorForm` answers a cookie-consent dialog by default (`consent: 'accept'`): an
107
+ OwlMeans app refuses to start an authentication flow until consent is answered, and the modal
108
+ intercepts every click at the form underneath. Both browser helpers navigate with
109
+ `waitUntil: 'domcontentloaded'` rather than Playwright's `load`, because `load` waits for every
110
+ subresource and a tag manager or analytics beacon that never settles holds it open until timeout.
111
+
112
+ ## Security
113
+
114
+ - Development/stage only. Gate on `cfg.debug`; never ship enabled to real production.
115
+ - Anyone with a supervisor **private** key can impersonate/register any user — treat those keys as
116
+ highly sensitive.
117
+
118
+ ## Depends On
119
+ - `@owlmeans/auth` (type + `buildSupervisorPayload` + `SupervisorCredentialPayload`),
120
+ `@owlmeans/basic-keys` (sign/verify), `@owlmeans/basic-ids` (the salt),
121
+ `@owlmeans/auth-common` (`DEFAULT_GUARD`, `TrustedRecord`), `@owlmeans/config` (`TRUSTED`).
122
+ - Tests: `@owlmeans/test-ui` (the helpers above) over `@owlmeans/test-auth` (`makeBearer`).
123
+
124
+ ## Related
125
+
126
+ `server-auth` (the plugin registry and the manager) · `web-auth` (the form package) ·
127
+ `server-auth-identity` (what `resolveUser` should be wired to) · `login-methods` (why a
128
+ `restricted` method has to be named in the configuration)
@@ -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"}
@@ -0,0 +1,5 @@
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>[];
5
+ //# sourceMappingURL=entrypoints.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,9 @@
1
+ import { bind } from '@owlmeans/server-entrypoint';
2
+ import { authProtocols } from '@owlmeans/auth-common';
3
+ import { authenticate } from './actions/service.js';
4
+ /** Server entrypoints required by the generic authentication service. */
5
+ export const entrypoints = [
6
+ bind(authProtocols.dispatcher),
7
+ bind(authProtocols.dispatcherAuthenticate, authenticate(authProtocols.dispatcherAuthenticate)),
8
+ ];
9
+ //# sourceMappingURL=entrypoints.js.map
@@ -0,0 +1 @@
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"}