@owlmeans/auth 0.1.18-rc.9 → 0.1.18

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 (84) hide show
  1. package/README.md +289 -45
  2. package/agent-meta/manifest.json +3 -3
  3. package/agent-meta/skills/auth/SKILL.md +29 -23
  4. package/agent-meta/skills/auth-protocol/SKILL.md +111 -91
  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/schemas.d.ts +7 -0
  10. package/build/allowance/schemas.d.ts.map +1 -0
  11. package/build/allowance/schemas.js +62 -0
  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/schemas.d.ts +8 -0
  18. package/build/auth/schemas.d.ts.map +1 -0
  19. package/build/auth/schemas.js +55 -0
  20. package/build/auth/schemas.js.map +1 -0
  21. package/build/consts.d.ts +5 -0
  22. package/build/consts.d.ts.map +1 -1
  23. package/build/consts.js +5 -0
  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/schemas.d.ts +4 -0
  28. package/build/entity/schemas.d.ts.map +1 -0
  29. package/build/entity/schemas.js +21 -0
  30. package/build/entity/schemas.js.map +1 -0
  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 +7 -11
  40. package/build/helper.d.ts.map +1 -1
  41. package/build/helper.js +30 -27
  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/schemas.d.ts +6 -0
  51. package/build/permission/schemas.d.ts.map +1 -0
  52. package/build/permission/schemas.js +27 -0
  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/schemas.d.ts +4 -0
  59. package/build/rely/schemas.d.ts.map +1 -0
  60. package/build/rely/schemas.js +12 -0
  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 +12 -0
  65. package/build/types.d.ts.map +1 -1
  66. package/package.json +4 -4
  67. package/src/allowance/index.ts +1 -1
  68. package/src/allowance/{model.ts → schemas.ts} +4 -2
  69. package/src/auth/index.ts +1 -1
  70. package/src/auth/{model.ts → schemas.ts} +1 -1
  71. package/src/consts.ts +6 -0
  72. package/src/entity/index.ts +1 -1
  73. package/src/entity/{profile.ts → schemas.ts} +1 -1
  74. package/src/errors.ts +22 -1
  75. package/src/helper/types.ts +22 -0
  76. package/src/helper.ts +44 -33
  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 +13 -0
  82. package/tests/errors.spec.ts +19 -0
  83. /package/src/permission/{model.ts → schemas.ts} +0 -0
  84. /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 — 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.
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,7 +17,7 @@ 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`.
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
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
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
23
  5. **Bearer**: client sends `Authorization: ED25519-BASIC-TOKEN <encoded>`.
@@ -30,19 +30,19 @@ Use case: service-to-service, wallet provider, backend clients, high-security br
30
30
  Use case: browser clients, third-party IdP integration, multi-tenant SaaS.
31
31
 
32
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>`.
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
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`.
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`.
36
36
 
37
- ### Provider-Backed Local Identity
37
+ ### Provider-backed local identity
38
38
 
39
- 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`).
40
40
 
41
41
  1. Browser imports `@owlmeans/web-oidc-rp/auth/plugins`, which registers OIDC and Google plugins in `@owlmeans/client-auth`.
42
42
  2. The plugin persists auth control state, redirects to the provider, restores state on return, and submits code/query params as `AuthCredentials`.
43
- 3. Server exchanges the provider code through `@owlmeans/server-oidc-rp` and maps `ProviderProfileDetails` through `@owlmeans/server-auth-identity`.
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`.
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
46
 
47
47
  ### Email one-time code
48
48
 
@@ -50,7 +50,19 @@ Use case: passwordless sign-in where no external IdP is wanted.
50
50
 
51
51
  1. Client posts `{ type: 'email-otp', userId: <email> }` to `/authentication/init`.
52
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.
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".
54
66
 
55
67
  ### PK supervisor (development only)
56
68
 
@@ -62,56 +74,67 @@ Use case: deterministic end-to-end tests, and operator access to a development o
62
74
 
63
75
  Never enabled in real production — see the `supervisor-auth` skill.
64
76
 
