@owlmeans/auth 0.1.18-rc.8 → 0.1.18-rc.9

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 CHANGED
@@ -12,7 +12,7 @@ Core authentication types, schemas, and constants for OwlMeans fullstack applica
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/auth
15
+ bun add @owlmeans/auth@^0.1.18-rc.8
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -88,7 +88,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
88
88
  your project's skill store (`.agents/skills/`):
89
89
 
90
90
  ```sh
91
- npx @owlmeans/agent-skills
91
+ npx @owlmeans/agent-skills@^0.1.18-rc.12
92
92
  ```
93
93
 
94
94
  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/auth",
4
- "version": "0.1.18-rc.8",
5
- "generatedAt": "2026-09-01T16:28:56.980Z",
4
+ "version": "0.1.18-rc.9",
5
+ "generatedAt": "2026-09-04T22:43:25.434Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: auth
3
- description: How to use @owlmeans/auth — core authentication types, errors (AuthUnknown, AuthError), permissions, allowance, rely, and entity primitives shared across server and client. Auto-invoked when importing auth types/errors or working with request authentication.
3
+ description: How to use @owlmeans/auth — the core authentication and authorization vocabulary shared by server and client, covering the Auth / AuthPayload / AuthCredentials types, the AuthRole and AuthenticationType enums, the error hierarchy (AuthUnknown, AuthenFailed, AuthForbidden …), the request JSON schemas, the entrypoint aliases, and entitySlugOf for reading the organization entity off a token. Auto-invoked when importing auth types, errors, schemas or constants, or when working with request authentication.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,58 +8,155 @@ user-invocable: false
8
8
  # @owlmeans/auth
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/auth": "^0.1.18-rc.8"` in `dependencies`
11
+ **Install:** `"@owlmeans/auth": "^0.1.18-rc.9"` in `dependencies`
12
+
13
+ Types, enums, errors and schemas only — no services, no wiring. Every other auth package builds on
14
+ this vocabulary, so a symbol belongs here exactly when both a server and a browser need to agree on
15
+ it.
12
16
 
13
17
  ## Key Exports
14
18
 
19
+ ### Identity types
20
+
15
21
  | Export | Description |
16
22
  |--------|-------------|
17
- | `AuthUnknown` | Error thrown when expected entity/auth is missing on a request |
18
- | `AuthError` and subclasses | Typed auth errors mapping to HTTP 401/403 |
19
- | `Auth` types | Request auth payload shape (entityId, scopes, profile) |
20
- | `Permission` helpers | Check scopes/permissions on a request |
21
- | `Allowance` helpers | Inspect/grant allowances |
22
- | `Entity`, `Rely` types | Shared entity-relationship primitives |
23
+ | `Authorization` | RBAC base: `entitySlug?`, `scopes`, `permissions?`, `attributes?`, `permissioned?`, `denormalized?` |
24
+ | `ProfilePayload` | `Authorization` + `groups?` |
25
+ | `AuthPayload` | `ProfilePayload` + `type`, `role`, `userId`, `source?`, `profileId?`, `expiresAt?` |
26
+ | `AuthCredentials` | `AuthPayload` + `challenge`, `credential`, `publicKey?` — what a client posts to authenticate |
27
+ | `Auth` | `AuthPayload` + `token`, `isUser`, `createdAt` — the authenticated identity a guard resolves |
28
+ | `Profile` | `ProfilePayload` + `id`, `name`, `credential?`, `secret?` — a stored identity record |
29
+ | `Group` | `Authorization` + `id`, `name` |
30
+ | `AllowanceRequest` | `Partial<AuthPayload>` with a required `type` — asks for a challenge |
31
+ | `AllowanceResponse` | `{ challenge }` |
32
+ | `AuthToken` | `{ token }` — the bearer envelope on the wire |
33
+ | `PermissionSet` / `Capabilties` / `AttributeSet` | Scope-bound capability shapes |
34
+ | `RelyToken` | The rely-handshake token used by wallet/provider flows |
35
+
36
+ ### Enums and constants
23
37
 
