@owlmeans/auth-email 0.0.0-stage → 0.1.19-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -2
- package/agent-meta/manifest.json +16 -0
- package/agent-meta/skills/auth-email/SKILL.md +107 -0
- package/build/consts.d.ts +78 -0
- package/build/consts.d.ts.map +1 -0
- package/build/consts.js +85 -0
- package/build/consts.js.map +1 -0
- package/build/entrypoints.d.ts +16 -0
- package/build/entrypoints.d.ts.map +1 -0
- package/build/entrypoints.js +58 -0
- package/build/entrypoints.js.map +1 -0
- package/build/errors.d.ts +43 -0
- package/build/errors.d.ts.map +1 -0
- package/build/errors.js +66 -0
- package/build/errors.js.map +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +5 -0
- package/build/index.js.map +1 -0
- package/build/schemas.d.ts +12 -0
- package/build/schemas.d.ts.map +1 -0
- package/build/schemas.js +79 -0
- package/build/schemas.js.map +1 -0
- package/build/types.d.ts +173 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +46 -4
- package/src/consts.ts +107 -0
- package/src/entrypoints.ts +117 -0
- package/src/errors.ts +78 -0
- package/src/index.ts +5 -0
- package/src/schemas.ts +95 -0
- package/src/types.ts +179 -0
- package/tests/consts.spec.ts +66 -0
- package/tests/entrypoints.spec.ts +101 -0
- package/tests/schemas.spec.ts +95 -0
- package/tsconfig.json +15 -0
package/README.md
CHANGED
|
@@ -1,3 +1,152 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @owlmeans/auth-email
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The shared contracts of OwlMeans e-mail sign-in — a mailed PIN, an optional password, remembered
|
|
4
|
+
devices and an optional captcha: the protocol factory `makeEmailAuthProtocols`, the AJV request
|
|
5
|
+
schemas, the views, the constants and the error family. Server and browser both depend on it so
|
|
6
|
+
they agree on every route, field and value. It contains no runtime behaviour: a server serves the
|
|
7
|
+
routes with `@owlmeans/server-auth-email`, a browser signs in with `@owlmeans/web-auth-email`.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun add @owlmeans/auth-email@^0.1.19-rc.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`ajv` and `ajv-formats` are peer dependencies (the schemas use `format: 'email'`).
|
|
16
|
+
|
|
17
|
+
## Concepts
|
|
18
|
+
|
|
19
|
+
- **PIN sign-in** — `pin` mails a 6-digit PIN and answers a signed `challenge`, identically for a
|
|
20
|
+
known and a new address; `signIn` with `challenge` + `pin` signs the person in (registering the
|
|
21
|
+
account on first use) and remembers the device.
|
|
22
|
+
- **Password sign-in** — `signIn` with `password` (+ `captcha`). On a remembered device it answers a
|
|
23
|
+
`token`; on an unknown one the password is NOT checked: a PIN is mailed and the answer is
|
|
24
|
+
`{ challenge, reason: 'device' }`, the same for a wrong password, a right one and no account.
|
|
25
|
+
- **One sign-in body** — `EmailSignInRequest` carries both modes' optional fields; the server
|
|
26
|
+
accepts exactly one mode (`challenge` + `pin`, or `password`) and refuses anything else.
|
|
27
|
+
- **Device** — a random id the browser keeps (`EMAIL_DEVICE_ID_PATTERN`); remembered for
|
|
28
|
+
`EMAIL_DEVICE_TTL_DAYS`, at most `EMAIL_DEVICE_LIMIT` per account.
|
|
29
|
+
- **Offer** — a PIN sign-in of a person without a password who has not declined one also answers a
|
|
30
|
+
one-use `offer` ticket (`EMAIL_OFFER_TTL_SECONDS`): `password.set` with it needs no second PIN.
|
|
31
|
+
Later set/change/remove are confirmed by a PIN from `password.pin`.
|
|
32
|
+
- **Tech routes** — developer tooling (`GUARD_ED25519` + the `EMAIL_AUTH_TECH_GATE` gate): rewrite
|
|
33
|
+
a pending PIN, or get a signed waiver (`EMAIL_WAIVER_HEADER`) that skips captcha and throttles.
|
|
34
|
+
- **No organization on the wire** — no request body carries `entitySlug` or `source`; the address
|
|
35
|
+
alone decides the account.
|
|
36
|
+
|
|
37
|
+
## Routes
|
|
38
|
+
|
|
39
|
+
`makeEmailAuthProtocols(opts)` — default base `/auth/email`:
|
|
40
|
+
|
|
41
|
+
| Protocol | Alias | Method + path | Guard | Body → answer |
|
|
42
|
+
|---|---|---|---|---|
|
|
43
|
+
| `options` | `auth-email:options` | GET `/options` | none | → `EmailAuthOptionsView` |
|
|
44
|
+
| `pin` | `auth-email:pin` | POST `/pin` | none | `EmailPinRequest` → `EmailChallengeView` |
|
|
45
|
+
| `signIn` | `auth-email:sign-in` | POST `/sign-in` | none | `EmailSignInRequest` → `EmailSignInView` |
|
|
46
|
+
| `password.status` | `auth-email:password:status` | GET `/password` | `opts.guards` + `opts.gate` | → `EmailPasswordStatusView` |
|
|
47
|
+
| `password.pin` | `auth-email:password:pin` | POST `/password/pin` | same | `EmailPasswordPinRequest` → `EmailChallengeView` |
|
|
48
|
+
| `password.set` | `auth-email:password:set` | POST `/password/set` | same | `EmailPasswordSetRequest` → `EmailPasswordStatusView` |
|
|
49
|
+
| `password.remove` | `auth-email:password:remove` | POST `/password/remove` | same | `EmailPasswordRemoveRequest` → `EmailPasswordStatusView` |
|
|
50
|
+
| `password.decline` | `auth-email:password:decline` | POST `/password/decline` | same | `{}` → `EmailPasswordStatusView` |
|
|
51
|
+
| `tech.pin` | `auth-email:tech:pin` | POST `/tech/pin` | `GUARD_ED25519` + tech gate | `EmailTechPinRequest` → `EmailTechPinView` |
|
|
52
|
+
| `tech.waiver` | `auth-email:tech:waiver` | POST `/tech/waiver` | same | `{}` → `EmailTechWaiverView` |
|
|
53
|
+
| `offer` | `auth-email:offer` | screen `/login/password` | — | frontend, sticky |
|
|
54
|
+
|
|
55
|
+
The bases `base` (`auth-email:base`), `password.base` (`auth-email:password`) and `tech.base`
|
|
56
|
+
(`auth-email:tech`) carry the guards their children inherit and have no handler.
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { DEFAULT_GUARD } from '@owlmeans/auth-common'
|
|
62
|
+
import { makeEmailAuthProtocols } from '@owlmeans/auth-email'
|
|
63
|
+
|
|
64
|
+
// One tree, shared by the server and the browser.
|
|
65
|
+
export const emailAuthProtocols = makeEmailAuthProtocols({
|
|
66
|
+
guards: DEFAULT_GUARD, // the password routes need the app's session
|
|
67
|
+
gate: { alias: APP_AUTH_GATE },
|
|
68
|
+
})
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| Option | Default | Effect |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `path` / `parent` | `/auth/email` / none | where the guest base sits |
|
|
74
|
+
| `guards` + `gate` | — | the password subtree's guards; required unless `passwordParent` |
|
|
75
|
+
| `passwordParent` | the guest base | mount `/password` under an already guarded route instead |
|
|
76
|
+
| `techGuards` / `techGate` | `[GUARD_ED25519]` / `{ alias: EMAIL_AUTH_TECH_GATE }` | the tech subtree's guards |
|
|
77
|
+
| `screen` | `{ path: '/login/password' }`, top level | the offer screen |
|
|
78
|
+
|
|
79
|
+
Neither `guards` nor `passwordParent` throws a `SyntaxError` at declaration time.
|
|
80
|
+
|
|
81
|
+
## API
|
|
82
|
+
|
|
83
|
+
### Constants
|
|
84
|
+
|
|
85
|
+
| Symbol | Value |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `EMAIL_LOGIN_METHOD` | `'email'` — client plugin type and login method id |
|
|
88
|
+
| `EMAIL_PIN_AUTH_TYPE` / `EMAIL_PASSWORD_AUTH_TYPE` | `'email-pin'` / `'email-password'` — private server plugins and token types |
|
|
89
|
+
| `EMAIL_CONFIRM_ENVELOPE` / `EMAIL_WAIVER_ENVELOPE` | `'email-confirm'` / `'email-waiver'` |
|
|
90
|
+
| `EMAIL_WAIVER_HEADER` | `'x-owlmeans-email-waiver'` |
|
|
91
|
+
| `EMAIL_CAPTCHA_ACTION_PIN` / `EMAIL_CAPTCHA_ACTION_PASSWORD` | `'email_pin'` / `'email_password'` |
|
|
92
|
+
| `EMAIL_CAPTCHA_PROVIDER` | `'recaptcha-v3'` |
|
|
93
|
+
| `EMAIL_IDENTITY_TYPE` | `'email-otp'` — the identity-linking details type (equals `OTP_AUTH_TYPE`), never a token type |
|
|
94
|
+
| `EMAIL_PIN_LENGTH` / `EMAIL_PIN_PATTERN` | `6` / `'^[0-9]{6}$'` |
|
|
95
|
+
| `EMAIL_DEVICE_TTL_DAYS` / `EMAIL_DEVICE_LIMIT` / `EMAIL_DEVICE_ID_PATTERN` | `30` / `10` / `'^[A-Za-z0-9_-]{22,64}$'` |
|
|
96
|
+
| `EMAIL_OFFER_TTL_SECONDS` / `EMAIL_WAIVER_TTL_SECONDS` | `900` / `7200` |
|
|
97
|
+
| `EMAIL_PASSWORD_MIN_LENGTH` / `EMAIL_PASSWORD_MAX_LENGTH` | `8` / `128` (policy, checked by the server) |
|
|
98
|
+
| `EMAIL_ADDRESS_MAX_LENGTH`, `EMAIL_PASSWORD_WIRE_MAX_LENGTH`, `EMAIL_TOKEN_MAX_LENGTH`, `EMAIL_LOCALE_MAX_LENGTH` | `254`, `1024`, `4096`, `16` — wire bounds |
|
|
99
|
+
| `EMAIL_AUTH_LOCALES` | `['en', 'pl', 'ru', 'be', 'uk', 'es', 'de', 'fr']` (frozen) |
|
|
100
|
+
| `EmailPasswordPurpose` | `Set = 'set'`, `Change = 'change'`, `Remove = 'remove'` |
|
|
101
|
+
| `EmailSignInReason` | `Device = 'device'` |
|
|
102
|
+
| `EMAIL_AUTH_SERVICE` / `EMAIL_LOGIN_SERVICE` / `EMAIL_AUTH_TECH_GATE` | `'auth-email'` / `'auth-email-client'` / `'auth-email:tech-gate'` |
|
|
103
|
+
| `EMAIL_AUTH_API_PATH` / `EMAIL_AUTH_OFFER_PATH` | `'/auth/email'` / `'/login/password'` |
|
|
104
|
+
| `EMAIL_AUTH_*` aliases | `BASE`, `OPTIONS`, `PIN`, `SIGN_IN`, `PASSWORD`, `PASSWORD_STATUS`, `PASSWORD_PIN`, `PASSWORD_SET`, `PASSWORD_REMOVE`, `PASSWORD_DECLINE`, `TECH`, `TECH_PIN`, `TECH_WAIVER`, `OFFER` |
|
|
105
|
+
|
|
106
|
+
### Schemas
|
|
107
|
+
|
|
108
|
+
`EmailPinRequestSchema`, `EmailSignInRequestSchema`, `EmailPasswordPinRequestSchema`,
|
|
109
|
+
`EmailPasswordSetRequestSchema`, `EmailPasswordRemoveRequestSchema`, `EmailTechPinRequestSchema`,
|
|
110
|
+
`EmailEmptyRequestSchema` — every one `additionalProperties: false`; `email` is `format: 'email'`
|
|
111
|
+
up to 254 characters, `pin` six digits, `device` the device-id pattern, `password` 1–1024 characters.
|
|
112
|
+
|
|
113
|
+
### Errors
|
|
114
|
+
|
|
115
|
+
| Class | Status | Meaning |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| `EmailAuthError` | — | base, message `auth-email:<reason>` |
|
|
118
|
+
| `EmailPasswordDisabled` | 404 | passwords are not offered here |
|
|
119
|
+
| `EmailPasswordWeak` | 422 | the new password breaks the policy |
|
|
120
|
+
| `EmailOfferExpired` | 409 | the offer ticket is spent, expired or another account's |
|
|
121
|
+
| `EmailTechDisabled` | 404 | the developer routes are off |
|
|
122
|
+
| `EmailAuthUnavailable` | 503 | a store, mailer or captcha authority failed; fail closed |
|
|
123
|
+
|
|
124
|
+
A wrong PIN or password is `AuthenFailed` from `@owlmeans/auth`, never one of these.
|
|
125
|
+
|
|
126
|
+
## Common pitfalls
|
|
127
|
+
|
|
128
|
+
- Do not send `entitySlug` or `source` in a body — every schema refuses unknown fields.
|
|
129
|
+
- Trim and lowercase the address before sending it; `format: 'email'` refuses surrounding spaces.
|
|
130
|
+
- Never bind the tech routes where developer tooling is off; the server checks its flag per request.
|
|
131
|
+
|
|
132
|
+
## Related packages
|
|
133
|
+
|
|
134
|
+
- [`@owlmeans/auth-otp`](../auth-otp) — the PIN issuance and verification contract
|
|
135
|
+
- [`@owlmeans/auth-common`](../auth-common) — `GUARD_ED25519` and `signBasicEd25519Request` for the tech routes
|
|
136
|
+
- [`@owlmeans/entrypoint`](../entrypoint) / [`@owlmeans/route`](../route) — the protocol DSL
|
|
137
|
+
|
|
138
|
+
<!-- owlmeans:agent-guidance:start -->
|
|
139
|
+
## Agent guidance
|
|
140
|
+
|
|
141
|
+
This package ships embedded agent skills under `agent-meta/`. After installing your
|
|
142
|
+
`@owlmeans/*` packages, run the OwlMeans agent-skills installer to place them into
|
|
143
|
+
your project's skill store (`.agents/skills/`):
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
npx @owlmeans/agent-skills@^0.1.19-rc.0
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The embedded files are version-matched to this package release. Do not edit them
|
|
150
|
+
directly — they are regenerated on each publish. To contribute guidance edits,
|
|
151
|
+
open a PR against the source monorepo.
|
|
152
|
+
<!-- owlmeans:agent-guidance:end -->
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 3,
|
|
3
|
+
"package": "@owlmeans/auth-email",
|
|
4
|
+
"version": "0.1.19-rc.0",
|
|
5
|
+
"generatedAt": "2026-11-01T17:08:08.394Z",
|
|
6
|
+
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
|
+
"entries": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "skill",
|
|
10
|
+
"name": "auth-email",
|
|
11
|
+
"category": "package-specific",
|
|
12
|
+
"file": "skills/auth-email/SKILL.md",
|
|
13
|
+
"canonicalPath": ".agents/skills/auth-email/SKILL.md"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auth-email
|
|
3
|
+
description: How to use @owlmeans/auth-email — the runtime-free contracts of OwlMeans e-mail sign-in (a mailed PIN, an optional password, remembered devices, an optional captcha, developer tech routes). Covers makeEmailAuthProtocols and its options (guest base, guarded password subtree, Ed25519 tech subtree, the offer screen), the wire shapes and AJV schemas, the EMAIL_* constants (token types email-pin / email-password, the email-otp identity type, waiver header, captcha actions, device/offer/waiver limits) and the error family. Auto-invoked when declaring the e-mail sign-in routes of an app, importing any EMAIL_* constant, Email* view/request/schema or error, or deciding where the password routes are guarded.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# @owlmeans/auth-email
|
|
9
|
+
|
|
10
|
+
**Layer:** Auth shared (L6 — `auth`, `auth-common`, `context`, `entrypoint`, `error`, `route`; `ajv` + `ajv-formats` peers)
|
|
11
|
+
**Install:** `"@owlmeans/auth-email": "^0.1.19-rc.0"` in `dependencies`
|
|
12
|
+
**Halves:** `@owlmeans/server-auth-email` serves the routes, `@owlmeans/web-auth-email` signs a
|
|
13
|
+
person in. This package holds no behaviour — the tree, schemas, views, constants and errors both
|
|
14
|
+
sides must agree on.
|
|
15
|
+
|
|
16
|
+
## The model in one paragraph
|
|
17
|
+
|
|
18
|
+
`pin` mails a 6-digit PIN and answers a signed `challenge`, identically for a known and a new
|
|
19
|
+
address; `signIn` with `challenge` + `pin` signs the person in, registering the account on first
|
|
20
|
+
use, and remembers the device. `signIn` with `password` answers a token on a REMEMBERED device; on
|
|
21
|
+
any other device the password is NOT checked — a PIN is mailed and the answer is
|
|
22
|
+
`{ challenge, reason: 'device' }`, the same for a wrong password, a right one and no account. A PIN
|
|
23
|
+
sign-in of a person without a password who has not declined one also answers a one-use `offer`
|
|
24
|
+
ticket; `password.set` with it needs no second PIN. Later set/change/remove are confirmed by a PIN
|
|
25
|
+
from `password.pin`. No body carries `entitySlug` or `source`: the address alone decides the account.
|
|
26
|
+
|
|
27
|
+
## The tree — `makeEmailAuthProtocols(opts)`
|
|
28
|
+
|
|
29
|
+
Default base `/auth/email` (`EMAIL_AUTH_API_PATH`):
|
|
30
|
+
|
|
31
|
+
| Protocol | Method + path | Guard | Body → answer |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| `options` | GET `/options` | none | → `{ password, captcha: { provider, siteKey } \| null, pinLength }` |
|
|
34
|
+
| `pin` | POST `/pin` | none | `{ email, locale?, captcha? }` → `{ challenge }` |
|
|
35
|
+
| `signIn` | POST `/sign-in` | none | PIN `{ email, device, challenge, pin }` or password `{ email, device, password, captcha? }` → `{ token?, offer?, challenge?, reason? }` |
|
|
36
|
+
| `password.status` | GET `/password` | `opts.guards` + `opts.gate` | → `{ enabled, set, declined, updatedAt? }` |
|
|
37
|
+
| `password.pin` | POST `/password/pin` | same | `{ purpose: set\|change\|remove, locale? }` → `{ challenge }` |
|
|
38
|
+
| `password.set` | POST `/password/set` | same | `{ password, offer }` or `{ password, challenge, pin }` (+ `device?`) → status |
|
|
39
|
+
| `password.remove` | POST `/password/remove` | same | `{ challenge, pin, device? }` → status |
|
|
40
|
+
| `password.decline` | POST `/password/decline` | same | `{}` → status |
|
|
41
|
+
| `tech.pin` | POST `/tech/pin` | `opts.techGuards` + `opts.techGate` | `{ challenge, pin }` → `{ ok }` |
|
|
42
|
+
| `tech.waiver` | POST `/tech/waiver` | same | `{}` → `{ waiver, expiresAt }` |
|
|
43
|
+
| `offer` | screen `/login/password` | — | frontend, sticky: the post-sign-in "set a password" step |
|
|
44
|
+
|
|
45
|
+
The bases (`base`, `password.base`, `tech.base`) carry the guards their children inherit and have no
|
|
46
|
+
handler. Aliases are `auth-email:<name>` (`EMAIL_AUTH_*` constants).
|
|
47
|
+
|
|
48
|
+
| Option | Default | Effect |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `path` / `parent` | `/auth/email` / none | where the guest base sits — keep it UNGUARDED: a guest calls it |
|
|
51
|
+
| `guards` + `gate` | — | the password subtree's guards; required unless `passwordParent` (neither → `SyntaxError` at declaration) |
|
|
52
|
+
| `passwordParent` | the guest base | mount `/password` under an already guarded route instead |
|
|
53
|
+
| `techGuards` / `techGate` | `[GUARD_ED25519]` / `{ alias: EMAIL_AUTH_TECH_GATE }` | the developer subtree |
|
|
54
|
+
| `screen` | `{ path: '/login/password' }` | the offer screen |
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { DEFAULT_GUARD } from '@owlmeans/auth-common'
|
|
58
|
+
import { makeEmailAuthProtocols } from '@owlmeans/auth-email'
|
|
59
|
+
|
|
60
|
+
export const emailAuthProtocols = makeEmailAuthProtocols({ guards: [DEFAULT_GUARD], gate: { alias: APP_GATE } })
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Declare it as a tree of its own**, never inside an app tree whose guarding is copied onto every
|
|
64
|
+
leaf (an access-token coguard, a tree-wide gate): the guest routes must stay unguarded, and an access
|
|
65
|
+
token must never set or remove a password. Pin it to the one service that serves it. The frozen tree
|
|
66
|
+
interface has no index signature — cast it for `bindAll`, as for marketing consent.
|
|
67
|
+
|
|
68
|
+
## Constants that are contracts
|
|
69
|
+
|
|
70
|
+
| Symbol | Value | Meaning |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `EMAIL_LOGIN_METHOD` | `'email'` | client plugin type and login method id |
|
|
73
|
+
| `EMAIL_PIN_AUTH_TYPE` / `EMAIL_PASSWORD_AUTH_TYPE` | `'email-pin'` / `'email-password'` | the private server plugins and the signed token types — never `email-otp` |
|
|
74
|
+
| `EMAIL_IDENTITY_TYPE` | `'email-otp'` | the identity-LINKING details type (= `OTP_AUTH_TYPE`), so OTP and e-mail sign-in land on one account per address; never a token type |
|
|
75
|
+
| `EMAIL_CONFIRM_ENVELOPE` / `EMAIL_WAIVER_ENVELOPE` | `'email-confirm'` / `'email-waiver'` | signed envelope types |
|
|
76
|
+
| `EMAIL_WAIVER_HEADER` | `'x-owlmeans-email-waiver'` | where a developer waiver travels |
|
|
77
|
+
| `EMAIL_CAPTCHA_ACTION_PIN` / `_PASSWORD` | `'email_pin'` / `'email_password'` | the exact reCAPTCHA actions |
|
|
78
|
+
| `EMAIL_PIN_LENGTH` / `EMAIL_PIN_PATTERN` | `6` / `'^[0-9]{6}$'` | |
|
|
79
|
+
| `EMAIL_DEVICE_TTL_DAYS` / `EMAIL_DEVICE_LIMIT` / `EMAIL_DEVICE_ID_PATTERN` | `30` / `10` / `'^[A-Za-z0-9_-]{22,64}$'` | the device id is 16 random bytes, base64url |
|
|
80
|
+
| `EMAIL_OFFER_TTL_SECONDS` / `EMAIL_WAIVER_TTL_SECONDS` | `900` / `7200` | |
|
|
81
|
+
| `EMAIL_PASSWORD_MIN_LENGTH` / `_MAX_LENGTH` | `8` / `128` | policy, checked by the server; the wire admits 1–1024 |
|
|
82
|
+
| `EMAIL_AUTH_LOCALES` | `en pl ru be uk es de fr` | the built-in mail and UI languages |
|
|
83
|
+
| `EMAIL_AUTH_SERVICE` / `EMAIL_LOGIN_SERVICE` / `EMAIL_AUTH_TECH_GATE` | `'auth-email'` / `'auth-email-client'` / `'auth-email:tech-gate'` | service aliases |
|
|
84
|
+
| `EmailPasswordPurpose`, `EmailSignInReason` | `set`/`change`/`remove`; `device` | enums |
|
|
85
|
+
|
|
86
|
+
## Schemas and errors
|
|
87
|
+
|
|
88
|
+
Every request schema (`Email*RequestSchema`, `EmailEmptyRequestSchema`) is
|
|
89
|
+
`additionalProperties: false`; `email` is `format: 'email'` ≤ 254 characters — trim and lowercase it
|
|
90
|
+
before sending. A body with both modes or neither is refused by the server (`AuthUnknown`, 400).
|
|
91
|
+
|
|
92
|
+
| Class | Status | Meaning |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| `EmailAuthError` | — | base, message `auth-email:<reason>` |
|
|
95
|
+
| `EmailPasswordDisabled` | 404 | passwords are not offered here |
|
|
96
|
+
| `EmailPasswordWeak` | 422 | the new password breaks the policy |
|
|
97
|
+
| `EmailOfferExpired` | 409 | the offer ticket is spent, expired or another account's |
|
|
98
|
+
| `EmailTechDisabled` | 404 | the developer routes are off |
|
|
99
|
+
| `EmailAuthUnavailable` | 503 | a store, mailer or captcha authority failed — fail closed |
|
|
100
|
+
|
|
101
|
+
A wrong PIN, password or captcha is an `AuthenFailed` from `@owlmeans/auth` (the server's
|
|
102
|
+
`EmailCredentialRefused` 401 / `EmailVerificationRefused` 403), never one of these.
|
|
103
|
+
|
|
104
|
+
## Related
|
|
105
|
+
|
|
106
|
+
`server-auth-email` · `web-auth-email` · `server-auth-otp` (the PIN store and its five attempts) ·
|
|
107
|
+
`captcha` · `marketing-consent` (the same tree + screen + step pattern)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** The client `AuthenticationPlugin` type and the login method id of e-mail sign-in. */
|
|
2
|
+
export declare const EMAIL_LOGIN_METHOD = "email";
|
|
3
|
+
/** The private server plugin of a PIN sign-in, and the type its signed token carries. */
|
|
4
|
+
export declare const EMAIL_PIN_AUTH_TYPE = "email-pin";
|
|
5
|
+
/** The private server plugin of a password sign-in, and the type its signed token carries. */
|
|
6
|
+
export declare const EMAIL_PASSWORD_AUTH_TYPE = "email-password";
|
|
7
|
+
/** A purpose-bound confirmation challenge (set, change or remove a password). */
|
|
8
|
+
export declare const EMAIL_CONFIRM_ENVELOPE = "email-confirm";
|
|
9
|
+
/** A developer's captcha and throttle waiver. */
|
|
10
|
+
export declare const EMAIL_WAIVER_ENVELOPE = "email-waiver";
|
|
11
|
+
/** The request header that carries an `EMAIL_WAIVER_ENVELOPE`. */
|
|
12
|
+
export declare const EMAIL_WAIVER_HEADER = "x-owlmeans-email-waiver";
|
|
13
|
+
/** The captcha action of a send-PIN request. */
|
|
14
|
+
export declare const EMAIL_CAPTCHA_ACTION_PIN = "email_pin";
|
|
15
|
+
/** The captcha action of a password sign-in. */
|
|
16
|
+
export declare const EMAIL_CAPTCHA_ACTION_PASSWORD = "email_password";
|
|
17
|
+
/**
|
|
18
|
+
* The identity-linking details type of an account's e-mail credential — the same value as
|
|
19
|
+
* `OTP_AUTH_TYPE` (`@owlmeans/auth-otp`), so e-mail sign-in and e-mail OTP land on one account.
|
|
20
|
+
* It names a credential, never a token type.
|
|
21
|
+
*/
|
|
22
|
+
export declare const EMAIL_IDENTITY_TYPE = "email-otp";
|
|
23
|
+
/** The captcha provider an options view may name. */
|
|
24
|
+
export declare const EMAIL_CAPTCHA_PROVIDER = "recaptcha-v3";
|
|
25
|
+
/** Digits in a PIN — the same as `OTP_CODE_LENGTH` (`@owlmeans/auth-otp`). */
|
|
26
|
+
export declare const EMAIL_PIN_LENGTH = 6;
|
|
27
|
+
export declare const EMAIL_PIN_PATTERN = "^[0-9]{6}$";
|
|
28
|
+
/** How long a device stays remembered after a successful sign-in on it. */
|
|
29
|
+
export declare const EMAIL_DEVICE_TTL_DAYS = 30;
|
|
30
|
+
/** Remembered devices per account; the oldest beyond it are forgotten. */
|
|
31
|
+
export declare const EMAIL_DEVICE_LIMIT = 10;
|
|
32
|
+
/** A device id: 22 base64url characters (16 random bytes) from the client, up to 64 accepted. */
|
|
33
|
+
export declare const EMAIL_DEVICE_ID_PATTERN = "^[A-Za-z0-9_-]{22,64}$";
|
|
34
|
+
/** Lifetime of the one-use "set a password" offer ticket a PIN sign-in returns. */
|
|
35
|
+
export declare const EMAIL_OFFER_TTL_SECONDS = 900;
|
|
36
|
+
/** Lifetime of a developer waiver. */
|
|
37
|
+
export declare const EMAIL_WAIVER_TTL_SECONDS = 7200;
|
|
38
|
+
export declare const EMAIL_PASSWORD_MIN_LENGTH = 8;
|
|
39
|
+
export declare const EMAIL_PASSWORD_MAX_LENGTH = 128;
|
|
40
|
+
/** Wire bounds of the request fields (the password policy above is checked by the server). */
|
|
41
|
+
export declare const EMAIL_ADDRESS_MAX_LENGTH = 254;
|
|
42
|
+
export declare const EMAIL_PASSWORD_WIRE_MAX_LENGTH = 1024;
|
|
43
|
+
export declare const EMAIL_TOKEN_MAX_LENGTH = 4096;
|
|
44
|
+
export declare const EMAIL_LOCALE_MAX_LENGTH = 16;
|
|
45
|
+
/** The languages the sign-in mails are written in; any other locale falls back to `en`. */
|
|
46
|
+
export declare const EMAIL_AUTH_LOCALES: readonly ["en", "pl", "ru", "be", "uk", "es", "de", "fr"];
|
|
47
|
+
export declare enum EmailPasswordPurpose {
|
|
48
|
+
Set = "set",
|
|
49
|
+
Change = "change",
|
|
50
|
+
Remove = "remove"
|
|
51
|
+
}
|
|
52
|
+
export declare enum EmailSignInReason {
|
|
53
|
+
/** The password was not checked: the device is unknown, so a PIN was mailed instead. */
|
|
54
|
+
Device = "device"
|
|
55
|
+
}
|
|
56
|
+
/** The server service alias. */
|
|
57
|
+
export declare const EMAIL_AUTH_SERVICE = "auth-email";
|
|
58
|
+
/** The client service alias. */
|
|
59
|
+
export declare const EMAIL_LOGIN_SERVICE = "auth-email-client";
|
|
60
|
+
/** The gate service standing over the developer (tech) routes. */
|
|
61
|
+
export declare const EMAIL_AUTH_TECH_GATE = "auth-email:tech-gate";
|
|
62
|
+
export declare const EMAIL_AUTH_API_PATH = "/auth/email";
|
|
63
|
+
export declare const EMAIL_AUTH_OFFER_PATH = "/login/password";
|
|
64
|
+
export declare const EMAIL_AUTH_BASE = "auth-email:base";
|
|
65
|
+
export declare const EMAIL_AUTH_OPTIONS = "auth-email:options";
|
|
66
|
+
export declare const EMAIL_AUTH_PIN = "auth-email:pin";
|
|
67
|
+
export declare const EMAIL_AUTH_SIGN_IN = "auth-email:sign-in";
|
|
68
|
+
export declare const EMAIL_AUTH_PASSWORD = "auth-email:password";
|
|
69
|
+
export declare const EMAIL_AUTH_PASSWORD_STATUS = "auth-email:password:status";
|
|
70
|
+
export declare const EMAIL_AUTH_PASSWORD_PIN = "auth-email:password:pin";
|
|
71
|
+
export declare const EMAIL_AUTH_PASSWORD_SET = "auth-email:password:set";
|
|
72
|
+
export declare const EMAIL_AUTH_PASSWORD_REMOVE = "auth-email:password:remove";
|
|
73
|
+
export declare const EMAIL_AUTH_PASSWORD_DECLINE = "auth-email:password:decline";
|
|
74
|
+
export declare const EMAIL_AUTH_TECH = "auth-email:tech";
|
|
75
|
+
export declare const EMAIL_AUTH_TECH_PIN = "auth-email:tech:pin";
|
|
76
|
+
export declare const EMAIL_AUTH_TECH_WAIVER = "auth-email:tech:waiver";
|
|
77
|
+
export declare const EMAIL_AUTH_OFFER = "auth-email:offer";
|
|
78
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,UAAU,CAAA;AAEzC,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,cAAc,CAAA;AAE9C,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,mBAAmB,CAAA;AAExD,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,kBAAkB,CAAA;AAErD,iDAAiD;AACjD,eAAO,MAAM,qBAAqB,iBAAiB,CAAA;AAEnD,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,4BAA4B,CAAA;AAE5D,gDAAgD;AAChD,eAAO,MAAM,wBAAwB,cAAc,CAAA;AAEnD,gDAAgD;AAChD,eAAO,MAAM,6BAA6B,mBAAmB,CAAA;AAE7D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,cAAc,CAAA;AAE9C,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,iBAAiB,CAAA;AAIpD,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,IAAI,CAAA;AACjC,eAAO,MAAM,iBAAiB,eAAe,CAAA;AAE7C,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,KAAK,CAAA;AACvC,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,KAAK,CAAA;AACpC,iGAAiG;AACjG,eAAO,MAAM,uBAAuB,2BAA2B,CAAA;AAE/D,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAC1C,sCAAsC;AACtC,eAAO,MAAM,wBAAwB,OAAO,CAAA;AAE5C,eAAO,MAAM,yBAAyB,IAAI,CAAA;AAC1C,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAE5C,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAC3C,eAAO,MAAM,8BAA8B,OAAO,CAAA;AAClD,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAC1C,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAEzC,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,2DAA2E,CAAA;AAE1G,oBAAY,oBAAoB;IAC9B,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,iBAAiB;IAC3B,wFAAwF;IACxF,MAAM,WAAW;CAClB;AAID,gCAAgC;AAChC,eAAO,MAAM,kBAAkB,eAAe,CAAA;AAC9C,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,sBAAsB,CAAA;AACtD,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAI1D,eAAO,MAAM,mBAAmB,gBAAgB,CAAA;AAChD,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAItD,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,cAAc,mBAAmB,CAAA;AAC9C,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AACxD,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAChE,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAChE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,2BAA2B,gCAAgC,CAAA;AACxE,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AACxD,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,gBAAgB,qBAAqB,CAAA"}
|
package/build/consts.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// --- Methods, auth types and envelopes ---------------------------------------------------------
|
|
2
|
+
/** The client `AuthenticationPlugin` type and the login method id of e-mail sign-in. */
|
|
3
|
+
export const EMAIL_LOGIN_METHOD = 'email';
|
|
4
|
+
/** The private server plugin of a PIN sign-in, and the type its signed token carries. */
|
|
5
|
+
export const EMAIL_PIN_AUTH_TYPE = 'email-pin';
|
|
6
|
+
/** The private server plugin of a password sign-in, and the type its signed token carries. */
|
|
7
|
+
export const EMAIL_PASSWORD_AUTH_TYPE = 'email-password';
|
|
8
|
+
/** A purpose-bound confirmation challenge (set, change or remove a password). */
|
|
9
|
+
export const EMAIL_CONFIRM_ENVELOPE = 'email-confirm';
|
|
10
|
+
/** A developer's captcha and throttle waiver. */
|
|
11
|
+
export const EMAIL_WAIVER_ENVELOPE = 'email-waiver';
|
|
12
|
+
/** The request header that carries an `EMAIL_WAIVER_ENVELOPE`. */
|
|
13
|
+
export const EMAIL_WAIVER_HEADER = 'x-owlmeans-email-waiver';
|
|
14
|
+
/** The captcha action of a send-PIN request. */
|
|
15
|
+
export const EMAIL_CAPTCHA_ACTION_PIN = 'email_pin';
|
|
16
|
+
/** The captcha action of a password sign-in. */
|
|
17
|
+
export const EMAIL_CAPTCHA_ACTION_PASSWORD = 'email_password';
|
|
18
|
+
/**
|
|
19
|
+
* The identity-linking details type of an account's e-mail credential — the same value as
|
|
20
|
+
* `OTP_AUTH_TYPE` (`@owlmeans/auth-otp`), so e-mail sign-in and e-mail OTP land on one account.
|
|
21
|
+
* It names a credential, never a token type.
|
|
22
|
+
*/
|
|
23
|
+
export const EMAIL_IDENTITY_TYPE = 'email-otp';
|
|
24
|
+
/** The captcha provider an options view may name. */
|
|
25
|
+
export const EMAIL_CAPTCHA_PROVIDER = 'recaptcha-v3';
|
|
26
|
+
// --- Policy ------------------------------------------------------------------------------------
|
|
27
|
+
/** Digits in a PIN — the same as `OTP_CODE_LENGTH` (`@owlmeans/auth-otp`). */
|
|
28
|
+
export const EMAIL_PIN_LENGTH = 6;
|
|
29
|
+
export const EMAIL_PIN_PATTERN = '^[0-9]{6}$';
|
|
30
|
+
/** How long a device stays remembered after a successful sign-in on it. */
|
|
31
|
+
export const EMAIL_DEVICE_TTL_DAYS = 30;
|
|
32
|
+
/** Remembered devices per account; the oldest beyond it are forgotten. */
|
|
33
|
+
export const EMAIL_DEVICE_LIMIT = 10;
|
|
34
|
+
/** A device id: 22 base64url characters (16 random bytes) from the client, up to 64 accepted. */
|
|
35
|
+
export const EMAIL_DEVICE_ID_PATTERN = '^[A-Za-z0-9_-]{22,64}$';
|
|
36
|
+
/** Lifetime of the one-use "set a password" offer ticket a PIN sign-in returns. */
|
|
37
|
+
export const EMAIL_OFFER_TTL_SECONDS = 900;
|
|
38
|
+
/** Lifetime of a developer waiver. */
|
|
39
|
+
export const EMAIL_WAIVER_TTL_SECONDS = 7200;
|
|
40
|
+
export const EMAIL_PASSWORD_MIN_LENGTH = 8;
|
|
41
|
+
export const EMAIL_PASSWORD_MAX_LENGTH = 128;
|
|
42
|
+
/** Wire bounds of the request fields (the password policy above is checked by the server). */
|
|
43
|
+
export const EMAIL_ADDRESS_MAX_LENGTH = 254;
|
|
44
|
+
export const EMAIL_PASSWORD_WIRE_MAX_LENGTH = 1024;
|
|
45
|
+
export const EMAIL_TOKEN_MAX_LENGTH = 4096;
|
|
46
|
+
export const EMAIL_LOCALE_MAX_LENGTH = 16;
|
|
47
|
+
/** The languages the sign-in mails are written in; any other locale falls back to `en`. */
|
|
48
|
+
export const EMAIL_AUTH_LOCALES = Object.freeze(['en', 'pl', 'ru', 'be', 'uk', 'es', 'de', 'fr']);
|
|
49
|
+
export var EmailPasswordPurpose;
|
|
50
|
+
(function (EmailPasswordPurpose) {
|
|
51
|
+
EmailPasswordPurpose["Set"] = "set";
|
|
52
|
+
EmailPasswordPurpose["Change"] = "change";
|
|
53
|
+
EmailPasswordPurpose["Remove"] = "remove";
|
|
54
|
+
})(EmailPasswordPurpose || (EmailPasswordPurpose = {}));
|
|
55
|
+
export var EmailSignInReason;
|
|
56
|
+
(function (EmailSignInReason) {
|
|
57
|
+
/** The password was not checked: the device is unknown, so a PIN was mailed instead. */
|
|
58
|
+
EmailSignInReason["Device"] = "device";
|
|
59
|
+
})(EmailSignInReason || (EmailSignInReason = {}));
|
|
60
|
+
// --- Service aliases ---------------------------------------------------------------------------
|
|
61
|
+
/** The server service alias. */
|
|
62
|
+
export const EMAIL_AUTH_SERVICE = 'auth-email';
|
|
63
|
+
/** The client service alias. */
|
|
64
|
+
export const EMAIL_LOGIN_SERVICE = 'auth-email-client';
|
|
65
|
+
/** The gate service standing over the developer (tech) routes. */
|
|
66
|
+
export const EMAIL_AUTH_TECH_GATE = 'auth-email:tech-gate';
|
|
67
|
+
// --- Paths -------------------------------------------------------------------------------------
|
|
68
|
+
export const EMAIL_AUTH_API_PATH = '/auth/email';
|
|
69
|
+
export const EMAIL_AUTH_OFFER_PATH = '/login/password';
|
|
70
|
+
// --- Protocol tree aliases ---------------------------------------------------------------------
|
|
71
|
+
export const EMAIL_AUTH_BASE = 'auth-email:base';
|
|
72
|
+
export const EMAIL_AUTH_OPTIONS = 'auth-email:options';
|
|
73
|
+
export const EMAIL_AUTH_PIN = 'auth-email:pin';
|
|
74
|
+
export const EMAIL_AUTH_SIGN_IN = 'auth-email:sign-in';
|
|
75
|
+
export const EMAIL_AUTH_PASSWORD = 'auth-email:password';
|
|
76
|
+
export const EMAIL_AUTH_PASSWORD_STATUS = 'auth-email:password:status';
|
|
77
|
+
export const EMAIL_AUTH_PASSWORD_PIN = 'auth-email:password:pin';
|
|
78
|
+
export const EMAIL_AUTH_PASSWORD_SET = 'auth-email:password:set';
|
|
79
|
+
export const EMAIL_AUTH_PASSWORD_REMOVE = 'auth-email:password:remove';
|
|
80
|
+
export const EMAIL_AUTH_PASSWORD_DECLINE = 'auth-email:password:decline';
|
|
81
|
+
export const EMAIL_AUTH_TECH = 'auth-email:tech';
|
|
82
|
+
export const EMAIL_AUTH_TECH_PIN = 'auth-email:tech:pin';
|
|
83
|
+
export const EMAIL_AUTH_TECH_WAIVER = 'auth-email:tech:waiver';
|
|
84
|
+
export const EMAIL_AUTH_OFFER = 'auth-email:offer';
|
|
85
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAElG,wFAAwF;AACxF,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAEzC,yFAAyF;AACzF,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAA;AAE9C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CAAA;AAExD,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAA;AAErD,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAA;AAEnD,kEAAkE;AAClE,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAA;AAE5D,gDAAgD;AAChD,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAA;AAEnD,gDAAgD;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG,gBAAgB,CAAA;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAA;AAE9C,qDAAqD;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAEpD,kGAAkG;AAElG,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA;AACjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAA;AAE7C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AACvC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AACpC,iGAAiG;AACjG,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAA;AAE/D,mFAAmF;AACn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,qBAAqB,GAAG,iBAAiB,CAAA;AAEtD,kGAAkG;AAElG,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAA;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAA;AACtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAA;AACtE,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAA;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EmailAuthEntrypointOptions, EmailAuthEntrypoints } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The e-mail sign-in surface:
|
|
4
|
+
*
|
|
5
|
+
* - the guest base (`opts.path`, default `/auth/email`, under `opts.parent`) carries NO guards —
|
|
6
|
+
* `options` GET `/options`, `pin` POST `/pin`, `signIn` POST `/sign-in`;
|
|
7
|
+
* - `password` (`/password`, under the guest base or `opts.passwordParent`) acts on the caller's own
|
|
8
|
+
* account, so it needs the application's session: `opts.guards` (+ `opts.gate`) or a guarded
|
|
9
|
+
* `opts.passwordParent` — neither is a declaration error, not a runtime one. `status` GET `/`,
|
|
10
|
+
* `pin` POST `/pin`, `set` POST `/set`, `remove` POST `/remove`, `decline` POST `/decline`;
|
|
11
|
+
* - `tech` (`/tech`, developer tooling) defaults to `GUARD_ED25519` + the `EMAIL_AUTH_TECH_GATE`
|
|
12
|
+
* gate: `pin` POST `/pin`, `waiver` POST `/waiver`;
|
|
13
|
+
* - `offer`, the top-level sticky frontend screen of the post-sign-in password offer.
|
|
14
|
+
*/
|
|
15
|
+
export declare const makeEmailAuthProtocols: (opts?: EmailAuthEntrypointOptions) => EmailAuthEntrypoints;
|
|
16
|
+
//# sourceMappingURL=entrypoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,0BAA0B,EAAE,oBAAoB,EAGjD,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,UAAU,0BAA0B,KAAQ,oBAmF9E,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint';
|
|
2
|
+
import { backend, frontend, route, RouteMethod } from '@owlmeans/route';
|
|
3
|
+
import { GUARD_ED25519 } from '@owlmeans/auth-common';
|
|
4
|
+
import { EMAIL_AUTH_API_PATH, EMAIL_AUTH_BASE, EMAIL_AUTH_OFFER, EMAIL_AUTH_OFFER_PATH, EMAIL_AUTH_OPTIONS, EMAIL_AUTH_PASSWORD, EMAIL_AUTH_PASSWORD_DECLINE, EMAIL_AUTH_PASSWORD_PIN, EMAIL_AUTH_PASSWORD_REMOVE, EMAIL_AUTH_PASSWORD_SET, EMAIL_AUTH_PASSWORD_STATUS, EMAIL_AUTH_PIN, EMAIL_AUTH_SIGN_IN, EMAIL_AUTH_TECH, EMAIL_AUTH_TECH_GATE, EMAIL_AUTH_TECH_PIN, EMAIL_AUTH_TECH_WAIVER, } from './consts.js';
|
|
5
|
+
import { EmailEmptyRequestSchema, EmailPasswordPinRequestSchema, EmailPasswordRemoveRequestSchema, EmailPasswordSetRequestSchema, EmailPinRequestSchema, EmailSignInRequestSchema, EmailTechPinRequestSchema, } from './schemas.js';
|
|
6
|
+
/**
|
|
7
|
+
* The e-mail sign-in surface:
|
|
8
|
+
*
|
|
9
|
+
* - the guest base (`opts.path`, default `/auth/email`, under `opts.parent`) carries NO guards —
|
|
10
|
+
* `options` GET `/options`, `pin` POST `/pin`, `signIn` POST `/sign-in`;
|
|
11
|
+
* - `password` (`/password`, under the guest base or `opts.passwordParent`) acts on the caller's own
|
|
12
|
+
* account, so it needs the application's session: `opts.guards` (+ `opts.gate`) or a guarded
|
|
13
|
+
* `opts.passwordParent` — neither is a declaration error, not a runtime one. `status` GET `/`,
|
|
14
|
+
* `pin` POST `/pin`, `set` POST `/set`, `remove` POST `/remove`, `decline` POST `/decline`;
|
|
15
|
+
* - `tech` (`/tech`, developer tooling) defaults to `GUARD_ED25519` + the `EMAIL_AUTH_TECH_GATE`
|
|
16
|
+
* gate: `pin` POST `/pin`, `waiver` POST `/waiver`;
|
|
17
|
+
* - `offer`, the top-level sticky frontend screen of the post-sign-in password offer.
|
|
18
|
+
*/
|
|
19
|
+
export const makeEmailAuthProtocols = (opts = {}) => {
|
|
20
|
+
if (opts.passwordParent == null && opts.guards == null) {
|
|
21
|
+
throw new SyntaxError('auth-email: the password routes need either a passwordParent or explicit guards');
|
|
22
|
+
}
|
|
23
|
+
const get = (alias, path, parent) => route(alias, path, backend({ parent, method: RouteMethod.GET }));
|
|
24
|
+
const post = (alias, path, parent) => route(alias, path, backend({ parent, method: RouteMethod.POST }));
|
|
25
|
+
const base = openProtocol(route(EMAIL_AUTH_BASE, opts.path ?? EMAIL_AUTH_API_PATH, backend({ parent: opts.parent })));
|
|
26
|
+
const passwordOptions = {
|
|
27
|
+
...(opts.guards != null ? { guards: opts.guards } : {}),
|
|
28
|
+
...(opts.gate != null ? { gate: opts.gate } : {}),
|
|
29
|
+
};
|
|
30
|
+
const passwordBase = openProtocol(route(EMAIL_AUTH_PASSWORD, '/password', backend({ parent: opts.passwordParent ?? base })), passwordOptions);
|
|
31
|
+
const techBase = openProtocol(route(EMAIL_AUTH_TECH, '/tech', backend({ parent: base })), {
|
|
32
|
+
guards: opts.techGuards ?? [GUARD_ED25519],
|
|
33
|
+
gate: opts.techGate ?? { alias: EMAIL_AUTH_TECH_GATE },
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
base,
|
|
37
|
+
options: protocol(get(EMAIL_AUTH_OPTIONS, '/options', base), contract(typed())),
|
|
38
|
+
pin: protocol(post(EMAIL_AUTH_PIN, '/pin', base), contract.request({ body: typed(EmailPinRequestSchema) }, typed())),
|
|
39
|
+
signIn: protocol(post(EMAIL_AUTH_SIGN_IN, '/sign-in', base), contract.request({ body: typed(EmailSignInRequestSchema) }, typed())),
|
|
40
|
+
password: {
|
|
41
|
+
base: passwordBase,
|
|
42
|
+
status: protocol(get(EMAIL_AUTH_PASSWORD_STATUS, '/', passwordBase), contract(typed())),
|
|
43
|
+
pin: protocol(post(EMAIL_AUTH_PASSWORD_PIN, '/pin', passwordBase), contract.request({ body: typed(EmailPasswordPinRequestSchema) }, typed())),
|
|
44
|
+
set: protocol(post(EMAIL_AUTH_PASSWORD_SET, '/set', passwordBase), contract.request({ body: typed(EmailPasswordSetRequestSchema) }, typed())),
|
|
45
|
+
remove: protocol(post(EMAIL_AUTH_PASSWORD_REMOVE, '/remove', passwordBase), contract.request({ body: typed(EmailPasswordRemoveRequestSchema) }, typed())),
|
|
46
|
+
decline: protocol(post(EMAIL_AUTH_PASSWORD_DECLINE, '/decline', passwordBase), contract.request({ body: typed(EmailEmptyRequestSchema) }, typed())),
|
|
47
|
+
},
|
|
48
|
+
tech: {
|
|
49
|
+
base: techBase,
|
|
50
|
+
pin: protocol(post(EMAIL_AUTH_TECH_PIN, '/pin', techBase), contract.request({ body: typed(EmailTechPinRequestSchema) }, typed())),
|
|
51
|
+
waiver: protocol(post(EMAIL_AUTH_TECH_WAIVER, '/waiver', techBase), contract.request({ body: typed(EmailEmptyRequestSchema) }, typed())),
|
|
52
|
+
},
|
|
53
|
+
// A top-level frontend screen, `sticky` so the router keeps it regardless of `cfg.service`
|
|
54
|
+
// filtering — the same shape as marketing consent's screen.
|
|
55
|
+
offer: openProtocol(route(EMAIL_AUTH_OFFER, opts.screen?.path ?? EMAIL_AUTH_OFFER_PATH, frontend({ parent: opts.screen?.parent })), { sticky: true }),
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=entrypoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EACL,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,kBAAkB,EACjG,mBAAmB,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,0BAA0B,EACrG,uBAAuB,EAAE,0BAA0B,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EACxG,oBAAoB,EAAE,mBAAmB,EAAE,sBAAsB,GAClE,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,uBAAuB,EAAE,6BAA6B,EAAE,gCAAgC,EACxF,6BAA6B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,yBAAyB,GAC1G,MAAM,cAAc,CAAA;AAOrB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAI,GAA+B,EAAE,EAAwB,EAAE;IACpG,I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ACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ResilientError } from '@owlmeans/error';
|
|
2
|
+
/**
|
|
3
|
+
* The e-mail sign-in error family, shared by the server that throws and the client that reads it
|
|
4
|
+
* back (each class is registered, so it survives the wire). A failed PIN or password check is
|
|
5
|
+
* `AuthenFailed` from `@owlmeans/auth`, never one of these: no answer here may tell an unknown
|
|
6
|
+
* address from a wrong credential.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EmailAuthError extends ResilientError {
|
|
9
|
+
static typeName: string;
|
|
10
|
+
constructor(message?: string);
|
|
11
|
+
}
|
|
12
|
+
/** A password sign-in or a password route on a deployment that does not offer passwords. */
|
|
13
|
+
export declare class EmailPasswordDisabled extends EmailAuthError {
|
|
14
|
+
static typeName: string;
|
|
15
|
+
static httpStatus: number;
|
|
16
|
+
constructor(message?: string);
|
|
17
|
+
}
|
|
18
|
+
/** A new password the policy refuses (length bounds); the message names the rule. */
|
|
19
|
+
export declare class EmailPasswordWeak extends EmailAuthError {
|
|
20
|
+
static typeName: string;
|
|
21
|
+
static httpStatus: number;
|
|
22
|
+
constructor(message?: string);
|
|
23
|
+
}
|
|
24
|
+
/** The one-use offer ticket is spent, expired or another account's — confirm with a PIN instead. */
|
|
25
|
+
export declare class EmailOfferExpired extends EmailAuthError {
|
|
26
|
+
static typeName: string;
|
|
27
|
+
static httpStatus: number;
|
|
28
|
+
constructor(message?: string);
|
|
29
|
+
}
|
|
30
|
+
/** A developer (tech) route on a deployment where they are off: answers as if it did not exist. */
|
|
31
|
+
export declare class EmailTechDisabled extends EmailAuthError {
|
|
32
|
+
static typeName: string;
|
|
33
|
+
static httpStatus: number;
|
|
34
|
+
constructor(message?: string);
|
|
35
|
+
}
|
|
36
|
+
/** A store, mailer or captcha authority could not be consulted, so the request fails closed. */
|
|
37
|
+
export declare class EmailAuthUnavailable extends EmailAuthError {
|
|
38
|
+
static typeName: string;
|
|
39
|
+
static httpStatus: number;
|
|
40
|
+
static allowServerErrorStatus: boolean;
|
|
41
|
+
constructor(message?: string);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,cAAc;IAChD,OAAuB,QAAQ,EAAE,MAAM,CAAmB;IAE1D,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,4FAA4F;AAC5F,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,OAAuB,QAAQ,EAAE,MAAM,CAA+C;IACtF,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAmB,EAGvC;CACF;AAED,qFAAqF;AACrF,qBAAa,iBAAkB,SAAQ,cAAc;IACnD,OAAuB,QAAQ,EAAE,MAAM,CAA2C;IAClF,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAiB,EAGrC;CACF;AAED,oGAAoG;AACpG,qBAAa,iBAAkB,SAAQ,cAAc;IACnD,OAAuB,QAAQ,EAAE,MAAM,CAA2C;IAClF,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,mGAAmG;AACnG,qBAAa,iBAAkB,SAAQ,cAAc;IACnD,OAAuB,QAAQ,EAAE,MAAM,CAA2C;IAClF,OAAc,UAAU,SAAM;IAE9B,YAAY,OAAO,GAAE,MAAe,EAGnC;CACF;AAED,gGAAgG;AAChG,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,OAAuB,QAAQ,EAAE,MAAM,CAA0C;IACjF,OAAc,UAAU,SAAM;IAC9B,OAAc,sBAAsB,UAAO;IAE3C,YAAY,OAAO,GAAE,MAAsB,EAG1C;CACF"}
|