65
- ## Core types
66
-
67
- Exported from `@owlmeans/auth`:
68
-
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.
84
-
85
- ## Enums and constants
86
-
87
- `@owlmeans/auth` constants:
88
-
89
- - `AuthRole` — **string** enum: `User`, `Guest`, `Service`, `System`, `Admin`, `Superuser`, `Blocked`. Never use numeric literals for `role` fields — always use `AuthRole.User` etc.
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.
95
-
96
- `@owlmeans/auth-common` constants:
97
-
98
- - `DEF_AUTH_SRV = 'auth'` and its alias `DEFAULT_GUARD = 'auth'`.
99
- - `GUARD_ED25519 = 'guard:ed25519-basic-signature'`.
100
- - `TOKEN_UPDATE = 'auth-token-refresh'`.
101
- - `DISPATCHER_PATH = '/dispatcher'` and `SURROGATE_PATH = '/surrogate'` — both reserved paths.
102
- - `ENTITY_RESOLVER = 'entity-resolver'` and `ENTITY_SLUG_PATTERN` — the organization-entity contract.
103
-
104
- `@owlmeans/oidc` constants:
105
-
106
- - `OIDC_GATE = 'oidc-gate'` — the `gate(...)` value to attach OIDC enforcement to an entrypoint.
107
- - `GOOGLE_CLIENT_AUTH = 'google-oauth'` — browser plugin type for Google OAuth.
108
- - `GOOGLE_SERVICE = 'google'` — provider service key used by backend config and identity linking.
109
-
110
- 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`.
111
-
112
- ## Errors
113
-
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`.
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).
115
138
 
116
139
  ## Guard interface
117
140
 
@@ -142,10 +165,10 @@ import { TRUSTED } from '@owlmeans/config'
142
165
  const { user, key } = await trust(context, TRUSTED, context.cfg.alias ?? context.cfg.service)
143
166
  ```
144
167
 
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.
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`).
149
172
 
150
173
  ## Envelope shape
151
174
 
@@ -165,38 +188,30 @@ It loads the record by `name` (pass a fourth argument to match on another field)
165
188
 
166
189
  ## Key model
167
190
 