24
- ## Usage
38
+ | Export | Description |
39
+ |--------|-------------|
40
+ | `AuthRole` | **String** enum: `User`, `Guest`, `Service`, `System`, `Admin`, `Superuser`, `Blocked` |
41
+ | `AuthenticationType` | How identity is proven: `BasicEd25519`, `OneTimeToken`, `ReCaptcha`, `WalletDid`, `RelyHandshake`, `WalletConsumer`, `WalletProvider`, `Google` (`'google-oauth'`), `Supervisor` (`'pk-supervisor'`) |
42
+ | `AuthroizationType` (sic) | How a request carries authorization: `AuthToken`, `Ed25519BasicToken`, `Ed25519BasicSignature` |
43
+ | `AuthenticationStage` | Client-side flow stage: `Error`, `Init`, `Allowence`, `Authenticate`, `Authentication`, `Authenticated` |
44
+ | `AUTH_HEADER` / `AUTH_QUERY` | `'authorization'` / `'token'` |
45
+ | `ENTITY_QUERY` / `PROFILE_QUERY` | `'entitySlug'` / `'profile'` |
46
+ | `ALL_SCOPES` / `AUTH_SCOPE` | `'*'` / `'__auth'` |
47
+ | `INCLUDE`, `EXCLUDE`, `WILDCARD`, `DELIMITER` | Permission-string grammar |
48
+ | `GUEST_ID`, `RELY_3RD` | Reserved ids |
49
+ | `AUTHEN`, `AUTHEN_INIT`, `AUTHEN_AUTHEN`, `AUTHEN_RELY` | Backend entrypoint aliases |
50
+ | `CAUTHEN`, `CAUTHEN_AUTHEN`, `CAUTHEN_AUTHEN_DEFAULT`, `CAUTHEN_AUTHEN_TYPED`, `CAUTHEN_FLOW_ENTER` | Front-end entrypoint aliases |
51
+ | `DISPATCHER`, `DISPATCHER_AUTHEN`, `DISPATCHER_SURROGATE` | Dispatcher and surrogate-window entrypoint aliases |
52
+ | `MOD_RECAPTCHA`, `CMOD_RECAPTCHA` | reCAPTCHA entrypoint aliases |
53
+
54
+ ### Errors
55
+
56
+ `AuthError` is the root; everything below is a subclass and every class is i18n-aware through
57
+ `@owlmeans/error`.
58
+
59
+ | Error | Raise it when |
60
+ |-------|---------------|
61
+ | `AuthUnknown` | The thing being authenticated is not known at all — an unregistered plugin type, a request whose auth state is missing |
62
+ | `AuthManagerError` | The auth manager itself failed |
63
+ | `AuthManagerUnsupported` | The manager cannot serve this request shape |
64
+ | `AuthenFailed` | Authentication was attempted and rejected (bad challenge, bad code, bad signature) |
65
+ | `AuthenExists` | The identity being registered already exists |
66
+ | `AuthenPayloadError` | A required credential field is missing |
67
+ | `AuthPluginError` / `TypeMissmatchError` | A plugin misbehaved / was handed the wrong type |
68
+ | `AuthorizationError` | Authenticated, but the request carries no usable authorization |
69
+ | `AuthForbidden` | Authenticated and understood — and not allowed |
70
+ | `ProfileError` / `ProfileConsistencyError` | A profile is missing or internally inconsistent |
71
+
72
+ ### Schemas and helpers
25
73
 
26
- Throw `AuthUnknown` from a handler when the auth context is missing the entity:
74
+ | Export | Description |
75
+ |--------|-------------|
76
+ | `AuthorizationSchema`, `ProfilePayloadSchema`, `AuthPayloadSchema` | Payload validation; `AuthPayloadSchema.required` is `['scopes', 'role', 'type']` |
77
+ | `PartialAuthPayloadSchema`, `AllowanceRequestSchema` | The `/authentication/init` body |
78
+ | `AuthCredentialsSchema` | The `/authentication/authenticate` body — spreads `AuthPayloadSchema.required`, so `type`, `role` and `scopes` are mandatory on every authenticate call |
79
+ | `AuthSchema`, `AuthTokenSchema`, `OptionalAuthTokenSchema` | Resolved auth and bearer-token bodies |
80
+ | `ProfileSchema`, `RelyChallengeSchema`, `PermissionSetSchema`, `AttributeSetSchema`, `CapabiltiesSchema` | Record and permission schemas |
81
+ | `ScopeValueSchema`, `PermissionValueSchema`, `ResourceValueSchema`, `AttributeValueSchema`, `EntitySlugValueSchema`, `GroupValueSchema`, `TypeNameSchema`, `EnumValueSchema`, `IdValueSchema`, `DateSchema`, `AuthRoleSchema` | Reusable scalar schemas |
82
+ | `entitySlugOf(payload)` | The organization entity carried by an auth payload — its `entitySlug`, falling back to an `entityId` the payload may carry instead — see below |
83
+ | `verifyAuth`, `verifyAuthCredentials` | Validate against `AuthSchema` / `AuthCredentialsSchema` |
84
+ | `isAuth`, `isAuthCredentials`, `isAuthToken` | Type guards |
85
+ | `buildSupervisorPayload`, `SupervisorCredentialPayload` | The payload the PK supervisor login signs — see the `supervisor-auth` skill |
86
+
87
+ `AuthTokenSchema` caps `token` at 1024 characters. A route that accepts a token wrapping a full
88
+ credential envelope needs its own wider schema.
89
+
90
+ ## The organization entity on a token
91
+
92
+ `entitySlug` is the organization-entity value this package declares: `Authorization.entitySlug`,
93
+ the renameable, human-readable name of the customer organization, and what travels in tokens, URLs,
94
+ query params and request bodies. No `entityId` is declared on any type here — the stable record id
95
+ an implementation stores its rows against belongs to whichever package owns the organization
96
+ registry, and is resolved from the slug at the server boundary.
97
+
98
+ Read the value through `entitySlugOf()` rather than off the field. A token is signed once and then
99
+ read for as long as it lives, across deployments, and the helper absorbs that spread: when
100
+ `entitySlug` is absent it returns an `entityId` the payload carries instead, so a payload that names
101
+ the organization under either field resolves through one code path. That fallback is why the helper
102
+ is the only supported way to get the value out of a payload:
27
103
 
