@owlmeans/server-auth 0.1.18-rc.3 → 0.1.18-rc.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +184 -38
- package/agent-meta/manifest.json +9 -2
- package/agent-meta/skills/server-auth/SKILL.md +93 -22
- package/agent-meta/skills/supervisor-auth/SKILL.md +128 -0
- package/build/actions/service.d.ts +6 -2
- package/build/actions/service.d.ts.map +1 -1
- package/build/actions/service.js +5 -4
- package/build/actions/service.js.map +1 -1
- package/build/entrypoints.d.ts +5 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +9 -0
- package/build/entrypoints.js.map +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/manager/actions/manager.d.ts +17 -5
- package/build/manager/actions/manager.d.ts.map +1 -1
- package/build/manager/actions/manager.js +7 -6
- package/build/manager/actions/manager.js.map +1 -1
- package/build/manager/context.d.ts.map +1 -1
- package/build/manager/context.js +0 -1
- package/build/manager/context.js.map +1 -1
- package/build/manager/entrypoints.d.ts +9 -0
- package/build/manager/entrypoints.d.ts.map +1 -0
- package/build/manager/entrypoints.js +24 -0
- package/build/manager/entrypoints.js.map +1 -0
- package/build/manager/exports.d.ts +1 -2
- package/build/manager/exports.d.ts.map +1 -1
- package/build/manager/exports.js +1 -2
- package/build/manager/exports.js.map +1 -1
- package/build/manager/index.d.ts +1 -1
- package/build/manager/index.d.ts.map +1 -1
- package/build/manager/index.js +1 -1
- package/build/manager/index.js.map +1 -1
- package/build/manager/main.js +2 -2
- package/build/manager/main.js.map +1 -1
- package/build/manager/model.d.ts.map +1 -1
- package/build/manager/model.js +14 -1
- package/build/manager/model.js.map +1 -1
- package/build/manager/plugins/basic-ed25519.js.map +1 -1
- package/build/manager/plugins/basic-rely.d.ts.map +1 -1
- package/build/manager/plugins/basic-rely.js +5 -5
- package/build/manager/plugins/basic-rely.js.map +1 -1
- package/build/manager/plugins/re-captcha.js +1 -1
- package/build/manager/plugins/re-captcha.js.map +1 -1
- package/build/manager/plugins/supervisor.js +3 -3
- package/build/manager/plugins/supervisor.js.map +1 -1
- package/build/manager/rely/flow.js +1 -1
- package/build/manager/rely/flow.js.map +1 -1
- package/build/manager/supervisor.d.ts +5 -5
- package/build/manager/supervisor.d.ts.map +1 -1
- package/build/manager/supervisor.js +4 -4
- package/build/manager/supervisor.js.map +1 -1
- package/build/model/rely/consumer.d.ts +3 -1
- package/build/model/rely/consumer.d.ts.map +1 -1
- package/build/model/rely/consumer.js.map +1 -1
- package/build/model/rely/provider.d.ts +3 -1
- package/build/model/rely/provider.d.ts.map +1 -1
- package/build/model/rely/provider.js.map +1 -1
- package/build/service.js +1 -1
- package/build/service.js.map +1 -1
- package/package.json +26 -26
- package/src/actions/service.ts +9 -8
- package/src/entrypoints.ts +12 -0
- package/src/index.ts +1 -1
- package/src/manager/README.md +14 -18
- package/src/manager/actions/manager.ts +15 -13
- package/src/manager/context.ts +0 -2
- package/src/manager/entrypoints.ts +26 -0
- package/src/manager/exports.ts +1 -2
- package/src/manager/index.ts +1 -1
- package/src/manager/main.ts +2 -2
- package/src/manager/model.ts +16 -1
- package/src/manager/plugins/basic-ed25519.ts +2 -2
- package/src/manager/plugins/basic-rely.ts +7 -6
- package/src/manager/plugins/re-captcha.ts +3 -3
- package/src/manager/plugins/supervisor.ts +4 -4
- package/src/manager/rely/flow.ts +1 -1
- package/src/manager/supervisor.ts +6 -6
- package/src/model/rely/consumer.ts +3 -1
- package/src/model/rely/provider.ts +3 -1
- package/src/service.ts +1 -1
- package/tests/context.ts +1 -2
- package/tests/supervisor.spec.ts +6 -4
- package/build/.gitkeep +0 -0
- package/build/manager/modules.d.ts +0 -2
- package/build/manager/modules.d.ts.map +0 -1
- package/build/manager/modules.js +0 -21
- package/build/manager/modules.js.map +0 -1
- package/build/modules.d.ts +0 -3
- package/build/modules.d.ts.map +0 -1
- package/build/modules.js +0 -11
- package/build/modules.js.map +0 -1
- package/src/manager/modules.ts +0 -29
- package/src/modules.ts +0 -17
package/README.md
CHANGED
|
@@ -1,72 +1,218 @@
|
|
|
1
1
|
# @owlmeans/server-auth
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
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.29
|
|
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
|
-
|
|
40
|
+
### Protect routes on an ordinary service
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
61
|
+
```ts
|
|
62
|
+
import { handlers } from '@owlmeans/server-app'
|
|
63
|
+
import { requireEntityKey } from '@owlmeans/auth-common'
|
|
33
64
|
|
|
34
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
###
|
|
109
|
+
### Verify a token outside the HTTP pipeline
|
|
44
110
|
|
|
45
|
-
|
|
111
|
+
```ts
|
|
112
|
+
import type { AuthServiceAppend } from '@owlmeans/server-auth'
|
|
46
113
|
|
|
47
|
-
|
|
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
|
-
|
|
118
|
+
### Run the auth manager
|
|
50
119
|
|
|
51
|
-
|
|
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
|
-
|
|
125
|
+
const cfg = config<AppConfig>(MY_APP_AUTH, commonConfig as AppConfig)
|
|
126
|
+
const context = makeContext(cfg)
|
|
54
127
|
|
|
55
|
-
|
|
128
|
+
await main(context)
|
|
129
|
+
```
|
|
56
130
|
|
|
57
|
-
|
|
131
|
+
### Add an authentication method
|
|
58
132
|
|
|
59
|
-
|
|
133
|
+
```ts
|
|
134
|
+
import { registerPlugin } from '@owlmeans/server-auth/manager/plugins'
|
|
135
|
+
import type { AuthPlugin } from '@owlmeans/server-auth/manager/plugins'
|
|
60
136
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
##
|
|
147
|
+
## API
|
|
67
148
|
|
|
68
|
-
|
|
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.23
|
|
80
226
|
```
|
|
81
227
|
|
|
82
228
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/server-auth",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18-rc.30",
|
|
5
|
+
"generatedAt": "2026-09-15T12:50:32.600Z",
|
|
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
|
|
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,112 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/server-auth
|
|
9
9
|
|
|
10
10
|
**Layer:** Server
|
|
11
|
-
**Install:** `"@owlmeans/server-auth": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/server-auth": "^0.1.18-rc.30"` in `dependencies`
|
|
12
12
|
|
|
13
|
-
|
|
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
|
+
| `AuthService`, `AuthServiceAppend`, `AuthSpent` | Types |
|
|
34
|
+
| `makeRelyModel`, `makeProviderRely`, `makeConsumerRely`, `RelyOptions` | The rely (wallet handshake) models |
|
|
35
|
+
|
|
36
|
+
## Key Exports — `./manager`
|
|
14
37
|
|
|
15
38
|
| Export | Description |
|
|
16
39
|
|--------|-------------|
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
|
|
|
20
|
-
|
|
|
40
|
+
| `makeContext(cfg, customize?)` | A server context preconfigured with the API server, API client, socket service and static `AUTH_CACHE` |
|
|
41
|
+
| `main(ctx)` | Register the manager entrypoints, configure, init and listen |
|
|
42
|
+
| `entrypoints` | `AUTHEN`, `AUTHEN_INIT`, `AUTHEN_AUTHEN`, `AUTHEN_RELY`, the api-config entrypoints and the reCAPTCHA siteverify entrypoint |
|
|
43
|
+
| `authenticationInit`, `authenticate`, `rely` | Implementations bound to auth protocols: `init(request)` → challenge, `authenticate(credential)` → signed credential envelope, and the rely socket |
|
|
44
|
+
| `plugins`, `registerPlugin(type, factory)` | The plugin registry (also on `./manager/plugins`) |
|
|
45
|
+
| `appendSupervisorAuth(ctx, opts?)`, `setupInternalTokenCoguard(entrypoints, guard?)` | PK supervisor login — see the `supervisor-auth` skill |
|
|
46
|
+
| `createRelyService(alias?)`, `DEFAULT_RELY`, `RELY_TUNNEL` | The rely guard service |
|
|
47
|
+
| `AppConfig`, `AppContext`, `AuthModel`, `RelyService`, `RelyAllowanceRequest`, `RelyLinker`, `RelyCarrier` | Types |
|
|
48
|
+
|
|
49
|
+
`./manager` also re-exports the handful of symbols a manager application needs from elsewhere
|
|
50
|
+
(`config`, `service`, `TRUSTED`, `bind`, `handlers`, `backend`,
|
|
51
|
+
`GUARD_ED25519`, `AUTHEN*` aliases, `TrustedRecord`), so a manager app can be written against this
|
|
52
|
+
one import.
|
|
21
53
|
|
|
22
|
-
##
|
|
54
|
+
## Key Exports — `./manager/plugins`
|
|
23
55
|
|
|
24
|
-
|
|
25
|
-
|
|
56
|
+
| Export | Description |
|
|
57
|
+
|--------|-------------|
|
|
58
|
+
| `AuthPlugin` | `{ type, init(request), authenticate(credential) }` — `AuthModel` minus `rely` |
|
|
59
|
+
| `registerPlugin(type, factory)` | Add a plugin under a type string. The registry is a module-level singleton |
|
|
60
|
+
| `plugins` | The registry map |
|
|
61
|
+
| `getPlugin(type, context)`, `assertType(type, plugin)` | Resolution; `getPlugin` throws `AuthUnknown(type)` for an unregistered type |
|
|
62
|
+
| `basicEd25519`, `reCaptcha`, `basicRely` | The plugins registered out of the box, for `AuthenticationType.BasicEd25519`, `ReCaptcha` and `RelyHandshake` |
|
|
63
|
+
| `makeSupervisorPlugin(context, opts)` | The PK supervisor plugin factory |
|
|
64
|
+
| `RecpatchaResponse`, `RecaptchaRequest`, `RelyRecord`, `AuthRedisResource` | Types |
|
|
26
65
|
|
|
27
66
|
## Usage
|
|
28
67
|
|
|
68
|
+
Protect an ordinary API server:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { appendAuthService } from '@owlmeans/server-auth'
|
|
72
|
+
import { appendAuthIdentityResources } from '@owlmeans/server-auth-identity'
|
|
73
|
+
|
|
74
|
+
// in makeContext, after the db/cache services are appended:
|
|
75
|
+
appendAuthService(context)
|
|
76
|
+
appendAuthIdentityResources(context)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Add an authentication method to the manager:
|
|
80
|
+
|
|
29
81
|
```typescript
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
82
|
+
import { registerPlugin } from '@owlmeans/server-auth/manager/plugins'
|
|
83
|
+
import type { AuthPlugin } from '@owlmeans/server-auth/manager/plugins'
|
|
32
84
|
|
|
33
|
-
|
|
85
|
+
registerPlugin('my-method', context => ({
|
|
86
|
+
type: 'my-method',
|
|
87
|
+
init: async request => ({ challenge: /* unique per request */ '' }),
|
|
88
|
+
authenticate: async credential => {
|
|
89
|
+
// verify credential.credential, then set userId / profileId / entitySlug / role / scopes
|
|
90
|
+
return { token: '' } // '' keeps the manager's own challenge as the credential token
|
|
91
|
+
},
|
|
92
|
+
}) as AuthPlugin)
|
|
34
93
|
```
|
|
35
94
|
|
|
36
|
-
##
|
|
95
|
+
## Rules
|
|
37
96
|
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
97
|
+
- The guard verifies a bearer token and populates `req.auth`. It decides nothing about ownership or
|
|
98
|
+
permissions — pair it with `@owlmeans/entrypoint` gates, and keep a handler-level organization
|
|
99
|
+
check as a second line of defence.
|
|
100
|
+
- `AUTH_CACHE` is the anti-replay store: the manager burns each decoded challenge into it as a
|
|
101
|
+
create-once record with `AUTHEN_TIMEFRAME` TTL. `appendAuthService` registers a **static**
|
|
102
|
+
(in-process) resource when the context has none, which is correct for a single replica only —
|
|
103
|
+
register a Redis resource under the same alias before calling it in any scaled deployment.
|
|
104
|
+
- A plugin's `init` must return a challenge that is unique per request. A challenge that repeats
|
|
105
|
+
across independent attempts collides in `AUTH_CACHE` and surfaces as `AuthenFailed('challenge')`.
|
|
106
|
+
- The manager canonicalizes the organization entity: whatever slug (current, retired, or the frozen
|
|
107
|
+
key) a plugin leaves on `credential.entitySlug` is resolved through `ENTITY_RESOLVER` and replaced
|
|
108
|
+
with the current slug before the envelope is signed. An unresolvable value throws
|
|
109
|
+
`AuthenFailed('entity')`. Where no resolver is registered the value is passed through untouched.
|
|
110
|
+
- Pair this package with `@owlmeans/server-auth-identity` when an external provider (Google, OIDC,
|
|
111
|
+
email OTP) must map onto local account/profile/credential records.
|
|
43
112
|
|
|
44
113
|
## Depends On
|
|
45
114
|
|
|
46
|
-
- `@owlmeans/auth`, `@owlmeans/auth-common`
|
|
47
|
-
- `@owlmeans/
|
|
48
|
-
- `@owlmeans/
|
|
115
|
+
- `@owlmeans/auth`, `@owlmeans/auth-common` — types, aliases, `trust()`, `extractAuthToken`
|
|
116
|
+
- `@owlmeans/basic-envelope`, `@owlmeans/basic-keys` — envelope signing and Ed25519 verification
|
|
117
|
+
- `@owlmeans/server-context`, `@owlmeans/server-entrypoint`, `@owlmeans/server-api`
|
|
118
|
+
- `@owlmeans/config` — the `TRUSTED` config resource
|
|
119
|
+
- `@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 {
|
|
1
|
+
import type { EntrypointProtocol } from '@owlmeans/entrypoint';
|
|
2
2
|
import type { AuthToken } from '@owlmeans/auth';
|
|
3
|
-
export declare const authenticate:
|
|
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":"
|
|
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"}
|
package/build/actions/service.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { handlers } from '@owlmeans/server-api';
|
|
2
2
|
import { assertContext } from '@owlmeans/context';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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":"
|
|
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"}
|
package/build/index.d.ts
CHANGED