168
- `KeyPairModel` (`@owlmeans/basic-keys`):
169
-
170
- ```ts
171
- export interface KeyPairModel {
172
- sign: (data) => Promise<string>
173
- verify: (data, signature) => Promise<boolean>
174
- export: () => string // private, "ed25519:<base64>"
175
- exportPublic: () => string // public, "ed25519:<base64>"
176
- exportAddress: () => string
177
- encrypt / decrypt / dcrpt
178
- }
179
- ```
180
-
181
- `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.
182
195
 
183
196
  ## Setup wiring
184
197
 
185
198
  Server-side:
186
199
  - `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`).
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.
189
203
 
190
204
  Client-side:
191
205
  - `appendAuthService(ctx, alias?)` (`@owlmeans/client-auth`) — the client auth service with persistent storage.
192
206
  - `setupExternalAuthentication(service)` (`@owlmeans/client-auth`) — point `CAUTHEN_FLOW_ENTER` at the service an external provider redirects into.
193
207
  - `appendLogin(ctx)` (`@owlmeans/client-auth/login`) — the login-plugin host; `@owlmeans/web-client`'s `makeContext` already calls it.
194
- - `appendOidcGuard()`, `setupOidcGuard()` — `@owlmeans/web-oidc-rp` for browser-side.
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.
195
210
 
196
211
  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.
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).
200
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.
201
216
 
202
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.
@@ -209,13 +224,18 @@ Two places resolve the organization entity, and both are required:
209
224
  `credential.entitySlug` is resolved and rewritten to the current one, so a token is canonical for
210
225
  as long as it lives. An unresolvable value throws `AuthenFailed('entity')`.
211
226
  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.
214
-
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.
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.
230
+
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.
235
+
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").
219
239
 
220
240
  ## Mocking points (for category-B tests)
221
241
 
@@ -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"}
@@ -0,0 +1,7 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { AllowanceRequest, Auth, AuthCredentials, AuthPayload } from '../types.js';
3
+ export declare const PartialAuthPayloadSchema: JSONSchemaType<Omit<Partial<AuthPayload>, "type">>;
4
+ export declare const AllowanceRequestSchema: JSONSchemaType<AllowanceRequest>;
5
+ export declare const AuthCredentialsSchema: JSONSchemaType<AuthCredentials>;
6
+ export declare const AuthSchema: JSONSchemaType<Auth>;
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"}
@@ -0,0 +1,62 @@
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
+ export const PartialAuthPayloadSchema = {
5
+ type: 'object',
6
+ properties: {
7
+ role: { ...AuthRoleSchema, nullable: true },
8
+ source: { type: 'string', minLength: 1, maxLength: 1024, nullable: true },
9
+ userId: { ...IdValueSchema, nullable: true },
10
+ profileId: { ...IdValueSchema, nullable: true },
11
+ expiresAt: { ...DateSchema, nullable: true },
12
+ groups: { type: 'array', items: GroupValueSchema, nullable: true },
13
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
14
+ scopes: { type: 'array', items: ScopeValueSchema, nullable: true },
15
+ permissions: { type: 'array', nullable: true, items: PermissionSetSchema },
16
+ attributes: { type: 'array', nullable: true, items: AttributeSetSchema },
17
+ permissioned: { type: 'boolean', nullable: true },
18
+ denormalized: { type: 'boolean', nullable: true }
19
+ },
20
+ required: [],
21
+ additionalProperties: false,
22
+ };
23
+ export const AllowanceRequestSchema = {
24
+ type: 'object',
25
+ properties: {
26
+ type: TypeNameSchema,
27
+ ...PartialAuthPayloadSchema.properties,
28
+ },
29
+ required: ['type'],
30
+ additionalProperties: false,
31
+ };
32
+ export const AuthCredentialsSchema = {
33
+ type: 'object',
34
+ properties: {
35
+ challenge: { type: 'string', minLength: 32, maxLength: 1024 },
36
+ // Not every plugin's credential is a long token/signature — email-OTP submits a short
37
+ // numeric code (see @owlmeans/auth-otp OTP_CODE_LENGTH). Security here comes from the
38
+ // signed challenge envelope plus each plugin's own credential check, not this length floor.
39
+ credential: { type: 'string', minLength: 1, maxLength: 4096 },
40
+ publicKey: { type: 'string', minLength: 16, maxLength: 1024, nullable: true },
41
+ ...AuthPayloadSchema.properties
42
+ },
43
+ required: ['challenge', 'credential', ...AuthPayloadSchema.required],
44
+ additionalProperties: false,
45
+ };
46
+ export const AuthSchema = {
47
+ type: 'object',
48
+ properties: {
49
+ token: { type: 'string', minLength: 32, maxLength: 1024 },
50
+ isUser: { type: 'boolean' },
51
+ createdAt: DateSchema,
52
+ sessionId: { type: 'string', minLength: 16, maxLength: 128, nullable: true },
53
+ authorizationVersion: { type: 'integer', minimum: 1, nullable: true },
54
+ expiresAt: { ...DateSchema, nullable: true },
55
+ ...AuthPayloadSchema.properties,
56
+ },
57
+ required: [
58
+ 'token', 'isUser', 'createdAt', 'type', 'role', 'userId'
59
+ ],
60
+ additionalProperties: false,
61
+ };
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,QAAQ,EAAE,IAAI,EAAE;QAC3C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzE,MAAM,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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;QAC7D,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7E,GAAG,iBAAiB,CAAC,UAAU;KAChC;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC,QAAQ,CAAC;IACpE,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;QACzD,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,SAAS,EAAE,UAAU;QACrB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5E,oBAAoB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACrE,SAAS,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,GAAG,iBAAiB,CAAC,UAAU;KAChC;IACD,QAAQ,EAAE;QACR,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"}
@@ -0,0 +1,8 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { AuthPayload, AuthToken, Authorization, ProfilePayload } from '../types.js';
3
+ export declare const AuthorizationSchema: JSONSchemaType<Authorization>;
4
+ export declare const ProfilePayloadSchema: JSONSchemaType<ProfilePayload>;
5
+ export declare const AuthPayloadSchema: JSONSchemaType<AuthPayload>;
6
+ export declare const AuthTokenSchema: JSONSchemaType<AuthToken>;
7
+ export declare const OptionalAuthTokenSchema: JSONSchemaType<Partial<AuthToken>>;
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"}
@@ -0,0 +1,55 @@
1
+ import { EntitySlugValueSchema, EnumValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
+ import { AttributeSetSchema, PermissionSetSchema } from '../permission/schemas.js';
3
+ export const AuthorizationSchema = {
4
+ type: 'object',
5
+ properties: {
6
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
7
+ scopes: { type: 'array', items: ScopeValueSchema },
8
+ permissions: { type: 'array', nullable: true, items: PermissionSetSchema },
9
+ attributes: { type: 'array', nullable: true, items: AttributeSetSchema },
10
+ permissioned: { type: 'boolean', nullable: true },
11
+ denormalized: { type: 'boolean', nullable: true }
12
+ },
13
+ required: ['scopes'],
14
+ additionalProperties: false,
15
+ };
16
+ export const ProfilePayloadSchema = {
17
+ type: 'object',
18
+ properties: {
19
+ ...AuthorizationSchema.properties,
20
+ groups: { type: 'array', nullable: true, items: GroupValueSchema },
21
+ },
22
+ required: ['scopes'],
23
+ additionalProperties: false,
24
+ };
25
+ export const AuthPayloadSchema = {
26
+ type: 'object',
27
+ properties: {
28
+ ...ProfilePayloadSchema.properties,
29
+ type: TypeNameSchema,
30
+ role: EnumValueSchema,
31
+ source: { type: 'string', minLength: 1, maxLength: 1024, nullable: true },
32
+ userId: { ...IdValueSchema, nullable: true },
33
+ profileId: { ...IdValueSchema, nullable: true },
34
+ expiresAt: { ...DateSchema, nullable: true },
35
+ },
36
+ required: ['scopes', 'role', 'type'],
37
+ additionalProperties: false,
38
+ };
39
+ export const AuthTokenSchema = {
40
+ type: 'object',
41
+ properties: {
42
+ token: { type: 'string', minLength: 32, maxLength: 1024 },
43
+ },
44
+ required: ['token'],
45
+ additionalProperties: false,
46
+ };
47
+ export const OptionalAuthTokenSchema = {
48
+ type: 'object',
49
+ properties: {
50
+ token: { type: 'string', minLength: 32, maxLength: 1024, nullable: true },
51
+ },
52
+ required: [],
53
+ additionalProperties: false,
54
+ };
55
+ //# sour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QUERY = "profile";
77
77
  export declare const MOD_RECAPTCHA = "_external:re-captcha";
78
78
  export declare const CMOD_RECAPTCHA: string;
79
+ /**
80
+ * The guard of a route a reCAPTCHA-proven guest may call once: `Authorization: RE-CAPTCHA <token>`,
81
+ * the token the auth manager's reCAPTCHA plugin issued (`makeReCaptchaGuard` in server-auth).
82
+ */
83
+ export declare const RECAPTCHA_GUARD = "guard:re-captcha";
79
84
  export declare const GUEST_ID = "__guest";
80
85
  export declare const RELY_3RD = "rely";
81
86
  //# sourceMappingURL=consts.d.ts.map
@@ -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,SAAS,eAAe;IAIxB,aAAa,mBAAmB;IAQhC,cAAc,oBAAoB;IAOlC,cAAc,oBAAoB;IAGlC,MAAM,iBAAiB;IAKvB,UAAU,kBAAkB;CAC7B;AAED,oBAAY,iBAAiB;IAE3B,SAAS,eAAe;IAGxB,iBAAiB,wBAAwB;IAGzC,qBAAqB,4BAA4B;CAClD;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,SAAS,cA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AEzG,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;;;GAGG;AACH,eAAO,MAAM,eAAe,qBAAqB,CAAA;AAEjD,eAAO,MAAM,QAAQ,YAAY,CAAA;AACjC,eAAO,MAAM,QAAQ,SAAS,CAAA"}
package/build/consts.js CHANGED
@@ -113,6 +113,11 @@ export const ENTITY_QUERY = 'entitySlug';
113
113
  export const PROFILE_QUERY = 'profile';
114
114
  export const MOD_RECAPTCHA = '_external:re-captcha';
115
115
  export const CMOD_RECAPTCHA = `_client-${MOD_RECAPTCHA.slice(1)}`;
116
+ /**
117
+ * The guard of a route a reCAPTCHA-proven guest may call once: `Authorization: RE-CAPTCHA <token>`,
118
+ * the token the auth manager's reCAPTCHA plugin issued (`makeReCaptchaGuard` in server-auth).
119
+ */
120
+ export const RECAPTCHA_GUARD = 'guard:re-captcha';
116
121
  export const GUEST_ID = '__guest';
117
122
  export const RELY_3RD = 'rely';
118
123
  //# sourceMappingURL=consts.js.map
@@ -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,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
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
@@ -0,0 +1,4 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { Profile } from '../types.js';
3
+ export declare const ProfileSchema: JSONSchemaType<Profile>;
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"}