28
104
  ```typescript
29
- import { AuthUnknown } from '@owlmeans/auth'
30
- import { handleRequest } from '@owlmeans/server-app'
105
+ import { entitySlugOf } from '@owlmeans/auth'
31
106
 
32
- export const list = handleRequest(async (req, context) => {
33
- if (req.auth?.entityId == null) throw new AuthUnknown('entity')
34
- return await (context as Context).project().list({ entityId: req.auth.entityId })
35
- })
107
+ const slug = entitySlugOf(req.auth) // string | undefined
36
108
  ```
37
109
 
38
- ## Product-Viable Usage Notes
39
-
40
- - `product-viable` handlers use `AuthUnknown('entity')` when a request should be authenticated but lacks `req.auth.entityId`.
41
- - WebSocket helpers use `Auth`, `AuthToken`, and `AuthenticationStage` to move token-bearing connections into authenticated state.
42
- - Google/OIDC login ultimately produces a normal `AuthPayload` with `userId`, `profileId`, `entityId`, and `scopes`; `@owlmeans/server-auth-identity` stores that local identity and returns the payload.
43
- - Authorization failures in gates should use `AuthForbidden`, while missing handler auth/entity state usually uses `AuthUnknown`.
44
- - Keep product ownership rules outside `@owlmeans/auth`; downstream apps compose `@owlmeans/entrypoint` gates or handler-level entity checks around these core types.
110
+ Because of that fallback the result is not guaranteed to be a slug: a payload carrying only
111
+ `entityId` yields that id. Treat it as an opaque organization key, never as a name to compose from
112
+ and never as a database key written directly — `@owlmeans/auth-common` exports `entityKeyOf` /
113
+ `requireEntityKey` for storage keys, and they prefer the resolved id; a user-facing name wants the
114
+ resolved entity's current slug.
45
115
 
46
- ## AuthRole enum
116
+ ## AuthRole is a string enum
47
117
 
48
- `AuthRole` is a **string** enum (not numeric). Always use the enum members — never assign a number literal to `role`:
118
+ Always use the members; a numeric literal does not compile.
49
119
 
50
120
  ```typescript
51
121
  import { AuthRole } from '@owlmeans/auth'
122
+ import type { AuthCredentials } from '@owlmeans/auth'
52
123
 
53
- // Correct
54
- const creds: AuthCredentials = { role: AuthRole.User, ... }
124
+ const creds: AuthCredentials = { role: AuthRole.User, /* … */ } as AuthCredentials
125
+ ```
126
+
127
+ ## Usage
55
128
 
56
- // WRONG — will not compile
57
- const creds: AuthCredentials = { role: 0, ... }
129
+ Throw from a handler when the request is missing the identity it needs:
130
+
131
+ ```typescript
132
+ import { AuthUnknown, entitySlugOf } from '@owlmeans/auth'
133
+ import { handleRequest } from '@owlmeans/server-app'
134
+
135
+ export const list = handleRequest(async (req, context) => {
136
+ const slug = entitySlugOf(req.auth)
137
+ if (slug == null) throw new AuthUnknown('entity')
138
+
139
+ return await listProjects(context, slug)
140
+ })
58
141
  ```
59
142
 
60
- Members: `User`, `Guest`, `Service`, `System`, `Admin`, `Superuser`, `Blocked`.
143
+ Rules of thumb:
144
+
145
+ - A gate that decides "not allowed" throws `AuthForbidden`; a handler that finds no identity to act
146
+ on throws `AuthUnknown`; a failed credential check throws `AuthenFailed`.
147
+ - Keep ownership rules out of this package. Downstream apps compose `@owlmeans/entrypoint` gates or
148
+ handler-level checks around these types.
149
+ - WebSocket wiring uses `Auth`, `AuthToken` and `AuthenticationStage` to move a token-bearing
150
+ connection into an authenticated state.
151
+ - A provider login (Google/OIDC, OTP, supervisor) ultimately produces an ordinary `AuthPayload` with
152
+ `userId`, `profileId`, `entitySlug` and `scopes`; `@owlmeans/server-auth-identity` stores the local
153
+ identity behind it and returns that payload.
61
154
 
62
155
  ## Depends On
63
156
 
64
- - `@owlmeans/error` — `AuthUnknown` and friends extend `ResilientError`
65
- - `@owlmeans/i18n` — for translatable error messages
157
+ - `@owlmeans/error` — every error class extends `ResilientError`, which is what makes the messages
158
+ translatable and re-throwable across the wire
159
+ - `ajv-formats` — date/time formats for the `verify*` helpers
160
+ - `ajv` — a **peer** dependency (`"*"`), not a direct one: `verifyAuth` / `verifyAuthCredentials`
161
+ construct `new Ajv({ strict: false })`. Install it alongside this package, or those two helpers
162
+ fail to resolve.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: auth-protocol
3
- description: Comprehensive reference for the OwlMeans authentication and authorization protocol — Ed25519 path, OIDC path, provider-backed local identity, core types, errors, guards, gates, trust resource, envelope shape, refresh flow, and mocking points. Auto-invoked when files under auth*, *oidc*, server-auth-identity, did*, wled, client-payment are touched.
3
+ description: Comprehensive reference for the OwlMeans authentication and authorization protocol — the Ed25519, OIDC, provider-backed local identity, email-OTP and PK-supervisor paths, the core types and error hierarchy, guards and gates, the trust resource, the envelope shape, organization-entity resolution, the refresh flow, and the mocking points. Auto-invoked when files under auth*, *oidc*, server-auth-identity, did*, wled or client-payment are touched.
4
4
  ---
