@owlmeans/auth 0.1.18-rc.4 → 0.1.18-rc.40

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 (94) hide show
  1. package/README.md +288 -45
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/auth/SKILL.md +131 -32
  4. package/agent-meta/skills/auth-protocol/SKILL.md +165 -90
  5. package/build/allowance/index.d.ts +1 -1
  6. package/build/allowance/index.d.ts.map +1 -1
  7. package/build/allowance/index.js +1 -1
  8. package/build/allowance/index.js.map +1 -1
  9. package/build/allowance/{model.d.ts → schemas.d.ts} +1 -1
  10. package/build/allowance/schemas.d.ts.map +1 -0
  11. package/build/allowance/{model.js → schemas.js} +7 -5
  12. package/build/allowance/schemas.js.map +1 -0
  13. package/build/auth/index.d.ts +1 -1
  14. package/build/auth/index.d.ts.map +1 -1
  15. package/build/auth/index.js +1 -1
  16. package/build/auth/index.js.map +1 -1
  17. package/build/auth/{model.d.ts → schemas.d.ts} +1 -1
  18. package/build/auth/schemas.d.ts.map +1 -0
  19. package/build/auth/{model.js → schemas.js} +4 -4
  20. package/build/auth/schemas.js.map +1 -0
  21. package/build/consts.d.ts +11 -1
  22. package/build/consts.d.ts.map +1 -1
  23. package/build/consts.js +12 -2
  24. package/build/consts.js.map +1 -1
  25. package/build/entity/index.d.ts +1 -1
  26. package/build/entity/index.js +1 -1
  27. package/build/entity/{profile.d.ts → schemas.d.ts} +1 -1
  28. package/build/entity/schemas.d.ts.map +1 -0
  29. package/build/entity/{profile.js → schemas.js} +4 -4
  30. package/build/entity/{profile.js.map → schemas.js.map} +1 -1
  31. package/build/errors.d.ts +15 -0
  32. package/build/errors.d.ts.map +1 -1
  33. package/build/errors.js +19 -0
  34. package/build/errors.js.map +1 -1
  35. package/build/helper/types.d.ts +22 -0
  36. package/build/helper/types.d.ts.map +1 -0
  37. package/build/helper/types.js +2 -0
  38. package/build/helper/types.js.map +1 -0
  39. package/build/helper.d.ts +9 -3
  40. package/build/helper.d.ts.map +1 -1
  41. package/build/helper.js +30 -17
  42. package/build/helper.js.map +1 -1
  43. package/build/index.d.ts +1 -0
  44. package/build/index.d.ts.map +1 -1
  45. package/build/index.js.map +1 -1
  46. package/build/permission/index.d.ts +1 -1
  47. package/build/permission/index.d.ts.map +1 -1
  48. package/build/permission/index.js +1 -1
  49. package/build/permission/index.js.map +1 -1
  50. package/build/permission/{model.d.ts → schemas.d.ts} +1 -1
  51. package/build/permission/schemas.d.ts.map +1 -0
  52. package/build/permission/{model.js → schemas.js} +1 -1
  53. package/build/permission/schemas.js.map +1 -0
  54. package/build/rely/index.d.ts +1 -1
  55. package/build/rely/index.d.ts.map +1 -1
  56. package/build/rely/index.js +1 -1
  57. package/build/rely/index.js.map +1 -1
  58. package/build/rely/{model.d.ts → schemas.d.ts} +1 -1
  59. package/build/rely/schemas.d.ts.map +1 -0
  60. package/build/rely/{model.js → schemas.js} +1 -1
  61. package/build/rely/schemas.js.map +1 -0
  62. package/build/supervisor.d.ts +0 -8
  63. package/build/supervisor.d.ts.map +1 -1
  64. package/build/types.d.ts +23 -1
  65. package/build/types.d.ts.map +1 -1
  66. package/package.json +3 -3
  67. package/src/allowance/index.ts +1 -1
  68. package/src/allowance/{model.ts → schemas.ts} +6 -4
  69. package/src/auth/index.ts +1 -1
  70. package/src/auth/{model.ts → schemas.ts} +3 -3
  71. package/src/consts.ts +14 -2
  72. package/src/entity/index.ts +1 -1
  73. package/src/entity/{profile.ts → schemas.ts} +3 -3
  74. package/src/errors.ts +22 -1
  75. package/src/helper/types.ts +22 -0
  76. package/src/helper.ts +44 -21
  77. package/src/index.ts +1 -0
  78. package/src/permission/index.ts +1 -1
  79. package/src/rely/index.ts +1 -1
  80. package/src/supervisor.ts +0 -8
  81. package/src/types.ts +30 -7
  82. package/tests/errors.spec.ts +19 -0
  83. package/build/.gitkeep +0 -0
  84. package/build/allowance/model.d.ts.map +0 -1
  85. package/build/allowance/model.js.map +0 -1
  86. package/build/auth/model.d.ts.map +0 -1
  87. package/build/auth/model.js.map +0 -1
  88. package/build/entity/profile.d.ts.map +0 -1
  89. package/build/permission/model.d.ts.map +0 -1
  90. package/build/permission/model.js.map +0 -1
  91. package/build/rely/model.d.ts.map +0 -1
  92. package/build/rely/model.js.map +0 -1
  93. /package/src/permission/{model.ts → schemas.ts} +0 -0
  94. /package/src/rely/{model.ts → schemas.ts} +0 -0