5
5
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
6
6
 
@@ -18,18 +18,21 @@ Use case: service-to-service, wallet provider, backend clients, high-security br
18
18
 
19
19
  1. **Allowance**: client posts `AllowanceRequest` (a partial `AuthPayload`) to `/authentication/init`. Server returns `AllowanceResponse { challenge }`.
20
20
  2. **Credential generation**: client builds `AuthCredentials` (challenge + ephemeral payload), signs the canonicalized payload with its Ed25519 keypair via `packAuthCredentials()` (`@owlmeans/basic-keys`), posts to `/authentication/authenticate`.
21
- 3. **Token exchange**: server resolves the signer from the `TRUSTED` config resource via `trust()` (`@owlmeans/auth-common`), verifies the signature, builds an `Auth`, wraps it in an `EnvelopeModel` of type `ed25519-basic-token` signed with the service's own key, and returns the tokenized envelope.
22
- 4. **Bearer**: client sends `Authorization: ED25519-BASIC-TOKEN <encoded>`.
23
- 5. **Server verification**: incoming requests hit `makeBasicEd25519Guard` (`@owlmeans/auth-common`) which `match`-es the header, `unpack`-s the envelope, and `handle`-s by resolving an `Auth` into the response.
21
+ 3. **Credential envelope**: the auth manager opens the signed challenge with the `AUTH_SRV_KEY` record it loads from the `TRUSTED` config resource via `trust()` (`@owlmeans/auth-common/utils`), burns the decoded challenge into `AUTH_CACHE` (create-once, so one challenge is spent once), then hands the credential to the plugin for its type. The basic-ed25519 plugin loads the caller's own `TRUSTED` record by `userId` and verifies the signature over the challenge, then rewrites the credential's `type` to `AuthenticationType.OneTimeToken` with a fresh one-time token as its challenge. The manager canonicalizes `entitySlug` through `ENTITY_RESOLVER` where one is registered, stamps its own trusted id onto `credential.credential`, and answers with an `EnvelopeModel<AuthCredentials>` of the credential's own type, signed with `AUTH_SRV_KEY`.
22
+ 4. **Token exchange**: the client posts that envelope as an `AuthToken` to the consuming service's `DISPATCHER_AUTHEN` entrypoint (`/authenticate`). `makeAuthService.authenticate()` (`@owlmeans/server-auth`) verifies it against `AUTH_SRV_KEY`, burns the one-time token into its own `AUTH_CACHE`, checks that `credential.credential` names the auth manager, builds the `Auth` from the credential's `userId` / `scopes` / `role` / `profileId` / `entitySlug`, and returns it as an envelope of type `ed25519-basic-token` signed with that service's own key.
23
+ 5. **Bearer**: client sends `Authorization: ED25519-BASIC-TOKEN <encoded>`.
24
+ 6. **Server verification**: incoming requests hit `makeAuthService` (`@owlmeans/server-auth`), whose `match` looks for the `ED25519-BASIC-TOKEN` bearer, whose `handle` verifies the envelope against the service key and resolves the carried `Auth` into the response, and whose `unpack(token)` returns the same `Auth` outside a request.
25
+
26
+ `makeBasicEd25519Guard` (`@owlmeans/auth-common`) is a **different** mechanism on the same key material: it matches `ED25519-BASIC-SIGNATURE`, where the caller signs body + timestamp/nonce headers per request instead of presenting a bearer. See the `auth-common` skill.
24
27
 
25
28
  ### OIDC (delegated)
26
29
 
27
30
  Use case: browser clients, third-party IdP integration, multi-tenant SaaS.
28
31
 
29
- 1. Standard OAuth2 code flow via `makeOidcGuard` (`@owlmeans/oidc`).
30
- 2. Server validates the ID token, wraps the resulting `Auth` in an envelope of type `oidc-wrapped-token` signed with the service key.
31
- 3. Subsequent requests carry the wrapped token; the OIDC guard verifies the envelope signature and freshness.
32
- 4. Refresh: `wrapper().update()` (`@owlmeans/oidc`) exchanges a stale token transparently — alias `TOKEN_UPDATE` (`@owlmeans/auth-common`).
32
+ 1. Standard OAuth2 authorization-code flow. The relying party redirects to the provider and the return leg exchanges the code: `makeOidcClientService` (`@owlmeans/server-oidc-rp`) replays the stored PKCE verifier and grants the token set.
33
+ 2. Server decodes the ID token, builds an `Auth` from its claims, and wraps it in an envelope of type `oidc-wrapped-token` signed with the service key — the bearer is `OIDC-WRAPPED-TOKEN <encoded>`.
34
+ 3. Subsequent requests are matched and handled by `makeOidcGuard` (`@owlmeans/oidc`), which verifies the envelope signature against the service key and delegates freshness to the `WRAPPED_OIDC` service.
35
+ 4. Refresh: `makeOidcWrappingService` (`@owlmeans/server-oidc-rp`) re-validates the stored token set — introspection, or a refresh grant once `expires_at` has passed — and re-signs the wrapped token. When the value changes, the guard returns it in the **`TOKEN_UPDATE` response header** (`'auth-token-refresh'`, `@owlmeans/auth-common`); an empty value means the session is over. It is a header, not a route: `@owlmeans/server-api` lists it in `exposedHeaders` and `@owlmeans/api`'s client service feeds it back into `AuthService.update()`. Where the deployment has a separate auth manager, the wrapper reaches it over the `external-auth:auth:update` entrypoint that `setupAuthServiceEntrypoints` registers at `/<prefix>/auth/update`.
33
36
 
34
37
  ### Provider-Backed Local Identity
35
38
 
@@ -38,40 +41,69 @@ Use case: apps such as `product-viable` that use Google/OIDC as login bootstrap
38
41
  1. Browser imports `@owlmeans/web-oidc-rp/auth/plugins`, which registers OIDC and Google plugins in `@owlmeans/client-auth`.
39
42
  2. The plugin persists auth control state, redirects to the provider, restores state on return, and submits code/query params as `AuthCredentials`.
40
43
  3. Server exchanges the provider code through `@owlmeans/server-oidc-rp` and maps `ProviderProfileDetails` through `@owlmeans/server-auth-identity`.
41
- 4. `AUTH_IDENTITY_ACCOUNT`, `AUTH_IDENTITY_PROFILE`, and `AUTH_IDENTITY_CREDENTIALS` store local account/profile/provider-link data.
42
- 5. Server returns a normal OwlMeans bearer token. Downstream product gates authorize against local profile scopes, not against `OIDC_GATE`.
44
+ 4. `AUTH_IDENTITY_ORG_ENTITY`, `AUTH_IDENTITY_ACCOUNT`, `AUTH_IDENTITY_PROFILE` and `AUTH_IDENTITY_CREDENTIALS` store the organization entity and the local account/profile/provider-link data. A second login method on the same email adds a CREDENTIAL to the person's existing profile — it never mints a second identity or a second organization.
45
+ 5. Server returns a normal OwlMeans bearer token carrying the organization's `entitySlug`. Downstream product gates authorize against local profile scopes, not against `OIDC_GATE`.
46
+
47
+ ### Email one-time code
48
+
49
+ Use case: passwordless sign-in where no external IdP is wanted.
50
+
51
+ 1. Client posts `{ type: 'email-otp', userId: <email> }` to `/authentication/init`.
52
+ 2. `@owlmeans/server-auth-otp` mails a six-digit code, stores it in Redis under a TTL, and answers with a challenge of `"<email>::<nonce>"` — the nonce is what keeps two independent attempts for one address from colliding in the manager's anti-replay cache.
53
+ 3. Client posts the code as `AuthCredentials.credential`; the plugin verifies and consumes it, resolves the identity through `AUTH_IDENTITY_LINKING`, and the manager signs the credential envelope as usual.
54
+
55
+ ### PK supervisor (development only)
56
+
57
+ Use case: deterministic end-to-end tests, and operator access to a development or stage environment.
58
+
59
+ 1. Client posts `{ type: 'pk-supervisor', userId }` to `/authentication/init`, receiving a single-use challenge.
60
+ 2. It signs `buildSupervisorPayload(challenge, userId, salt)` (`@owlmeans/auth`) with one of the project's TRUSTED private keys and posts `{ salt, signature }` as the credential.
61
+ 3. The server plugin verifies the signature against the allowlisted TRUSTED records, resolves or registers the target user, and the ordinary envelope exchange finishes the flow.
62
+
63
+ Never enabled in real production — see the `supervisor-auth` skill.
43
64
 
44
65
  ## Core types
45
66
 
46
67
  Exported from `@owlmeans/auth`:
47
68
 