@@ -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, hosted-app (integrated provider) and PK-supervisor paths, the identity model (one account per e-mail, credentials on the account, profile rows per app and organization, organizations with groups), pairwise subjects, the acting organization as session state and its switch, the four permission kinds, 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*, *iam*, 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
 
@@ -17,69 +17,124 @@ The system supports multiple authentication paths that share the same `Auth` and
17
17
  Use case: service-to-service, wallet provider, backend clients, high-security browser-issued tokens.
18
18
 
19
19
  1. **Allowance**: client posts `AllowanceRequest` (a partial `AuthPayload`) to `/authentication/init`. Server returns `AllowanceResponse { challenge }`.
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.
20
+ 2. **Credential generation**: client builds `AuthCredentials` (challenge + ephemeral payload), signs the canonicalized payload with its Ed25519 keypair via `authCredentialsHelper.packAuthCredentials()` (`@owlmeans/basic-keys`), posts to `/authentication/authenticate`.
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 — only the id_token; an access token's format is provider-private — 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>`. The token set and, for a tenanted client, the organizations stay in the server-side session record ("Organizations and the session").
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; current userinfo on every request under `sessionValidation: 'required'` — 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` declaration from `makeAuthServiceEntrypoints`, bound at `/<prefix>/auth/update`.
33
36
 
34
- ### Provider-Backed Local Identity
37
+ ### Provider-backed local identity
35
38
 
36
- Use case: apps such as `product-viable` that use Google/OIDC as login bootstrap but authorize against local product identity.
39
+ Use case: a deployment that signs its own people in through Google, OIDC or an e-mail code and authorizes against its own identity store (`@owlmeans/server-auth-identity`).
37
40
 
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
- 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`.
43
-
44
- ## Core types
45
-
46
- Exported from `@owlmeans/auth`:
47
-
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.
56
-
57
- ## Enums and constants
58
-
59
- `@owlmeans/auth` constants:
60
-
61
- - `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'`.
65
-
66
- `@owlmeans/auth-common` constants:
67
-
68
- - `DEF_AUTH_SRV = 'auth'` and its alias `DEFAULT_GUARD = 'auth'`.
69
- - `TOKEN_UPDATE = 'auth-token-refresh'`.
70
- - `DISPATCHER_PATH = '/dispatcher'`.
71
-
72
- `@owlmeans/oidc` constants:
73
-
74
- - `OIDC_GATE = 'oidc-gate'` — the `gate(...)` value to attach OIDC enforcement to a module.
75
- - `GOOGLE_CLIENT_AUTH = 'google-oauth'` — browser plugin type for Google OAuth.
76
- - `GOOGLE_SERVICE = 'google'` — provider service key used by backend config and identity linking.
77
-
78
- For apps that use OIDC/Google only as a login provider and then authorize against local identity resources, declare a product-specific gate alias instead of reusing `OIDC_GATE`.
79
-
80
- ## Errors
81
-
82
- `@owlmeans/auth` exports: `AuthError`, `AuthManagerError`, `AuthenFailed`, `AuthenExists`, `AuthenPayloadError`, `AuthPluginError`, `TypeMissmatchError`, `AuthorizationError`, `AuthForbidden`, `ProfileError`, `ProfileConsistencyError`. Each is i18n-aware via `@owlmeans/error`.
43
+ 3. Server exchanges the provider code through `@owlmeans/server-oidc-rp`. The Google plugin refuses a userinfo whose `email_verified` is not `true` (`AuthenFailed('email-verified')`): the address is what links the sign-in to an account.
44
+ 4. The linking service (`AUTH_IDENTITY_LINKING`) maps `ProviderProfileDetails` onto the identity model ("The identity model"): `getLinkedProfile` follows the method's credential to its account and answers the row of THIS deployment's app in the account's main organization; otherwise `linkProfile(details, { username: verifiedEmail })` runs `identityOf(ctx).ensureAccount` — a further method of a known address becomes another credential on the same account, a new address registers an account with a personal organization — and `.ensureProfile` for the deployment's own app there (`owner: true`, `scopes: ['*']`).
45
+ 5. Server returns a normal OwlMeans bearer token carrying the organization's `entitySlug` and the row's `profileId`. Downstream product gates authorize against that row — requiring its `service` to be the deployment's own app, because the same organization holds hosted apps' rows — 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 the linking service `cfg.otp.identityAlias` names (default `AUTH_IDENTITY_LINKING`), and the manager signs the credential envelope as usual. An integrated provider's end-user login names the e-mail proof linking service there instead (next path).
54
+
55
+ ### Hosted-app sign-in through the integrated provider
56
+
57
+ Use case: an application a deployment hosts (a generated target) signs its end users in against the deployment's own OIDC provider (`@owlmeans/server-oidc-provider` with `@owlmeans/iam-integrated`), over the same identity store.
58
+
59
+ 1. The application's server relying party (`appendIam` of `@owlmeans/server-iam`) sends the browser to the provider with the base scopes plus `permissions` (and `organizations` for a tenanted client); a provisioned client's allowlist is a superset of everything a relying party asks for.
60
+ 2. The provider's login screen runs the e-mail code against the deployment's auth manager with the e-mail proof linking service (`makeEmailProofLinkingService`). Its payload proves the address and identifies nobody: `profileId: IAM_EMAIL_PROOF` (`'proof:email'`), `userId` = the address, one narrow end-user scope, no `entitySlug` — and it writes nothing.
61
+ 3. The provider's interaction finalizer verifies that proof, loads the interaction's client and calls `subjects.signIn(clientId, { email })`: the account (one per address; the e-mail code a credential on it), its primary row of the app as owner of the personal organization, and — for staff of the client's owning organization — the staff row there. The provider grant and session name the ACCOUNT id.
62
+ 4. `findAccount` asks `subjects.resolve(clientId, accountId)` for the claims. `null` (no row of the app, a disabled or expired primary row) refuses the account, and the provider's `account_refused` login check sends the browser back to the login screen instead of failing the consent.
63
+ 5. The claims: `sub` = the pairwise subject, `email`, `permissions`, and `organizations` under its scope. The account's record id never leaves the provider.
64
+
65
+ **Pairwise subjects.** Every client sees its own subject for one account: `identityKeyHelper.profileIdOf(clientId, accountId)` (`subjects.identify`) — the very `profileId` of the account's rows of that app — the same in the id_token, userinfo and introspection, and different for every other client, so two apps cannot correlate their users. The provider configuration that produces it (pairwise-only, the sector URI, `claims()` answering the account id) is governed by `server-oidc-provider` → "Pairwise subjects".
66
+
67
+ ### PK supervisor (development only)
68
+
69
+ Use case: deterministic end-to-end tests, and operator access to a development or stage environment.
70
+
71
+ 1. Client posts `{ type: 'pk-supervisor', userId }` to `/authentication/init`, receiving a single-use challenge.
72
+ 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.
73
+ 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.
74
+
75
+ Never enabled in real production — see the `supervisor-auth` skill.
76
+
77
+ ## The identity model
78
+
79
+ One store (`@owlmeans/server-auth-identity`) serves a deployment's own app and every app it hosts.
80
+ Its records, fields, indexes, races and events are governed by the `server-auth-identity` skill;
81
+ the protocol relies on these rules:
82
+
83
+ - **Account** — the person, ONE per e-mail; `entityId` = its personal organization. Every sign-in
84
+ method (e-mail code, Google, PK supervisor) is a **credential** on the account, never on a row.
85
+ - **Profile row** — one per (account, app, organization); `service` = the app (the deployment's own
86
+ key, or a hosted app's client id); `profileId = identityKeyHelper.profileIdOf(service, accountId)`
87
+ is computed, the same on every row of one (account, app), and is the pairwise subject that app's
88
+ client sees. The PRIMARY row (in the personal organization) carries `home` and `disabled`.
89
+ - **Organization** (`OrgEntity`) — `slug` (the wire `entitySlug`, renameable), `iamKey` (frozen,
90
+ claimed as `entityKey`, server-side only) and the organization's **groups** inside the document.
91
+ - Registration anywhere creates the account, its personal organization and an owner row of the app
92
+ signing in. The address IS the identity: every caller of `identityOf(ctx).ensureAccount` must have
93
+ verified it.
94
+
95
+ ## Organizations and the session
96
+
97
+ Tenancy is a property of the hosted app's client (`IamClientConfig.users` / `.operators`,
98
+ `iam` skill): with neither flag every subject acts in the client's owning organization; with either,
99
+ the client asks for `ORGANIZATIONS_SCOPE` and each subject acts in organizations of its own.
100
+
101
+ - **The acting organization is session state of the relying party**, never a request parameter.
102
+ The exchange picks it, every validation re-picks it by `entityKey`, and only the switch moves it —
103
+ governed by `server-oidc-rp` → "Organizations" (claims, session record, browser-token contents,
104
+ the switch handlers).
105
+ - **The request entity** on such a relying party is `{ id: entityKey, slug, iamKey: entityKey }`,
106
+ attached by the OIDC guard; `makeEntityScope(req).requireEntityKey()` answers the `entityKey` —
107
+ the tenant key a hosted app stores its records by (`auth-common` → "The organization entity").
108
+ - **Browser**: `organizationSwitchOf(ctx).listOrganizations` / `.switchOrganization` (`client-iam`).
109
+ **Server**: `makeOrganizationScope(context, request).organizationsOf` / `.organizationOf` and the
110
+ runtime IAM client `makeIamRuntimeClient(context, request)` (`server-iam`) over the provider's
111
+ runtime IAM API (`makeIamRuntimeProtocols`, `iam` skill), advertised as the discovery field
112
+ `owlmeans_iam_api`.
113
+
114
+ ## Permission kinds
115
+
116
+ What a grant binds to — nothing, an organization (`entityScoped`), resource ids (`resourceScoped`) or
117
+ both — is a property of its DEFINITION, and `defaultClass` (`none` / `user` / `member` / `owner`)
118
+ says who holds it without a grant. `hasPermission(auth, name, { scope?, resourceId?, entitySlug? })`
119
+ is fail-closed on a bound set. The model is governed by the `iam` skill ("Permission kinds",
120
+ "Default classes"); the gate that asserts it by `server-iam` ("How the gate decides").
121
+
122
+ ## Types, constants and errors
123
+
124
+ The payload chain is `Authorization` (`entitySlug?`, `scopes`, `permissions?`, …) → `ProfilePayload`
125
+ (+ `groups?`) → `AuthPayload` (+ `type`, `role`, `userId`, `profileId?`, …) → `AuthCredentials`
126
+ (+ `challenge`, `credential`) for authentication and `Auth` (+ `token`, `isUser`, `createdAt`) for a
127
+ resolved identity. **`entitySlug` is the only organization-entity value on the wire**; read it with
128
+ `authHelper.entitySlugOf(payload)`, never off the field. Where each name is governed:
129
+
130
+ - types, `AuthRole` (a **string** enum), `AuthenticationType`, query/header constants, the error
131
+ hierarchy (`AuthError` root; `AuthUnknown` 400, `AuthorizationError` → `AuthForbidden`,
132
+ `AuthenFailed` …) — the `auth` skill;
133
+ - guard aliases (`DEFAULT_GUARD`, `GUARD_ED25519`), `TOKEN_UPDATE`, reserved paths, `ENTITY_RESOLVER`
134
+ — the `auth-common` skill;
135
+ - `OIDC_GATE`, the Google plugin/service names, the `permissions` / `organizations` scopes and their
136
+ refusal reasons, `IAM_API_METADATA` — the `oidc` skill. An app that uses a provider only to sign in
137
+ and authorizes against local identity declares its own gate alias (`server-oidc-rp` → Rules).
83
138
 