48
- - `Auth` (l. 110) — the full authenticated identity, includes `token`, `userId`, `role`, `scopes`, `permissions?`, `attributes?`, `entityId?`, `createdAt`, `isUser`.
49
- - `AuthPayload` (l. 27) — minimal identity tuple; `Auth extends AuthPayload`.
50
- - `AuthCredentials` (l. 3) — challenge/response pair signed during authentication.
51
- - `Authorization` (l. 77) — RBAC primitive: `entityId?`, `scopes`, `permissions?`, `attributes?`, `permissioned?`, `denormalized?`.
52
- - `AllowanceRequest` (l. 150) — partial `AuthPayload` triggering challenge generation.
53
- - `AllowanceResponse` (l. 172) — `{ challenge }`.
54
- - `AuthToken` (l. 176) — `{ token }`, used in module query auth.
55
- - `PermissionSet` (l. 134) / `Capabilties` (l. 141) / `AttributeSet` (l. 145) — scope-bound capability shapes.
69
+ - `Authorization` — RBAC primitive: `entitySlug?`, `scopes`, `permissions?`, `attributes?`, `permissioned?`, `denormalized?`.
70
+ - `ProfilePayload` — `Authorization` plus `groups?`.
71
+ - `AuthPayload` — `ProfilePayload` plus `type`, `role`, `userId`, `source?`, `profileId?`, `expiresAt?`.
72
+ - `AuthCredentials` — `AuthPayload` plus `challenge`, `credential`, `publicKey?`: the challenge/response pair signed during authentication.
73
+ - `Auth` — `AuthPayload` plus `token`, `isUser`, `createdAt`: the full authenticated identity a guard resolves.
74
+ - `Profile` — a stored identity record: `ProfilePayload` plus `id`, `name`, `credential?`, `secret?`.
75
+ - `AllowanceRequest` — partial `AuthPayload` with a required `type`, triggering challenge generation.
76
+ - `AllowanceResponse` — `{ challenge }`.
77
+ - `AuthToken` — `{ token }`, used in entrypoint query auth.
78
+ - `PermissionSet` / `Capabilties` / `AttributeSet` — scope-bound capability shapes.
79
+
80
+ **`entitySlug` is the only organization-entity value on the wire.** It is the customer
81
+ organization's renameable, human-readable name; the stable `entityId` an implementation keys its
82
+ rows on never appears in a token, a URL or a body. Read the slug with `entitySlugOf(payload)`
83
+ (`@owlmeans/auth`) rather than off the field.
56
84
 
57
85
  ## Enums and constants
58
86
 
59
87
  `@owlmeans/auth` constants:
60
88
 
61
89
  - `AuthRole` — **string** enum: `User`, `Guest`, `Service`, `System`, `Admin`, `Superuser`, `Blocked`. Never use numeric literals for `role` fields — always use `AuthRole.User` etc.
62
- - `AuthenticationType` — `BasicEd25519`, `OneTimeToken`, `ReCaptcha`, `WalletDid`, `RelyHandshake`, `WalletConsumer`, `WalletProvider`.
63
- - `AuthroizationType` (sic) — `AuthToken`, `Ed25519BasicToken`, `Ed25519BasicSignature`.
64
- - `AUTH_HEADER = 'authorization'`, `AUTH_QUERY = 'token'`, `ENTITY_QUERY = 'entity'`, `PROFILE_QUERY = 'profile'`.
90
+ - `AuthenticationType` — how identity is proven: `BasicEd25519`, `OneTimeToken`, `ReCaptcha`, `WalletDid`, `RelyHandshake`, `WalletConsumer`, `WalletProvider`, `Google` (`'google-oauth'`), `Supervisor` (`'pk-supervisor'`).
91
+ - `AuthroizationType` (sic) — how a request carries authorization: `AuthToken`, `Ed25519BasicToken`, `Ed25519BasicSignature`.
92
+ - `AuthenticationStage` — the client flow's stage: `Error`, `Init`, `Allowence`, `Authenticate`, `Authentication`, `Authenticated`.
93
+ - `AUTH_HEADER = 'authorization'`, `AUTH_QUERY = 'token'`, `ENTITY_QUERY = 'entitySlug'`, `PROFILE_QUERY = 'profile'`.
94
+ - `DISPATCHER`, `DISPATCHER_AUTHEN`, `DISPATCHER_SURROGATE` — the return-leg and login-window entrypoint aliases.
65
95
 
66
96
  `@owlmeans/auth-common` constants:
67
97
 
68
98
  - `DEF_AUTH_SRV = 'auth'` and its alias `DEFAULT_GUARD = 'auth'`.
99
+ - `GUARD_ED25519 = 'guard:ed25519-basic-signature'`.
69
100
  - `TOKEN_UPDATE = 'auth-token-refresh'`.
70
- - `DISPATCHER_PATH = '/dispatcher'`.
101
+ - `DISPATCHER_PATH = '/dispatcher'` and `SURROGATE_PATH = '/surrogate'` — both reserved paths.
102
+ - `ENTITY_RESOLVER = 'entity-resolver'` and `ENTITY_SLUG_PATTERN` — the organization-entity contract.
71
103
 
72
104
  `@owlmeans/oidc` constants:
73
105
 
74
- - `OIDC_GATE = 'oidc-gate'` — the `gate(...)` value to attach OIDC enforcement to a module.
106
+ - `OIDC_GATE = 'oidc-gate'` — the `gate(...)` value to attach OIDC enforcement to an entrypoint.
75
107
  - `GOOGLE_CLIENT_AUTH = 'google-oauth'` — browser plugin type for Google OAuth.
76
108
  - `GOOGLE_SERVICE = 'google'` — provider service key used by backend config and identity linking.
77
109
 
@@ -79,7 +111,7 @@ For apps that use OIDC/Google only as a login provider and then authorize agains
79
111
 
80
112
  ## Errors
81
113
 
82
- `@owlmeans/auth` exports: `AuthError`, `AuthManagerError`, `AuthenFailed`, `AuthenExists`, `AuthenPayloadError`, `AuthPluginError`, `TypeMissmatchError`, `AuthorizationError`, `AuthForbidden`, `ProfileError`, `ProfileConsistencyError`. Each is i18n-aware via `@owlmeans/error`.
114
+ `@owlmeans/auth` exports, root first: `AuthError` → `AuthUnknown`, `AuthorizationError` → `AuthForbidden`, `ProfileError` → `ProfileConsistencyError`, and `AuthManagerError` → `AuthManagerUnsupported`, `AuthenFailed` (→ `AuthenExists`, `AuthenPayloadError`) and `AuthPluginError` (→ `TypeMissmatchError`). Each is i18n-aware via `@owlmeans/error`.
83
115
 
84
116
  ## Guard interface
85
117
 
@@ -100,16 +132,20 @@ Guards are services registered on the context under their alias (`DEFAULT_GUARD`
100
132
 
101
133
  ## Trust resource
102
134
 
103
- `trust()` (`@owlmeans/auth-common`):
135
+ `trust()` lives on the `@owlmeans/auth-common/utils` subpath, not the package root:
104
136
 
105
137
  ```ts
106
- export const trust = async (context, resource, userName, field = 'name') => {
107
- const trustedUser = await context.resource<Resource<TrustedRecord>>(resource).load(userName, field)
108
- /* …keyPair derived from trustedUser.secret or trustedUser.credential… */
109
- }
138
+ import { trust } from '@owlmeans/auth-common/utils'
139
+ import { TRUSTED } from '@owlmeans/config'
140
+
141
+ // { user: TrustedRecord, key: KeyPairModel }
142
+ const { user, key } = await trust(context, TRUSTED, context.cfg.alias ?? context.cfg.service)
110
143
  ```
111
144
 
112
- `TrustedRecord` (`@owlmeans/auth-common`) extends `Profile` minus `permissions` / `attributes`. The `TRUSTED` config resource is the system's source of truth for known signing identities — the auth service, peer services, wallet providers, etc.
145
+ It loads the record by `name` (pass a fourth argument to match on another field) and throws
146
+ `SyntaxError` when there is none.
147
+
148
+ `TrustedRecord` (`@owlmeans/auth-common`) is a `ConfigRecord` with an `id`, carrying `Profile` minus `permissions` / `attributes` — in practice a `name`, a `credential` (the public key) and, for identities this deployment signs as, a `secret`. `trust()` returns a signing key pair when the record has a secret and a verify-only one otherwise. The `TRUSTED` config resource (`@owlmeans/config`) is the system's source of truth for known signing identities — the auth service, peer services, wallet providers, supervisors.
113
149
 
114
150
  ## Envelope shape
115
151
 
@@ -147,21 +183,39 @@ export interface KeyPairModel {
147
183
  ## Setup wiring
148
184
 
149
185
  Server-side:
150
- - `setupAuthServiceModules(modules, serviceAlias, prefix?)` (`@owlmeans/server-oidc-rp`) — registers provider list and token-update routes.
151
- - `makeAuthService(alias)` (`@owlmeans/server-auth`) — factory for the server `AuthService`.
152
- - `makeOidcWrappingService`, `makeOidcGate` — wire OIDC into a server context (`@owlmeans/server-oidc-rp`).
186
+ - `makeAuthService(alias?)` / `appendAuthService(ctx, alias?)` (`@owlmeans/server-auth`) — the bearer guard.
187
+ - `setupAuthServiceEntrypoints(entrypoints, serviceAlias, prefix = 'oidc-api')` (`@owlmeans/server-oidc-rp`) — registers the `external-auth:provider:list` and `external-auth:auth:update` routes, both behind `GUARD_ED25519`.
188
+ - `makeOidcWrappingService`, `makeOidcGate`, `makeOidcClientService`, `appendOidcGuard`, `setupOidcGuard` — wire OIDC into a server context (`@owlmeans/server-oidc-rp`).
153
189
 
154
190
  Client-side:
155
- - `setupExternalAuthentication(service)` (`@owlmeans/client-auth`) — wire OAuth/OIDC flows for a client context.
156
- - `appendAuthService(ctx, alias?)` (`@owlmeans/client-auth`) — attach the client auth service with persistent storage.
191
+ - `appendAuthService(ctx, alias?)` (`@owlmeans/client-auth`) — the client auth service with persistent storage.
192
+ - `setupExternalAuthentication(service)` (`@owlmeans/client-auth`) — point `CAUTHEN_FLOW_ENTER` at the service an external provider redirects into.
193
+ - `appendLogin(ctx)` (`@owlmeans/client-auth/login`) — the login-plugin host; `@owlmeans/web-client`'s `makeContext` already calls it.
157
194
  - `appendOidcGuard()`, `setupOidcGuard()` — `@owlmeans/web-oidc-rp` for browser-side.
158
195
 
159
- Local identity:
160
- - `appendAuthIdentityResources(context)` — registers identity account/profile/credentials resources and the linking service.
161
- - `AUTH_IDENTITY_LINKING` — service that maps provider profile details into an `AuthPayload`.
162
- - `AUTH_IDENTITY_PROFILE` — durable authorization profile with `entityId`, `role`, `scopes`, and optional expiry.
196
+ Local identity and the organization entity:
197
+ - `appendAuthIdentityResources(context)` (`@owlmeans/server-auth-identity`) — registers the org-entity registry, the account/profile/credentials resources, the linking service and the entity resolver.
198
+ - `AUTH_IDENTITY_LINKING` — the service that maps provider profile details onto an `AuthPayload`.
199
+ - `AUTH_IDENTITY_PROFILE` — the durable authorization profile: `entityId`, `role`, `scopes`, optional expiry.
200
+ - `ENTITY_RESOLVER` — turns the token's `entitySlug` (current, retired, or the frozen `iamKey`) into a stable `OrgEntityRef`. Registering it is what tells the boundary this deployment has organizations.
201
+
202
+ Read identity records with `load()` or `list()`. Never use `take()` in an authorization lookup — it is delete-and-return, so it consumes the record it answers with.
203
+
204
+ ## Entity resolution is part of the protocol
205
+
206
+ Two places resolve the organization entity, and both are required:
207
+
208
+ 1. **At the auth manager**, before the credential envelope is signed. Whatever slug a plugin left on
209
+ `credential.entitySlug` is resolved and rewritten to the current one, so a token is canonical for
210
+ as long as it lives. An unresolvable value throws `AuthenFailed('entity')`.
211
+ 2. **At every server boundary that establishes authentication** — the HTTP boundary, and any socket
212
+ that authenticates after its connection is open — via `attachEntity(context, request)`
213
+ (`@owlmeans/auth-common`), which sets `request.entity` and canonicalizes a retired slug.
163
214
 
164
- Read identity records with `load()` or `list()`. Do not use `pick()` for authorization lookups because `pick()` deletes the matching record.
215
+ Handlers then key their records on `entityKeyOf(req)` / `requireEntityKey(req)`, which prefer the
216
+ resolved id and fall back to the slug where no resolver is registered. A boundary that skips step 2
217
+ leaves `request.entity` empty and its handlers silently compare a slug against stored ids — which
218
+ surfaces as "this record does not exist", not as a missing resolution.
165
219
 
166
220
  ## Mocking points (for category-B tests)
167
221
 
@@ -177,8 +231,9 @@ The protocol does **not** ship a fake JWKS server. For OIDC-end-to-end tests, ex
177
231
 
178
232
  The OIDC packages wrap four upstream libraries. **No upstream type from those libraries is re-exported** through any `@owlmeans/*` package's public index. All public contracts use OwlMeans-owned types; the mapping layer is confined to each package's `src/service.ts`.
179
233
 
180
- Current exact pins (see [[oidc-versions]] for full upgrade checklist):
181
- - `oidc-provider@9.8.4` — in `@owlmeans/server-oidc-provider`
182
- - `jose@6.2.3` — in `server-oidc-provider` and `server-oidc-rp`
183
- - `openid-client@6.8.4` — in `@owlmeans/server-oidc-rp`
184
- - `oidc-client-ts@3.5.0` — in `@owlmeans/web-oidc-rp` and `@owlmeans/mui-oidc-rp`
234
+ Each is pinned to an exact version, and [[oidc-versions]] owns those numbers plus the upgrade
235
+ checklist — read them there rather than duplicating them here:
236
+ - `oidc-provider` — in `@owlmeans/server-oidc-provider`
237
+ - `jose` — in `@owlmeans/server-oidc-provider` and `@owlmeans/server-oidc-rp`
238
+ - `openid-client` — in `@owlmeans/server-oidc-rp`
239
+ - `oidc-client-ts` — in `@owlmeans/web-oidc-rp` and `@owlmeans/mui-oidc-rp`
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AA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uB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AASjF,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,KAAG,OAIvC,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,MAAM,eAAe,KAAG,OAI7D,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,IAEH,CAAA;AAE5C,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,eAEN,CAAA;AAEpD,eAAO,MAAM,WAAW,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,SAEI,CAAA;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,KAAG,MAAM,GAAG,SACQ,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AASjF,eAAO,MAAM,UAAU,SAAU,IAAI,KAAG,OAIvC,CAAA;AAED,eAAO,MAAM,qBAAqB,SAAU,eAAe,KAAG,OAI7D,CAAA;AAED,eAAO,MAAM,MAAM,SAAU,OAAO,KAAG,IAAI,IAAI,IAEH,CAAA;AAE5C,eAAO,MAAM,iBAAiB,SAAU,OAAO,KAAG,IAAI,IAAI,eAEN,CAAA;AAEpD,eAAO,MAAM,WAAW,SAAU,OAAO,KAAG,IAAI,IAAI,SAEI,CAAA;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,aAAc,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,KAAG,MAAM,GAAG,SACQ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GACjC,WAAW,MAAM,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAC9C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAmC,CAAA;AAEvF;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB"}
1
+ {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,cACtB,MAAM,UAAU,MAAM,QAAQ,MAAM,KAC9C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAmC,CAAA;AAEvF;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/auth",
3
- "version": "0.1.18-rc.8",
3
+ "version": "0.1.18-rc.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@owlmeans/error": "^0.1.18-rc.7",
25
+ "@owlmeans/error": "^0.1.18-rc.8",
26
26
  "ajv-formats": "^3.0.1"
27
27
  },
28
28
  "peerDependencies": {