84
139
  ## Guard interface
85
140
 
@@ -100,16 +155,20 @@ Guards are services registered on the context under their alias (`DEFAULT_GUARD`
100
155
 
101
156
  ## Trust resource
102
157
 
103
- `trust()` (`@owlmeans/auth-common`):
158
+ `trust()` lives on the `@owlmeans/auth-common/utils` subpath, not the package root:
104
159
 
105
160
  ```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
- }
161
+ import { trust } from '@owlmeans/auth-common/utils'
162
+ import { TRUSTED } from '@owlmeans/config'
163
+
164
+ // { user: TrustedRecord, key: KeyPairModel }
165
+ const { user, key } = await trust(context, TRUSTED, context.cfg.alias ?? context.cfg.service)
110
166
  ```
111
167
 
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.
168
+ It loads the record by `name` (a fourth argument matches another field), throws `SyntaxError` when
169
+ there is none, and answers a signing key pair when the `TrustedRecord` carries a `secret`, a
170
+ verify-only one otherwise. The `TRUSTED` config resource is the source of truth for known signing
171
+ identities — the auth service, peer services, wallet providers, supervisors (`auth-common`).
113
172
 
114
173
  ## Envelope shape
115
174
 
@@ -129,39 +188,54 @@ export const trust = async (context, resource, userName, field = 'name') => {
129
188
 
130
189
  ## Key model
131
190
 
132
- `KeyPairModel` (`@owlmeans/basic-keys`):
133
-
134
- ```ts
135
- export interface KeyPairModel {
136
- sign: (data) => Promise<string>
137
- verify: (data, signature) => Promise<boolean>
138
- export: () => string // private, "ed25519:<base64>"
139
- exportPublic: () => string // public, "ed25519:<base64>"
140
- exportAddress: () => string
141
- encrypt / decrypt / dcrpt
142
- }
143
- ```
144
-
145
- `makeKeyPairModel(input?)` (`@owlmeans/basic-keys`) accepts a `KeyPair`, an `ed25519:<base64>` string, or `undefined` for random. `fromPubKey(credential)` builds a public-only model. `packAuthCredentials(auth, extra, signer)` signs an `AuthCredentials` for the Ed25519 path.
191
+ `KeyPairModel` (`@owlmeans/basic-keys`, `basic-keys` skill) signs, verifies and exports
192
+ `ed25519:<base64>` keys; `makeKeyPairModel(input?)` builds one, `keyHelper.fromPubKey(credential)` a
193
+ verify-only one, and `authCredentialsHelper.packAuthCredentials(auth, extra, signer)` signs an
194
+ `AuthCredentials` for the Ed25519 path.
146
195
 
147
196
  ## Setup wiring
148
197
 
149
198
  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`).
199
+ - `makeAuthService(alias?)` / `appendAuthService(ctx, alias?)` (`@owlmeans/server-auth`) — the bearer guard.
200
+ - `makeAuthServiceEntrypoints(serviceAlias, prefix = 'oidc-api')` (`@owlmeans/server-oidc-rp`) — returns `external-auth:provider:list` and `external-auth:auth:update` declarations, both behind `GUARD_ED25519`; bind them in the serving app.
201
+ - `makeOidcWrappingService`, `makeOidcGate`, `makeOidcClientService`, `appendOidcGuard`, `oidcEntrypoints` — wire OIDC services and server-local bindings into a server context (`@owlmeans/server-oidc-rp`). Decorate the app protocol tree with `withOidcGuard` from `@owlmeans/oidc` before binding it.
202
+ - `appendIam(context)` (`@owlmeans/server-iam`) — the same four registrations with the IAM gate in place of `makeOidcGate()`, for an application signing in against an IAM provider.
153
203
 
154
204
  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.
157
- - `appendOidcGuard()`, `setupOidcGuard()` — `@owlmeans/web-oidc-rp` for browser-side.
205
+ - `appendAuthService(ctx, alias?)` (`@owlmeans/client-auth`) — the client auth service with persistent storage.
206
+ - `setupExternalAuthentication(service)` (`@owlmeans/client-auth`) — point `CAUTHEN_FLOW_ENTER` at the service an external provider redirects into.
207
+ - `appendLogin(ctx)` (`@owlmeans/client-auth/login`) — the login-plugin host; `@owlmeans/web-client`'s `makeContext` already calls it.
208
+ - `appendOidcGuard()`, `oidcEntrypoints()` — `@owlmeans/web-oidc-rp` for browser-side bindings; `withOidcGuard` decorates the shared protocol tree.
209
+ - `appendIam(context, opts?)`, `withIamGuard`, `iamEntrypoints()` (`@owlmeans/client-iam`) — the same in one import, plus the consent-before-sign-in precondition and the organization switch.
210
+
211
+ Local identity and the organization entity:
212
+ - `appendAuthIdentityResources(context, dbAlias?, { service? })` (`@owlmeans/server-auth-identity`) — registers the org-entity registry, the account/profile/credentials resources, the linking service for the deployment's own app key `service`, the entity resolver and the identity-events seam.
213
+ - `AUTH_IDENTITY_LINKING` — the service that maps provider profile details onto an `AuthPayload` of the deployment's own app.
214
+ - `AUTH_IDENTITY_PROFILE` — the profile rows: one per (account, app, organization), the record authorization reads (`role`, `scopes`, `permissions`, `groups`, optional expiry).
215
+ - `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.
216
+
217
+ 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.
218
+
219
+ ## Entity resolution is part of the protocol
220
+
221
+ Two places resolve the organization entity, and both are required:
222
+
223
+ 1. **At the auth manager**, before the credential envelope is signed. Whatever slug a plugin left on
224
+ `credential.entitySlug` is resolved and rewritten to the current one, so a token is canonical for
225
+ as long as it lives. An unresolvable value throws `AuthenFailed('entity')`.
226
+ 2. **At every server boundary that establishes authentication** — the HTTP boundary, and any socket
227
+ that authenticates after its connection is open — via
228
+ `makeEntityScope(request).attachEntity(context)` (`@owlmeans/auth-common`), which sets
229
+ `request.entity` and canonicalizes a retired slug.
158
230
 
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.
231
+ Handlers then key their records on `makeEntityScope(req).entityKeyOf()` / `.requireEntityKey()`,
232
+ which prefer the resolved id and fall back to the slug where no resolver is registered. A boundary
233
+ that skips step 2 leaves `request.entity` empty and its handlers silently compare a slug against
234
+ stored ids — which surfaces as "this record does not exist", not as a missing resolution.
163
235
 
164
- Read identity records with `load()` or `list()`. Do not use `pick()` for authorization lookups because `pick()` deletes the matching record.
236
+ A relying party of a tenanted client has no registry to resolve from: there the OIDC guard attaches
237
+ the session's acting organization itself, and `makeEntityScope(…).attachEntity` keeps it only while
238
+ its slug is exactly the token's (`auth-common` → "The organization entity").
165
239
 
166
240
  ## Mocking points (for category-B tests)
167
241
 
@@ -177,8 +251,9 @@ The protocol does **not** ship a fake JWKS server. For OIDC-end-to-end tests, ex
177
251
 
178
252
  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
253
 
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`
254
+ Each is pinned to an exact version, and [[oidc-versions]] owns those numbers plus the upgrade
255
+ checklist — read them there rather than duplicating them here:
256
+ - `oidc-provider` — in `@owlmeans/server-oidc-provider`
257
+ - `jose` — in `@owlmeans/server-oidc-provider` and `@owlmeans/server-oidc-rp`
258
+ - `openid-client` — in `@owlmeans/server-oidc-rp`
259
+ - `oidc-client-ts` — in `@owlmeans/web-oidc-rp` and `@owlmeans/mui-oidc-rp`
@@ -1,2 +1,2 @@
1
- export * from './model.js';
1
+ export * from './schemas.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/allowance/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/allowance/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './model.js';
1
+ export * from './schemas.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/allowance/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/allowance/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA"}
@@ -4,4 +4,4 @@ export declare const PartialAuthPayloadSchema: JSONSchemaType<Omit<Partial<AuthP
4
4
  export declare const AllowanceRequestSchema: JSONSchemaType<AllowanceRequest>;
5
5
  export declare const AuthCredentialsSchema: JSONSchemaType<AuthCredentials>;
6
6
  export declare const AuthSchema: JSONSchemaType<Auth>;
7
- //# sourceMappingURL=model.d.ts.map
7
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/allowance/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAQvF,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAkBvF,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,gBAAgB,CAQnE,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,eAAe,CAajE,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,IAAI,CAe3C,CAAA"}
@@ -1,6 +1,6 @@
1
- import { AuthRoleSchema, EntityValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
- import { AuthPayloadSchema } from '../auth/model.js';
3
- import { AttributeSetSchema, PermissionSetSchema } from '../permission/model.js';
1
+ import { AuthRoleSchema, EntitySlugValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
+ import { AuthPayloadSchema } from '../auth/schemas.js';
3
+ import { AttributeSetSchema, PermissionSetSchema } from '../permission/schemas.js';
4
4
  export const PartialAuthPayloadSchema = {
5
5
  type: 'object',
6
6
  properties: {
@@ -10,7 +10,7 @@ export const PartialAuthPayloadSchema = {
10
10
  profileId: { ...IdValueSchema, nullable: true },
11
11
  expiresAt: { ...DateSchema, nullable: true },
12
12
  groups: { type: 'array', items: GroupValueSchema, nullable: true },
13
- entityId: { ...EntityValueSchema, nullable: true },
13
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
14
14
  scopes: { type: 'array', items: ScopeValueSchema, nullable: true },
15
15
  permissions: { type: 'array', nullable: true, items: PermissionSetSchema },
16
16
  attributes: { type: 'array', nullable: true, items: AttributeSetSchema },
@@ -49,6 +49,8 @@ export const AuthSchema = {
49
49
  token: { type: 'string', minLength: 32, maxLength: 1024 },
50
50
  isUser: { type: 'boolean' },
51
51
  createdAt: DateSchema,
52
+ sessionId: { type: 'string', minLength: 16, maxLength: 128, nullable: true },
53
+ authorizationVersion: { type: 'integer', minimum: 1, nullable: true },
52
54
  expiresAt: { ...DateSchema, nullable: true },
53
55
  ...AuthPayloadSchema.properties,
54
56
  },
@@ -57,4 +59,4 @@ export const AuthSchema = {
57
59
  ],
58
60
  additionalProperties: false,
59
61
  };
60
- //# sourceMappingURL=model.js.map
62
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/allowance/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAClF,gBAAgB,EAAE,cAAc,EACjC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAElF,MAAM,CAAC,MAAM,wBAAwB,GAAuD;IAC1F,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,GAAG,cAAc,EAAE,QAA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OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;KACzD;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './model.js';
1
+ export * from './schemas.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './model.js';
1
+ export * from './schemas.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA"}
@@ -5,4 +5,4 @@ export declare const ProfilePayloadSchema: JSONSchemaType<ProfilePayload>;
5
5
  export declare const AuthPayloadSchema: JSONSchemaType<AuthPayload>;
6
6
  export declare const AuthTokenSchema: JSONSchemaType<AuthToken>;
7
7
  export declare const OptionalAuthTokenSchema: JSONSchemaType<Partial<AuthToken>>;
8
- //# sourceMappingURL=model.d.ts.map
8
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/auth/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAOxF,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,aAAa,CAY7D,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,cAAc,CAQ/D,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CAazD,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,SAAS,CAOrD,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAOtE,CAAA"}
@@ -1,9 +1,9 @@
1
- import { EntityValueSchema, EnumValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
- import { AttributeSetSchema, PermissionSetSchema } from '../permission/model.js';
1
+ import { EntitySlugValueSchema, EnumValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
+ import { AttributeSetSchema, PermissionSetSchema } from '../permission/schemas.js';
3
3
  export const AuthorizationSchema = {
4
4
  type: 'object',
5
5
  properties: {
6
- entityId: { ...EntityValueSchema, nullable: true },
6
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
7
7
  scopes: { type: 'array', items: ScopeValueSchema },
8
8
  permissions: { type: 'array', nullable: true, items: PermissionSetSchema },
9
9
  attributes: { type: 'array', nullable: true, items: AttributeSetSchema },
@@ -52,4 +52,4 @@ export const OptionalAuthTokenSchema = {
52
52
  required: [],
53
53
  additionalProperties: false,
54
54
  };
55
- //# sourceMappingURL=model.js.map
55
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/auth/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EACrG,cAAc,EACf,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAElF,MAAM,CA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,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,SAAS,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,SAAS,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;KACtC;IACR,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;IACpC,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC1D;IACD,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAuC;IACzE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC1E;IACD,QAAQ,EAAE,EAAE;IACZ,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
package/build/consts.d.ts CHANGED
@@ -50,6 +50,8 @@ export declare const ScopeValueSchema: JSONSchemaType<string>;
50
50
  export declare const PermissionValueSchema: JSONSchemaType<string>;
51
51
  export declare const ResourceValueSchema: JSONSchemaType<string>;
52
52
  export declare const AttributeValueSchema: JSONSchemaType<string>;
53
+ export declare const EntitySlugValueSchema: JSONSchemaType<string>;
54
+ /** @deprecated The organization value on the wire is a slug — use {@link EntitySlugValueSchema}. */
53
55
  export declare const EntityValueSchema: JSONSchemaType<string>;
54
56
  export declare const GroupValueSchema: JSONSchemaType<string>;
55
57
  export declare const TypeNameSchema: JSONSchemaType<string>;
@@ -59,10 +61,18 @@ export declare const DateSchema: JSONSchemaType<Date>;
59
61
  export declare const AuthRoleSchema: JSONSchemaType<AuthRole>;
60
62
  export declare const DISPATCHER = "dispatcher";
61
63
  export declare const DISPATCHER_AUTHEN = "dispatcher:authentication";
64
+ /**
65
+ * The login window opened one level up by an application that cannot complete the flow where it is.
66
+ *
67
+ * A separate entrypoint from {@link DISPATCHER} because it is never a `redirect_uri` — the provider
68
+ * always returns to the dispatcher, whatever page opened the window — and because a logout has to
69
+ * run somewhere that does not start the authorization machine.
70
+ */
71
+ export declare const DISPATCHER_SURROGATE = "dispatcher:surrogate";
62
72
  export declare const AUTHEN_RELY = "authentication-rely";
63
73
  export declare const AUTH_HEADER = "authorization";
64
74
  export declare const AUTH_QUERY = "token";
65
- export declare const ENTITY_QUERY = "entity";
75
+ export declare const ENTITY_QUERY = "entitySlug";
66
76
  export declare const PROFILE_QUERY = "profile";
67
77
  export declare const MOD_RECAPTCHA = "_external:re-captcha";
68
78
  export declare const CMOD_RECAPTCHA: string;
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,eAAO,MAAM,OAAO,MAAM,CAAA;AAC1B,eAAO,MAAM,OAAO,MAAM,CAAA;AAC1B,eAAO,MAAM,QAAQ,MAAM,CAAA;AAC3B,eAAO,MAAM,SAAS,MAAM,CAAA;AAE5B,eAAO,MAAM,UAAU,MAAM,CAAA;AAC7B,eAAO,MAAM,UAAU,WAAW,CAAA;AAElC,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED,oBAAY,kBAAkB;IAC5B,YAAY,kBAAkB;IAC9B,YAAY,mBAAmB;IAC/B,SAAS,eAAe;IAQxB,S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CAAC,MAAM,CAAoD,CAAA;AAErG,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,IAAI,CAA8E,CAAA;AAE1H,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,QAAQ,CAAqD,CAAA;AAEzG,eAAO,MAAM,UAAU,eAAe,CAAA;AACtC,eAAO,MAAM,iBAAiB,8BAAiC,CAAA;AAE/D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,yBAA4B,CAAA;AAE7D,eAAO,MAAM,WAAW,wBAAmB,CAAA;AAE3C,eAAO,MAAM,WAAW,kBAAkB,CAAA;AAC1C,eAAO,MAAM,UAAU,UAAU,CAAA;AACjC,eAAO,MAAM,YAAY,eAAe,CAAA;AACxC,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC,eAAO,MAAM,aAAa,yBAAyB,CAAA;AACnD,eAAO,MAAM,cAAc,QAAsC,CAAA;AAEjE,eAAO,MAAM,QAAQ,YAAY,CAAA;AACjC,eAAO,MAAM,QAAQ,SAAS,CAAA"}
package/build/consts.js CHANGED
@@ -87,7 +87,9 @@ export const ScopeValueSchema = { type: 'string', minLength: 1, maxLength: 32 };
87
87
  export const PermissionValueSchema = { type: 'string', minLength: 8, maxLength: 128 };
88
88
  export const ResourceValueSchema = { type: 'string', minLength: 8, maxLength: 128 };
89
89
  export const AttributeValueSchema = { type: 'string', minLength: 8, maxLength: 128 };
90
- export const EntityValueSchema = { type: 'string', minLength: 3, maxLength: 256 };
90
+ export const EntitySlugValueSchema = { type: 'string', minLength: 3, maxLength: 256 };
91
+ /** @deprecated The organization value on the wire is a slug — use {@link EntitySlugValueSchema}. */
92
+ export const EntityValueSchema = EntitySlugValueSchema;
91
93
  export const GroupValueSchema = { type: 'string', minLength: 1, maxLength: 128 };
92
94
  export const TypeNameSchema = { type: 'string', minLength: 1, maxLength: 64 };
93
95
  export const EnumValueSchema = { type: 'string', minLength: 1, maxLength: 32 };
@@ -96,10 +98,18 @@ export const DateSchema = { type: 'object', format: 'date-time' };
96
98
  export const AuthRoleSchema = { type: 'string', enum: Object.values(AuthRole) };
97
99
  export const DISPATCHER = 'dispatcher';
98
100
  export const DISPATCHER_AUTHEN = `${DISPATCHER}:authentication`;
101
+ /**
102
+ * The login window opened one level up by an application that cannot complete the flow where it is.
103
+ *
104
+ * A separate entrypoint from {@link DISPATCHER} because it is never a `redirect_uri` — the provider
105
+ * always returns to the dispatcher, whatever page opened the window — and because a logout has to
106
+ * run somewhere that does not start the authorization machine.
107
+ */
108
+ export const DISPATCHER_SURROGATE = `${DISPATCHER}:surrogate`;
99
109
  export const AUTHEN_RELY = `${AUTHEN}-rely`;
100
110
  export const AUTH_HEADER = 'authorization';
101
111
  export const AUTH_QUERY = 'token';
102
- export const ENTITY_QUERY = 'entity';
112
+ export const ENTITY_QUERY = 'entitySlug';
103
113
  export const PROFILE_QUERY = 'profile';
104
114
  export const MOD_RECAPTCHA = '_external:re-captcha';
105
115
  export const CMOD_RECAPTCHA = `_client-${MOD_RECAPTCHA.slice(1)}`;
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAA;AAC1B,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAA;AAC1B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;AAC3B,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAA;AAElC,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;IACf,mCAAuB,CAAA;IACvB,+BAAmB,CAAA;AACrB,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AA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,iBAAiB,GAAG,GAAG,UAAU,iBAAiB,CAAA;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,UAAU,YAAY,CAAA;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,MAAM,OAAO,CAAA;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAA;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAA;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAA;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAA;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAA;AACjC,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAA"}
@@ -1,2 +1,2 @@
1
- export * from './profile.js';
1
+ export * from './schemas.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export * from './profile.js';
1
+ export * from './schemas.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
1
  import type { JSONSchemaType } from 'ajv';
2
2
  import type { Profile } from '../types.js';
3
3
  export declare const ProfileSchema: JSONSchemaType<Profile>;
4
- //# sourceMappingURL=profile.d.ts.map
4
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/entity/schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,OAAO,CAiBjD,CAAA"}