@aooth/auth-moost 0.1.85 → 0.2.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/dist/atscript/index.d.mts +42 -27
- package/dist/atscript/index.mjs +2 -2
- package/dist/{forms-B9-r2zT5.mjs → forms-C9Wey0e9.mjs} +14 -4
- package/dist/index.d.mts +358 -24
- package/dist/index.mjs +801 -330
- package/package.json +5 -5
- package/src/atscript/models/forms.as +26 -6
- package/src/atscript/models/forms.as.d.ts +42 -26
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Mate, TConsoleBase, TInterceptorDef, TMateParamMeta, TMoostMetadata } from "moost";
|
|
2
|
-
import { AuthContext, AuthContext as AuthContext$1, AuthCredential, AuthEmailEvent, AuthEmailKind, AuthEmailKind as AuthEmailKind$1, AuthSmsEvent, AuthSmsKind, BuildMagicLinkUrl, BuildMagicLinkUrl as BuildMagicLinkUrl$1, CredentialMetadata, EmailSender, EmailSender as EmailSender$1, EnrichedSession, EnrichedSession as EnrichedSession$1, IssueResult, IssueResult as IssueResult$1, RateLimitDecision, RateLimitDecision as RateLimitDecision$1, RateLimitRule, RateLimitRule as RateLimitRule$1, RateLimitRuleInput, RateLimitRuleInput as RateLimitRuleInput$1, RateLimitStore, RateLimitStoreMemory, RateLimiter, RateLimiter as RateLimiter$1, RateLimiterOptions, SessionEnricher, SessionEnricher as SessionEnricher$1, SessionInfo, SessionInfo as SessionInfo$1, SmsSender, generateMagicLinkToken } from "@aooth/auth";
|
|
2
|
+
import { AuthContext, AuthContext as AuthContext$1, AuthCredential, AuthEmailEvent, AuthEmailKind, AuthEmailKind as AuthEmailKind$1, AuthSmsEvent, AuthSmsKind, BuildMagicLinkUrl, BuildMagicLinkUrl as BuildMagicLinkUrl$1, CredentialMetadata, EmailSender, EmailSender as EmailSender$1, EnrichedSession, EnrichedSession as EnrichedSession$1, IssueResult, IssueResult as IssueResult$1, RateLimitDecision, RateLimitDecision as RateLimitDecision$1, RateLimitRule, RateLimitRule as RateLimitRule$1, RateLimitRuleInput, RateLimitRuleInput as RateLimitRuleInput$1, RateLimitStore, RateLimitStore as RateLimitStore$1, RateLimitStoreMemory, RateLimiter, RateLimiter as RateLimiter$1, RateLimiterOptions, SessionEnricher, SessionEnricher as SessionEnricher$1, SessionInfo, SessionInfo as SessionInfo$1, SmsSender, generateMagicLinkToken } from "@aooth/auth";
|
|
3
3
|
import { EventContext } from "@wooksjs/event-core";
|
|
4
4
|
import { TCookieAttributesInput } from "@wooksjs/event-http";
|
|
5
5
|
import { FederatedIdentityStore, FederatedProfileSnapshot, MfaMethod, TransferablePolicy, TrustedDeviceRecord, UserCredentials, UserService } from "@aooth/user";
|
|
6
|
+
import { HttpError as HttpError$1 } from "@moostjs/event-http";
|
|
6
7
|
import { FinishWfOpts, WfFinished, useAtscriptWf } from "@atscript/moost-wf";
|
|
7
8
|
import { MoostWf, WfOutlet, WfOutletTokenConfig, WfStateStrategy } from "@moostjs/event-wf";
|
|
8
9
|
import { FederatedLoginService, NormalizedProfile, OAuthProviderRegistry } from "@aooth/idp";
|
|
@@ -17,6 +18,15 @@ interface ResolvedAuthCookieConfig {
|
|
|
17
18
|
httpOnly: boolean;
|
|
18
19
|
path: string;
|
|
19
20
|
domain?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Keep the cookie across browser restarts: `Max-Age` follows the token it
|
|
23
|
+
* carries (access / refresh expiry) and is renewed on every rotation.
|
|
24
|
+
* Default `false` — a session cookie (gone when the browser closes). Not
|
|
25
|
+
* inherited by the refresh cookie: set it on `refreshCookie` for a
|
|
26
|
+
* "stay signed in" device (the access cookie can stay session-only — a
|
|
27
|
+
* missing one is silently refreshed).
|
|
28
|
+
*/
|
|
29
|
+
persistent: boolean;
|
|
20
30
|
}
|
|
21
31
|
interface AuthOptions {
|
|
22
32
|
cookie?: Partial<ResolvedAuthCookieConfig>;
|
|
@@ -30,6 +40,15 @@ interface AuthOptions {
|
|
|
30
40
|
enableCookie?: boolean;
|
|
31
41
|
/** Read the session token from `Authorization: Bearer ...`. Default: `true`. */
|
|
32
42
|
enableBearer?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Return `accessToken` / `refreshToken` in JSON bodies (login finish,
|
|
45
|
+
* `POST /auth/refresh`). Default: `!enableCookie` — a cookie app keeps token
|
|
46
|
+
* material out of reach of page scripts, so an XSS cannot read a fresh
|
|
47
|
+
* refresh token from `/auth/refresh`. Set `true` for token clients (CLI,
|
|
48
|
+
* mobile) that share the cookie deployment; accepting `Authorization: Bearer`
|
|
49
|
+
* on requests is controlled separately by {@link enableBearer}.
|
|
50
|
+
*/
|
|
51
|
+
exposeTokensInBody?: boolean;
|
|
33
52
|
}
|
|
34
53
|
/**
|
|
35
54
|
* Fully-resolved options carried by `authGuardInterceptor(opts)` through the
|
|
@@ -46,6 +65,7 @@ interface ResolvedAuthOptions {
|
|
|
46
65
|
refreshCookie: ResolvedAuthCookieConfig;
|
|
47
66
|
enableCookie: boolean;
|
|
48
67
|
enableBearer: boolean;
|
|
68
|
+
exposeTokensInBody: boolean;
|
|
49
69
|
}
|
|
50
70
|
//#endregion
|
|
51
71
|
//#region src/consent.store.d.ts
|
|
@@ -213,9 +233,10 @@ interface AuthLogoutBody {
|
|
|
213
233
|
* POST /auth/refresh response body. Also returned by workflow finalize steps
|
|
214
234
|
* (e.g. `AuthWorkflow`) when issuing tokens after a successful flow.
|
|
215
235
|
*
|
|
216
|
-
* Tokens are populated only when `
|
|
217
|
-
* the body still echoes `userId` + `accessExpiresAt`
|
|
218
|
-
* a silent refresh; the actual tokens travel only in
|
|
236
|
+
* Tokens are populated only when `exposeTokensInBody` is true (default
|
|
237
|
+
* `!enableCookie`). Otherwise the body still echoes `userId` + `accessExpiresAt`
|
|
238
|
+
* so the caller can schedule a silent refresh; the actual tokens travel only in
|
|
239
|
+
* cookies.
|
|
219
240
|
*/
|
|
220
241
|
interface AuthLoginResponse {
|
|
221
242
|
userId: string;
|
|
@@ -263,7 +284,13 @@ interface AuthBindings {
|
|
|
263
284
|
extractToken(): string | undefined;
|
|
264
285
|
writeCookies(issue: IssueResult$1): void;
|
|
265
286
|
clearCookies(): void;
|
|
266
|
-
|
|
287
|
+
/**
|
|
288
|
+
* `opts.exposeTokens` overrides `exposeTokensInBody` for this response (the
|
|
289
|
+
* refresh route sets it when the refresh token arrived in the body).
|
|
290
|
+
*/
|
|
291
|
+
buildLoginResponse(userId: string, issue: IssueResult$1, opts?: {
|
|
292
|
+
exposeTokens?: boolean;
|
|
293
|
+
}): AuthLoginResponse;
|
|
267
294
|
buildFinishedCookies(issue: IssueResult$1): WfFinishedResponse["cookies"];
|
|
268
295
|
/** Build cookie attrs from the resolved access-cookie config, with optional overrides. */
|
|
269
296
|
cookieAttrs(extra?: TCookieAttributesInput): TCookieAttributesInput;
|
|
@@ -323,6 +350,80 @@ type AuthMate = Mate<TMoostMetadata & {
|
|
|
323
350
|
}>;
|
|
324
351
|
declare function getAuthMate(): AuthMate;
|
|
325
352
|
//#endregion
|
|
353
|
+
//#region src/workflow/auth-messages.d.ts
|
|
354
|
+
/**
|
|
355
|
+
* Code-keyed catalogue of every user-facing text `AuthWorkflow` produces —
|
|
356
|
+
* form errors, banners, finish envelopes and button labels. Templates are
|
|
357
|
+
* English; `{name}` placeholders are filled from the message params.
|
|
358
|
+
*
|
|
359
|
+
* Override per app with `AuthWorkflowOpts.messages` (a partial map, or a
|
|
360
|
+
* function that receives the code and params and returns the text — e.g. a
|
|
361
|
+
* lookup in your own i18n library), or override `AuthWorkflow.msg()`.
|
|
362
|
+
*/
|
|
363
|
+
declare const AOOTH_MESSAGES: {
|
|
364
|
+
readonly INVALID_CREDENTIALS: "Invalid credentials";
|
|
365
|
+
readonly ACCOUNT_LOCKED: "Account locked, please try again later";
|
|
366
|
+
readonly INVALID_PASSWORD: "Invalid password";
|
|
367
|
+
readonly INCORRECT_PASSWORD: "Incorrect password";
|
|
368
|
+
readonly SESSION_LIMIT_REACHED: "Session limit reached";
|
|
369
|
+
readonly INVALID_CODE: "Invalid code";
|
|
370
|
+
/** Params: `seconds`. */
|
|
371
|
+
readonly RESEND_WAIT: "Please wait {seconds}s before requesting a new code.";
|
|
372
|
+
/** Params: `seconds`. */
|
|
373
|
+
readonly RESEND_WAIT_ANOTHER: "Please wait {seconds}s before requesting another code";
|
|
374
|
+
/** Params: `seconds`, `channel` (`SMS` / `email`). */
|
|
375
|
+
readonly RESEND_WAIT_CHANNEL: "Please wait {seconds}s before requesting another {channel} code";
|
|
376
|
+
readonly TOTP_RESEND_NOT_APPLICABLE: "Resend is not applicable for TOTP";
|
|
377
|
+
readonly UNKNOWN_MFA_METHOD: "Unknown MFA method";
|
|
378
|
+
readonly UNKNOWN_METHOD: "Unknown method";
|
|
379
|
+
readonly METHOD_UNAVAILABLE: "That method isn't available";
|
|
380
|
+
readonly METHOD_NOT_CHANGEABLE: "That method can't be changed here.";
|
|
381
|
+
readonly KEEP_ONE_MFA_METHOD: "You must keep at least one two-factor method.";
|
|
382
|
+
readonly CHOOSE_OPTION: "Choose an option";
|
|
383
|
+
readonly ALL_MFA_METHODS_SET_UP: "You've already set up every available authentication method.";
|
|
384
|
+
readonly NO_MFA_CHANGES: "No changes were made to your two-factor methods.";
|
|
385
|
+
readonly PASSWORDS_DO_NOT_MATCH: "Passwords do not match";
|
|
386
|
+
readonly PASSWORD_CHANGE_TOO_RECENT: "You changed your password too recently. Please try again later.";
|
|
387
|
+
readonly PASSWORD_CHANGED: "Your password has been changed.";
|
|
388
|
+
readonly PASSWORD_UPDATED_REDIRECTING: "Password updated. Redirecting to sign-in…";
|
|
389
|
+
readonly PASSWORD_UPDATED_STILL_LOCKED: "Password updated, but your account is still locked. Contact an administrator to regain access.";
|
|
390
|
+
readonly RECOVERY_INSTRUCTIONS_SENT: "If an account exists, you will receive instructions.";
|
|
391
|
+
readonly SIGNUP_DISABLED: "Self-signup is currently disabled.";
|
|
392
|
+
readonly ALREADY_HAVE_ACCOUNT: "You already have an account. Please sign in.";
|
|
393
|
+
readonly ACCOUNT_LINKED: "Account linked.";
|
|
394
|
+
readonly INVALID_ROLE: "Invalid role";
|
|
395
|
+
readonly INVITE_ALREADY_PENDING: "Invite already pending";
|
|
396
|
+
readonly USER_ALREADY_EXISTS: "User already exists";
|
|
397
|
+
readonly DUPLICATE_INVITE_REJECTED: "Duplicate invite rejected";
|
|
398
|
+
readonly INVITE_CANCELLED: "This invite has been cancelled";
|
|
399
|
+
readonly INVITE_REPLACED: "This invite was replaced by a newer one";
|
|
400
|
+
readonly INVITE_ALREADY_ACCEPTED: "This invite was already accepted.";
|
|
401
|
+
readonly CHOOSE_USERNAME_TAKEN: "This username is taken";
|
|
402
|
+
readonly USERNAME_NOT_ALLOWED: "This username is not allowed";
|
|
403
|
+
readonly AUTHZ_EXPIRED: "Authorization request expired. Please try again.";
|
|
404
|
+
readonly AUTHZ_BROWSER_MISMATCH: "This authorization could not be verified for your browser. Please start again.";
|
|
405
|
+
readonly AUTHZ_FAILED: "Authorization could not be completed. Please start again.";
|
|
406
|
+
readonly GO_TO_SIGN_IN: "Go to sign-in";
|
|
407
|
+
readonly BACK_TO_SIGN_IN: "Back to sign-in";
|
|
408
|
+
readonly REQUEST_NEW_INVITE: "Request a new invite";
|
|
409
|
+
readonly BACK: "Back";
|
|
410
|
+
readonly GO_NOW: "Go now";
|
|
411
|
+
};
|
|
412
|
+
/** A message code of {@link AOOTH_MESSAGES}. */
|
|
413
|
+
type AoothMessageCode = keyof typeof AOOTH_MESSAGES;
|
|
414
|
+
/** Values filled into a message template's `{name}` placeholders. */
|
|
415
|
+
type AoothMessageParams = Readonly<Record<string, string | number>>;
|
|
416
|
+
/**
|
|
417
|
+
* App overrides for {@link AOOTH_MESSAGES}: a partial map (templates may use
|
|
418
|
+
* the same `{name}` placeholders), or a resolver returning the final text —
|
|
419
|
+
* `undefined` falls back to the built-in English template.
|
|
420
|
+
*/
|
|
421
|
+
type AoothMessages = Partial<Record<AoothMessageCode, string>> | ((code: AoothMessageCode, params: AoothMessageParams) => string | undefined);
|
|
422
|
+
/** Fill `{name}` placeholders from `params`; unknown placeholders are kept. */
|
|
423
|
+
declare function renderAoothMessage(template: string, params?: AoothMessageParams): string;
|
|
424
|
+
/** Resolve `code` through `messages` (when given), falling back to the English template. */
|
|
425
|
+
declare function resolveAoothMessage(code: AoothMessageCode, params?: AoothMessageParams, messages?: AoothMessages): string;
|
|
426
|
+
//#endregion
|
|
326
427
|
//#region src/auth.controller.d.ts
|
|
327
428
|
/** Workflows allowed by the bundled `/auth/trigger` endpoint. Subclasses override `triggerWf()` to extend. */
|
|
328
429
|
declare const DEFAULT_AUTH_WORKFLOWS: readonly ["auth/login/flow", "auth/invite/start", "auth/recovery/flow", "auth/signup/flow"];
|
|
@@ -410,13 +511,22 @@ declare class AuthController {
|
|
|
410
511
|
* but the user-id baked into the magic-link URL by `buildMagicLinkUrl(…, {
|
|
411
512
|
* userId })` lets the SPA resolve the "already accepted" condition itself.
|
|
412
513
|
*
|
|
413
|
-
* `@Public()` — invitees aren't signed in at this point.
|
|
514
|
+
* `@Public()` — invitees aren't signed in at this point. Rate limited
|
|
515
|
+
* (`30/5m` per IP, enforced when `rateLimitInterceptors` are installed); an
|
|
516
|
+
* unknown id and a still-pending invite get the same 404.
|
|
414
517
|
*
|
|
415
518
|
* Defaults for `loginUrl` / `alreadyAcceptedRedirectUrl` mirror the unified
|
|
416
519
|
* `AuthWorkflow` defaults (`/login` / `/login`). Subclasses override
|
|
417
520
|
* `resolveInvitePostRedemption()` to read live workflow opts.
|
|
418
521
|
*/
|
|
419
522
|
invitePostRedemption(uid: string | undefined): Promise<WfFinished>;
|
|
523
|
+
/**
|
|
524
|
+
* Whether `GET auth/invite/post-redemption` is served. Default `true`.
|
|
525
|
+
* Override to return `false` when the app does not use magic-link invites —
|
|
526
|
+
* the route then answers 404 for every id (a subclass cannot unregister an
|
|
527
|
+
* inherited route).
|
|
528
|
+
*/
|
|
529
|
+
protected invitePostRedemptionEnabled(): boolean;
|
|
420
530
|
/**
|
|
421
531
|
* URLs used by `invitePostRedemption`. Defaults mirror the unified
|
|
422
532
|
* `AuthWorkflow` resolved opts so subclasses that customize either of
|
|
@@ -425,6 +535,8 @@ declare class AuthController {
|
|
|
425
535
|
protected resolveInvitePostRedemption(): {
|
|
426
536
|
loginUrl: string;
|
|
427
537
|
alreadyAcceptedRedirectUrl: string;
|
|
538
|
+
/** Text overrides — pass the same value as `AuthWorkflowOpts.messages`. */
|
|
539
|
+
messages?: AoothMessages;
|
|
428
540
|
};
|
|
429
541
|
}
|
|
430
542
|
//#endregion
|
|
@@ -501,7 +613,11 @@ declare class SessionsController {
|
|
|
501
613
|
//#endregion
|
|
502
614
|
//#region src/wf-trigger/decorator.d.ts
|
|
503
615
|
interface WfTriggerOpts {
|
|
504
|
-
/**
|
|
616
|
+
/**
|
|
617
|
+
* Workflow ids this trigger may START and RESUME (a leading `/` is ignored).
|
|
618
|
+
* Omitted = unrestricted; `[]` = deny every workflow. A state token minted
|
|
619
|
+
* for a workflow outside the list is refused with 403 and is not consumed.
|
|
620
|
+
*/
|
|
505
621
|
allow?: string[];
|
|
506
622
|
/** Per-endpoint token wire override. Defaults to the provider's wire (`{read:['body','query','cookie'], write:'body', name:'wfs'}`). */
|
|
507
623
|
token?: WfOutletTokenConfig;
|
|
@@ -584,6 +700,11 @@ declare function deriveWfStateSecret(secret: string): Buffer;
|
|
|
584
700
|
declare class WfTriggerProvider {
|
|
585
701
|
protected readonly wf: MoostWf;
|
|
586
702
|
protected readonly auth: AuthCredential;
|
|
703
|
+
/**
|
|
704
|
+
* Outlets the trigger can pause on: HTTP (forms) and `invite` (the link of
|
|
705
|
+
* `AuthWorkflowOpts.inviteDelivery: 'deliver' | 'return-link'`). Append an
|
|
706
|
+
* `email` outlet (`createAuthEmailOutlet`) for the default invite delivery.
|
|
707
|
+
*/
|
|
587
708
|
protected outlets: WfOutlet[];
|
|
588
709
|
protected token: WfOutletTokenConfig;
|
|
589
710
|
constructor(wf: MoostWf, auth: AuthCredential);
|
|
@@ -605,12 +726,29 @@ declare class WfTriggerProvider {
|
|
|
605
726
|
private cachedState?;
|
|
606
727
|
/** Named strategy registry: every wf starts on `encapsulated` (default); a step calls swapStrategy('store') to move durable. Built lazily so subclass overrides (storeStrategy/wfStateSecret) are in effect. */
|
|
607
728
|
protected stateRegistry(): StateRegistry;
|
|
729
|
+
/**
|
|
730
|
+
* Handle one trigger request. `allow` lists the workflow ids this route may
|
|
731
|
+
* START and RESUME (matched without a leading `/`); omitted = unrestricted,
|
|
732
|
+
* `[]` = deny all. A state token minted for a workflow outside the list is
|
|
733
|
+
* refused with 403 before it is consumed.
|
|
734
|
+
*/
|
|
608
735
|
handle(opts?: {
|
|
609
736
|
allow?: string[];
|
|
610
737
|
token?: WfOutletTokenConfig;
|
|
611
738
|
}): Promise<unknown>;
|
|
612
739
|
}
|
|
613
740
|
//#endregion
|
|
741
|
+
//#region src/workflow/invite-outlet.d.ts
|
|
742
|
+
/** Name of the outlet `AuthWorkflow` pauses on for `inviteDelivery: 'deliver' | 'return-link'`. */
|
|
743
|
+
declare const INVITE_OUTLET = "invite";
|
|
744
|
+
/**
|
|
745
|
+
* The `invite` outlet (registered by default on `WfTriggerProvider`): hands
|
|
746
|
+
* the resume token to the callback the `send-email` step registered, which
|
|
747
|
+
* builds the link and delivers it (`'deliver'`) or returns it to the issuer
|
|
748
|
+
* (`'return-link'`). The token never rides the response on its own.
|
|
749
|
+
*/
|
|
750
|
+
declare function createInviteOutlet(): WfOutlet;
|
|
751
|
+
//#endregion
|
|
614
752
|
//#region src/rate-limit/mate.d.ts
|
|
615
753
|
/**
|
|
616
754
|
* Caller-identity strategy for a rate-limited route (RL.spec.md §5.3):
|
|
@@ -624,9 +762,12 @@ declare class WfTriggerProvider {
|
|
|
624
762
|
* `'user'`. Apps supply their own kinds (`'tenant'`, `'apiKey'`, …) via
|
|
625
763
|
* `setRateLimitSubject`.
|
|
626
764
|
* - custom function — runs inside the event context PRE-guard; must be
|
|
627
|
-
* self-sufficient (it cannot read what GUARD-priority code sets).
|
|
765
|
+
* self-sufficient (it cannot read what GUARD-priority code sets). Return
|
|
766
|
+
* a composite subject (e.g. client IP + submitted username) to key on
|
|
767
|
+
* several things at once, or `null` / `undefined` to SKIP the policy for
|
|
768
|
+
* this request (nothing is counted).
|
|
628
769
|
*/
|
|
629
|
-
type RateLimitKeyStrategy = "ip" | "user" | "auto" | "session" | (string & {}) | (() => string | Promise<string>);
|
|
770
|
+
type RateLimitKeyStrategy = "ip" | "user" | "auto" | "session" | (string & {}) | (() => string | null | undefined | Promise<string | null | undefined>);
|
|
630
771
|
/** Trailing options object accepted by `@RateLimit(...rules, opts)`. */
|
|
631
772
|
interface RateLimitDecoratorOptions {
|
|
632
773
|
/** Overrides the interceptor-level default key strategy for this route. */
|
|
@@ -639,15 +780,24 @@ interface RateLimitDecoratorOptions {
|
|
|
639
780
|
*/
|
|
640
781
|
id?: string;
|
|
641
782
|
}
|
|
783
|
+
/** One `@RateLimit(...)` declaration: its rules and options. */
|
|
784
|
+
interface TRateLimitPolicy {
|
|
785
|
+
/** Rules normalized at decoration time — bad grammar fails at boot. */
|
|
786
|
+
rules: RateLimitRule$1[];
|
|
787
|
+
options?: RateLimitDecoratorOptions;
|
|
788
|
+
}
|
|
642
789
|
/**
|
|
643
790
|
* Rate-limit metadata written by `@RateLimit()` and read by
|
|
644
791
|
* `rateLimitInterceptors`. Merged into `TMoostMetadata` so other moost-aware
|
|
645
792
|
* tooling sees it.
|
|
646
793
|
*/
|
|
647
794
|
interface TRateLimitMeta {
|
|
648
|
-
/**
|
|
649
|
-
|
|
650
|
-
|
|
795
|
+
/**
|
|
796
|
+
* One entry per stacked `@RateLimit(...)` decorator, in source order. Each
|
|
797
|
+
* is an independent policy (own key strategy and bucket); a request must
|
|
798
|
+
* pass all of them.
|
|
799
|
+
*/
|
|
800
|
+
rateLimitPolicies?: TRateLimitPolicy[];
|
|
651
801
|
/** `@RateLimit(false)` — opt this route out of interceptor-level default rules. */
|
|
652
802
|
rateLimitDisabled?: boolean;
|
|
653
803
|
}
|
|
@@ -707,10 +857,10 @@ interface RateLimitInterceptorOptions {
|
|
|
707
857
|
* the auth context `useAuth()` reads, and by definition target
|
|
708
858
|
* authenticated traffic where the guard must run anyway.
|
|
709
859
|
*
|
|
710
|
-
* Ownership is static per
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
* (see {@link RateLimited}).
|
|
860
|
+
* Ownership is static per policy (from metadata/options): a route whose
|
|
861
|
+
* stacked policies mix both kinds is evaluated by both phases, each checking
|
|
862
|
+
* its own policies. A per-event phase marker guards against double counting
|
|
863
|
+
* when the pair is also attached per-controller (see {@link RateLimited}).
|
|
714
864
|
*
|
|
715
865
|
* On rejection: draft `RateLimit-*` headers + `Retry-After` are written to
|
|
716
866
|
* the accumulated response (they survive the throw — wooks renders the error
|
|
@@ -733,6 +883,10 @@ declare function rateLimitInterceptors(opts?: RateLimitInterceptorOptions): TInt
|
|
|
733
883
|
* RateLimit(false) // opt out of interceptor-level default rules
|
|
734
884
|
* ```
|
|
735
885
|
*
|
|
886
|
+
* Stacking several `@RateLimit` decorators declares independent policies —
|
|
887
|
+
* each with its own key strategy and bucket — and a request must pass all
|
|
888
|
+
* of them (e.g. a per-IP limit plus a per-account limit).
|
|
889
|
+
*
|
|
736
890
|
* Rules are parsed eagerly, so a bad rule string throws at decoration
|
|
737
891
|
* (boot) time, not per request.
|
|
738
892
|
*/
|
|
@@ -1614,6 +1768,10 @@ interface AuthWfAcceptState {
|
|
|
1614
1768
|
showConfirmation?: boolean;
|
|
1615
1769
|
confirmationMessage?: string;
|
|
1616
1770
|
alreadyAccepted?: boolean;
|
|
1771
|
+
/** `inviteUsername: 'choose'` — the invitee picks their username at accept. */
|
|
1772
|
+
chooseUsername?: boolean;
|
|
1773
|
+
/** Set once `choose-username` stored the invitee's pick. */
|
|
1774
|
+
usernameChosen?: boolean;
|
|
1617
1775
|
}
|
|
1618
1776
|
/**
|
|
1619
1777
|
* Recovery post-reset state. `freshLoginRequired` removed — the choice is
|
|
@@ -1666,6 +1824,22 @@ interface AuthWfAdminState {
|
|
|
1666
1824
|
* second email and re-pausing. See `sendInviteEmail` for the why.
|
|
1667
1825
|
*/
|
|
1668
1826
|
emailDispatched?: boolean;
|
|
1827
|
+
/**
|
|
1828
|
+
* App context for this invite, from `resolveInviteContext(ctx, startFormData)`
|
|
1829
|
+
* at `init-invite-admin` (e.g. a tenant / household id). Server-only.
|
|
1830
|
+
*/
|
|
1831
|
+
app?: Record<string, unknown>;
|
|
1832
|
+
/** Admin-form fields beyond `email` / `roles` (a consumer's extended invite form). Server-only. */
|
|
1833
|
+
form?: Record<string, unknown>;
|
|
1834
|
+
/** User id of the issuer (from the session at `build-user-extras`). */
|
|
1835
|
+
invitedBy?: string;
|
|
1836
|
+
/**
|
|
1837
|
+
* Marker of THIS invite link, mirrored on `account.inviteNonce`. A re-invite
|
|
1838
|
+
* rotates the account's nonce, so this run's link then answers 410.
|
|
1839
|
+
*/
|
|
1840
|
+
inviteNonce?: string;
|
|
1841
|
+
/** How the link was delivered (`AuthWorkflowOpts.inviteDelivery`), read at accept. */
|
|
1842
|
+
inviteDelivery?: "outlet-email" | "deliver" | "return-link";
|
|
1669
1843
|
}
|
|
1670
1844
|
/**
|
|
1671
1845
|
* Pre-fill payload surfaced to forms via `@wf.context.pass 'defaults'`.
|
|
@@ -1952,6 +2126,13 @@ interface AuthWfPublicState {
|
|
|
1952
2126
|
defaults?: {
|
|
1953
2127
|
email?: string;
|
|
1954
2128
|
};
|
|
2129
|
+
/**
|
|
2130
|
+
* Client-side form texts overridden through `AuthWorkflowOpts.messages`
|
|
2131
|
+
* (only codes a form validator reads; present only when overridden).
|
|
2132
|
+
*/
|
|
2133
|
+
messages?: {
|
|
2134
|
+
PASSWORDS_DO_NOT_MATCH?: string;
|
|
2135
|
+
};
|
|
1955
2136
|
/**
|
|
1956
2137
|
* Mirrors `ctx.pendingLink` display fields — the proof `mode`, the masked
|
|
1957
2138
|
* account `hint` ("an account for a***@x.com exists"), the masked delivery
|
|
@@ -2133,6 +2314,63 @@ interface AuthWorkflowOpts {
|
|
|
2133
2314
|
* itself relax or tighten enforcement. Default `false`.
|
|
2134
2315
|
*/
|
|
2135
2316
|
allowAnyInviteRole?: boolean;
|
|
2317
|
+
/**
|
|
2318
|
+
* How the invite link reaches the invitee:
|
|
2319
|
+
* - `'outlet-email'` (default) — the workflow pauses on the `email` outlet
|
|
2320
|
+
* (`invite.magicLink` template); register an email outlet on the trigger
|
|
2321
|
+
* provider (`createAuthEmailOutlet`).
|
|
2322
|
+
* - `'deliver'` — the link is handed to `deliver({ kind: 'invite-link', … })`,
|
|
2323
|
+
* the same seam as every other notice.
|
|
2324
|
+
* - `'return-link'` — nothing is sent; the issuer's trigger response carries
|
|
2325
|
+
* `data.inviteLink` to share by hand. A click then does not prove the
|
|
2326
|
+
* invitee's inbox, so accepting does not record `account.verifiedEmail`.
|
|
2327
|
+
* `'deliver'` and `'return-link'` need {@link inviteLinkUrl}.
|
|
2328
|
+
*/
|
|
2329
|
+
inviteDelivery?: "outlet-email" | "deliver" | "return-link";
|
|
2330
|
+
/**
|
|
2331
|
+
* Builds the invite link from the resume token for `inviteDelivery:
|
|
2332
|
+
* 'deliver' | 'return-link'` (the `email` outlet builds its own). Put the
|
|
2333
|
+
* token in the `wfs` query parameter of the SPA page that renders the
|
|
2334
|
+
* invite workflow; `userId` lets that page resolve a re-click after
|
|
2335
|
+
* acceptance (`GET auth/invite/post-redemption?uid=`).
|
|
2336
|
+
*/
|
|
2337
|
+
inviteLinkUrl?: (token: string, info: {
|
|
2338
|
+
userId?: string;
|
|
2339
|
+
}) => string;
|
|
2340
|
+
/**
|
|
2341
|
+
* Who picks the login handle of an invited account:
|
|
2342
|
+
* - `'email'` (default) — the invited email address is the username.
|
|
2343
|
+
* - `'choose'` — the invitee picks a username on the accept page (the
|
|
2344
|
+
* `InviteChooseUsernameForm` step, before the password); the email stays
|
|
2345
|
+
* the correspondence address.
|
|
2346
|
+
*/
|
|
2347
|
+
inviteUsername?: "email" | "choose";
|
|
2348
|
+
/**
|
|
2349
|
+
* Overrides for the user-facing texts (`AOOTH_MESSAGES`, keyed by code): a
|
|
2350
|
+
* partial map of templates, or a resolver `(code, params) => text` (return
|
|
2351
|
+
* `undefined` to keep the English default). The resolver runs inside the
|
|
2352
|
+
* request, so it can read the caller's locale.
|
|
2353
|
+
*/
|
|
2354
|
+
messages?: AoothMessages;
|
|
2355
|
+
/**
|
|
2356
|
+
* What a failed sign-in tells the caller about locked accounts:
|
|
2357
|
+
* - `'uniform'` (default) — a locked account answers "Account locked", and
|
|
2358
|
+
* so does an unknown (or inactive) handle after the same number of failed
|
|
2359
|
+
* attempts (a shadow counter, see `lockoutShadowStore`) — so the lock
|
|
2360
|
+
* message does not reveal which accounts exist.
|
|
2361
|
+
* - `'generic'` — every failure, locked or not, answers "Invalid credentials".
|
|
2362
|
+
* - `'reveal'` — only real locked accounts answer "Account locked" (the
|
|
2363
|
+
* pre-0.2 behaviour; reveals which handles exist).
|
|
2364
|
+
* The threshold and duration come from `UserService`'s `lockout` config; with
|
|
2365
|
+
* lockout disabled (`threshold: 0`) all three behave like `'generic'`.
|
|
2366
|
+
*/
|
|
2367
|
+
lockoutDisclosure?: "uniform" | "generic" | "reveal";
|
|
2368
|
+
/**
|
|
2369
|
+
* Counter store for the `'uniform'` shadow lockout of unknown handles.
|
|
2370
|
+
* Default: one process-wide in-memory store — pass a shared store (e.g.
|
|
2371
|
+
* `RateLimitStoreRedis`) when several instances serve sign-ins.
|
|
2372
|
+
*/
|
|
2373
|
+
lockoutShadowStore?: RateLimitStore$1;
|
|
2136
2374
|
/** Pincode infrastructure shared by login MFA, invite MFA, and recovery OTP. */
|
|
2137
2375
|
mfa?: {
|
|
2138
2376
|
pincodeLength?: number;
|
|
@@ -2196,6 +2434,8 @@ interface AuthWorkflowOpts {
|
|
|
2196
2434
|
setPassword?: TAtscriptAnnotatedType;
|
|
2197
2435
|
/** Authenticated self-service "change my password" form (current + new + confirm). */
|
|
2198
2436
|
changePassword?: TAtscriptAnnotatedType;
|
|
2437
|
+
/** Username picker shown at invite accept when `inviteUsername: 'choose'`. */
|
|
2438
|
+
inviteChooseUsername?: TAtscriptAnnotatedType;
|
|
2199
2439
|
/** Password-proof form rendered by `prove-control` when the matched account has a real password. */
|
|
2200
2440
|
proveControl?: TAtscriptAnnotatedType;
|
|
2201
2441
|
/** OTP-proof form rendered by `prove-control` when the matched account is passwordless. */
|
|
@@ -2220,6 +2460,14 @@ interface ResolvedAuthWorkflowOpts {
|
|
|
2220
2460
|
autoLoginOnRecover: boolean;
|
|
2221
2461
|
invitableRoles: string[];
|
|
2222
2462
|
allowAnyInviteRole: boolean;
|
|
2463
|
+
inviteDelivery: "outlet-email" | "deliver" | "return-link";
|
|
2464
|
+
inviteLinkUrl?: (token: string, info: {
|
|
2465
|
+
userId?: string;
|
|
2466
|
+
}) => string;
|
|
2467
|
+
inviteUsername: "email" | "choose";
|
|
2468
|
+
messages?: AoothMessages;
|
|
2469
|
+
lockoutDisclosure: "uniform" | "generic" | "reveal";
|
|
2470
|
+
lockoutShadowStore: RateLimitStore$1;
|
|
2223
2471
|
mfa: {
|
|
2224
2472
|
pincodeLength: number;
|
|
2225
2473
|
pincodeTtlMs: number;
|
|
@@ -2258,6 +2506,7 @@ interface ResolvedAuthWorkflowOpts {
|
|
|
2258
2506
|
pincode: TAtscriptAnnotatedType;
|
|
2259
2507
|
setPassword: TAtscriptAnnotatedType;
|
|
2260
2508
|
changePassword: TAtscriptAnnotatedType;
|
|
2509
|
+
inviteChooseUsername: TAtscriptAnnotatedType;
|
|
2261
2510
|
proveControl: TAtscriptAnnotatedType;
|
|
2262
2511
|
proveControlOtp: TAtscriptAnnotatedType;
|
|
2263
2512
|
termsBump: TAtscriptAnnotatedType;
|
|
@@ -2373,19 +2622,28 @@ declare function parseInviteRoles(input?: string[]): string[];
|
|
|
2373
2622
|
declare function buildInviteAlreadyAcceptedEnvelope(opts: {
|
|
2374
2623
|
loginUrl: string;
|
|
2375
2624
|
alreadyAcceptedRedirectUrl: string;
|
|
2625
|
+
/** Text overrides (see `AuthWorkflowOpts.messages`). */
|
|
2626
|
+
messages?: AoothMessages;
|
|
2376
2627
|
}): FinishWfOpts;
|
|
2377
2628
|
declare class AuthWorkflow {
|
|
2378
2629
|
protected readonly opts: ResolvedAuthWorkflowOpts;
|
|
2379
2630
|
protected readonly users: UserService;
|
|
2380
2631
|
protected readonly auth: AuthCredential;
|
|
2381
2632
|
protected readonly consentStore: ConsentStore;
|
|
2633
|
+
/** The invite context every invite hook receives: issuer, app context, extra form fields. */
|
|
2634
|
+
private inviteHookInput;
|
|
2635
|
+
/** Warn once per process when a `'reuse'` re-invite crosses issuers. */
|
|
2636
|
+
private warnCrossIssuerReuse;
|
|
2637
|
+
constructor(opts: Partial<AuthWorkflowOpts>, users: UserService, auth: AuthCredential, consentStore: ConsentStore);
|
|
2382
2638
|
/**
|
|
2383
|
-
*
|
|
2384
|
-
*
|
|
2385
|
-
*
|
|
2639
|
+
* Resolve a user-facing text by code (`AOOTH_MESSAGES`) through
|
|
2640
|
+
* `opts.messages`. Every form error, banner, finish message and button label
|
|
2641
|
+
* the workflow produces goes through here — override for full control
|
|
2642
|
+
* (e.g. to call your i18n library with the request's locale).
|
|
2386
2643
|
*/
|
|
2387
|
-
|
|
2388
|
-
|
|
2644
|
+
protected msg(code: AoothMessageCode, params?: AoothMessageParams): string;
|
|
2645
|
+
/** An `HttpError` whose body carries the message `code` next to its (resolved) text. */
|
|
2646
|
+
protected httpError(status: 409 | 410, code: AoothMessageCode): HttpError$1;
|
|
2389
2647
|
/**
|
|
2390
2648
|
* Unified outbound dispatch hook for direct synchronous deliveries
|
|
2391
2649
|
* (MFA / recovery / enrollment pincodes, new-device notices). NOT used for
|
|
@@ -2495,6 +2753,10 @@ declare class AuthWorkflow {
|
|
|
2495
2753
|
email?: string;
|
|
2496
2754
|
roles: string[];
|
|
2497
2755
|
invitedBy?: string;
|
|
2756
|
+
/** Invite only: the app context from {@link resolveInviteContext}. */
|
|
2757
|
+
app?: Record<string, unknown>;
|
|
2758
|
+
/** Invite only: admin-form fields beyond `email` / `roles`. */
|
|
2759
|
+
form?: Record<string, unknown>;
|
|
2498
2760
|
}): Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
2499
2761
|
/**
|
|
2500
2762
|
* Derive roles server-side from the admin-form payload (e.g. AD lookup).
|
|
@@ -2503,7 +2765,20 @@ declare class AuthWorkflow {
|
|
|
2503
2765
|
*/
|
|
2504
2766
|
protected inferAdminRoles(_input: {
|
|
2505
2767
|
email: string;
|
|
2768
|
+
invitedBy?: string;
|
|
2769
|
+
app?: Record<string, unknown>;
|
|
2770
|
+
form?: Record<string, unknown>;
|
|
2506
2771
|
}): Promise<string[]> | string[];
|
|
2772
|
+
/**
|
|
2773
|
+
* App context of an invite, resolved once when the issue phase starts
|
|
2774
|
+
* (`init-invite-admin`) from the trigger's START input (`{ wfid, input: {
|
|
2775
|
+
* formData } }` — the `startFormData` argument) and the session. Return
|
|
2776
|
+
* e.g. `{ tenantId }`; the value is kept server-side as `ctx.admin.app` and
|
|
2777
|
+
* handed to `prepareUser`, `inferAdminRoles` and `duplicateInviteCheck`.
|
|
2778
|
+
* Throw an `HttpError` to refuse the invite (e.g. the issuer may not invite
|
|
2779
|
+
* into that tenant). Default: `undefined` (no app context).
|
|
2780
|
+
*/
|
|
2781
|
+
protected resolveInviteContext(_ctx: AuthWfCtx, _startFormData: Record<string, unknown> | undefined): Record<string, unknown> | undefined | Promise<Record<string, unknown> | undefined>;
|
|
2507
2782
|
/**
|
|
2508
2783
|
* Override the structural duplicate rule for `admin-form`. Default: a row
|
|
2509
2784
|
* still parked on `account.pendingInvitation` → `'reuse'` (re-invite:
|
|
@@ -2514,11 +2789,25 @@ declare class AuthWorkflow {
|
|
|
2514
2789
|
* Multi-tenant apps that allow re-inviting the same email into a different
|
|
2515
2790
|
* tenant override to `'allow'`. Apps that want the strict legacy behavior
|
|
2516
2791
|
* ("Invite already pending" error on a duplicate invite of a pending user)
|
|
2517
|
-
* return `'reject'` for pending rows.
|
|
2792
|
+
* return `'reject'` for pending rows. Compare `invitedBy` / `app` with
|
|
2793
|
+
* `pending` and `existingUser` to refuse taking over another issuer's (or
|
|
2794
|
+
* tenant's) pending invite. On `'reuse'` the row's roles and extras are
|
|
2795
|
+
* REPLACED by this invite's, and every link issued before is superseded
|
|
2796
|
+
* (answers 410 "replaced").
|
|
2518
2797
|
*/
|
|
2519
2798
|
protected duplicateInviteCheck(input: {
|
|
2520
2799
|
email: string;
|
|
2521
2800
|
existingUser: UserCredentials | null;
|
|
2801
|
+
/** The issuer of THIS invite (session user id). */
|
|
2802
|
+
invitedBy?: string;
|
|
2803
|
+
/** This invite's app context ({@link resolveInviteContext}). */
|
|
2804
|
+
app?: Record<string, unknown>;
|
|
2805
|
+
/** This invite's extra admin-form fields. */
|
|
2806
|
+
form?: Record<string, unknown>;
|
|
2807
|
+
/** The pending invite already on `existingUser`, when there is one. */
|
|
2808
|
+
pending?: {
|
|
2809
|
+
invitedBy?: string;
|
|
2810
|
+
};
|
|
2522
2811
|
}): Promise<"allow" | "reject" | "reuse"> | "allow" | "reject" | "reuse";
|
|
2523
2812
|
/**
|
|
2524
2813
|
* Implements the "log out other sessions" branch of `sessionPolicy.concurrencyLimit`.
|
|
@@ -3170,7 +3459,7 @@ declare class AuthWorkflow {
|
|
|
3170
3459
|
*/
|
|
3171
3460
|
protected isAccountBlocked(user: UserCredentials): boolean;
|
|
3172
3461
|
protected probeSilentAuthz(ctx: AuthWfCtx, policy: AuthzReauthPolicy): Promise<boolean>;
|
|
3173
|
-
initInviteAdmin(ctx: AuthWfCtx):
|
|
3462
|
+
initInviteAdmin(ctx: AuthWfCtx): Promise<undefined>;
|
|
3174
3463
|
initInviteAccept(ctx: AuthWfCtx): void;
|
|
3175
3464
|
initRecovery(ctx: AuthWfCtx): void;
|
|
3176
3465
|
/**
|
|
@@ -3208,6 +3497,18 @@ declare class AuthWorkflow {
|
|
|
3208
3497
|
*/
|
|
3209
3498
|
initAddMfa(ctx: AuthWfCtx): Promise<undefined>;
|
|
3210
3499
|
credentials(ctx: AuthWfCtx): Promise<unknown>;
|
|
3500
|
+
/**
|
|
3501
|
+
* Whether a failed password sign-in answers "Account locked" — see
|
|
3502
|
+
* `AuthWorkflowOpts.lockoutDisclosure`. Under `'uniform'` an unknown or
|
|
3503
|
+
* inactive handle keeps a shadow failure counter in `lockoutShadowStore`
|
|
3504
|
+
* that mirrors a real account exactly: every failure counts (the counter is
|
|
3505
|
+
* not reset when it trips — like `failedLoginAttempts`), a lock starts when
|
|
3506
|
+
* `failures >= threshold` and none is active, the tripping attempt still
|
|
3507
|
+
* reads "Invalid credentials", and a permanent lock stays on while probed.
|
|
3508
|
+
* Keys are a hash of the normalised handle (bounded size); the counter
|
|
3509
|
+
* slides for 30 days of inactivity.
|
|
3510
|
+
*/
|
|
3511
|
+
private failedLoginReadsLocked;
|
|
3211
3512
|
/**
|
|
3212
3513
|
* Route a credentials alt-action click (forgotPassword / signup / magicLink
|
|
3213
3514
|
* / sso-<id>) to a `finishWf` redirect envelope. Returns `ALT_HANDLED` when
|
|
@@ -3313,6 +3614,13 @@ declare class AuthWorkflow {
|
|
|
3313
3614
|
* `ctx.admin.userExtras`.
|
|
3314
3615
|
*/
|
|
3315
3616
|
buildUserExtras(ctx: AuthWfCtx): Promise<undefined>;
|
|
3617
|
+
/**
|
|
3618
|
+
* Invariant of the invite issue phase: once the admin form is accepted, the
|
|
3619
|
+
* pending user must exist before the link is sent. An issue phase that ends
|
|
3620
|
+
* without one (a broken override, a store that silently dropped the row) is
|
|
3621
|
+
* a server error — never a bare `{ finished: true }`.
|
|
3622
|
+
*/
|
|
3623
|
+
assertInviteCreated(ctx: AuthWfCtx): undefined;
|
|
3316
3624
|
/**
|
|
3317
3625
|
* Create the user row from `ctx.admin.userExtras` (plus the admin-supplied
|
|
3318
3626
|
* `ctx.admin.roles`), then stamp `pendingInvitation = true` via a follow-up
|
|
@@ -3358,6 +3666,32 @@ declare class AuthWorkflow {
|
|
|
3358
3666
|
* cleared.
|
|
3359
3667
|
*/
|
|
3360
3668
|
checkPendingInvitation(ctx: AuthWfCtx): Promise<undefined>;
|
|
3669
|
+
/**
|
|
3670
|
+
* Username policy for `inviteUsername: 'choose'`, applied to the normalised
|
|
3671
|
+
* (NFKC, trimmed) pick. Return a message code to refuse it. Default: at most
|
|
3672
|
+
* 256 characters, no whitespace or control characters, and no `@` unless it
|
|
3673
|
+
* is the invited address itself — a chosen name must not look like someone
|
|
3674
|
+
* else's email handle (sign-in resolves `username` before email columns).
|
|
3675
|
+
*/
|
|
3676
|
+
protected validateChosenUsername(ctx: AuthWfCtx, username: string): AoothMessageCode | undefined;
|
|
3677
|
+
/**
|
|
3678
|
+
* The invited account, refusing a cancelled invite (410 `INVITE_CANCELLED`,
|
|
3679
|
+
* the row is gone) or a superseded link (410 `INVITE_REPLACED`, a re-invite
|
|
3680
|
+
* rotated the account's marker away from this run's).
|
|
3681
|
+
*/
|
|
3682
|
+
private currentInviteRow;
|
|
3683
|
+
/**
|
|
3684
|
+
* Re-check, right before an invite-accept write, that this run's link is
|
|
3685
|
+
* still the current one and the invite is still pending — a re-invite or a
|
|
3686
|
+
* parallel acceptance may have happened while this run was paused.
|
|
3687
|
+
*/
|
|
3688
|
+
private assertInviteStillOpen;
|
|
3689
|
+
/**
|
|
3690
|
+
* `inviteUsername: 'choose'` — the invitee picks the username they will
|
|
3691
|
+
* sign in with (the invited email stays the correspondence address). The
|
|
3692
|
+
* pick replaces the account's login handle; a taken one re-pauses.
|
|
3693
|
+
*/
|
|
3694
|
+
chooseUsername(ctx: AuthWfCtx): Promise<undefined>;
|
|
3361
3695
|
/**
|
|
3362
3696
|
* Emit the "this invite was already accepted" finish envelope and short-
|
|
3363
3697
|
* circuit the rest of the accept tail.
|
|
@@ -4204,4 +4538,4 @@ interface AuditEmitter {
|
|
|
4204
4538
|
emit(event: AuditEvent): Promise<void> | void;
|
|
4205
4539
|
}
|
|
4206
4540
|
//#endregion
|
|
4207
|
-
export { ADD_MFA_WORKFLOW, AUTHZ_BINDING_COOKIE, AUTH_CODE_STORE_TOKEN, type AuditEmitter, type AuditEvent, type AuthBindings, type AuthContext, AuthController, type AuthDeliveryPayload, type AuthEmailEvent, type AuthEmailKind, type AuthEmailOutletDeps, AuthGuarded, type AuthLoginResponse, type AuthLogoutBody, type AuthOkResponse, type AuthOptions, type AuthRefreshBody, type AuthSmsEvent, type AuthSmsKind, type AuthWfCompletionState, type AuthWfConsentsState, type AuthWfCtx, type AuthWfMfaEnrollState, type AuthWfOAuthState, type AuthWfPasswordUiState, type AuthWfPincodeUiState, AuthWorkflow, type AuthWorkflowOpts, type AuthorizationServerMetadata, AuthorizeController, AuthorizeRuntime, type AuthzReauthPolicy, type BuildAuthorizationServerMetadataOptions, type BuildMagicLinkUrl, type BuildProtectedResourceMetadataOptions, CHANGE_PASSWORD_WORKFLOW, CLIENT_REDIRECT_POLICY_TOKEN, type ConcurrencyLimitOptions, type ConnectedAccount, type ConsentDescriptor, type ConsentDescriptorLike, type ConsentEvent, ConsentStore, DEFAULT_AUTH_WORKFLOWS, DYNAMIC_CLIENT_STORE_TOKEN, DynamicClientRegistration, type DynamicClientRegistrationOptions, type EmailSender, type EnrichedSession, FEDERATED_IDENTITY_STORE_TOKEN, type IssueResult, type LoginRedirect, type MfaSummary, type MfaTransport, OAUTH_CSRF_COOKIE, OAuthController, OAuthRuntime, PENDING_AUTHORIZATION_STORE_TOKEN, type ProtectedResourceMetadata, Public, RESERVED_USER_KEYS, RateLimit, type RateLimitBindings, type RateLimitDecision, type RateLimitDecoratorOptions, type RateLimitInterceptorOptions, type RateLimitKeyStrategy, type RateLimitRule, type RateLimitRuleInput, type RateLimitStore, RateLimitStoreMemory, RateLimited, RateLimiter, type RateLimiterOptions, type ResolvedAuthCookieConfig, type ResolvedAuthOptions, type ResolvedAuthWorkflowOpts, type SessionEnricher, SessionEnricherProvider, type SessionInfo, SessionsController, type SmsSender, type SsoProvider, type TAuthMeta, type TRateLimitMeta, UserId, WfTrigger, type WfTriggerOpts, WfTriggerProvider, type WwwAuthenticateBearerChallengeOptions, authGuardInterceptor, authzBindingCookieAttrs, buildAuthorizationServerMetadata, buildInviteAlreadyAcceptedEnvelope, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, createAuthEmailOutlet, deriveWfStateSecret, generateMagicLinkToken, getAuthMate, getRateLimitMate, getRateLimitSubject, haversineKm, humanizeUserAgent, isSafeRelativeRedirect, oauthCsrfCookieAttrs, parseInviteRoles, rateLimitInterceptors, resolveOAuthRedirect, setRateLimitSubject, stripReservedUserKeys, useAuth, useRateLimit };
|
|
4541
|
+
export { ADD_MFA_WORKFLOW, AOOTH_MESSAGES, AUTHZ_BINDING_COOKIE, AUTH_CODE_STORE_TOKEN, type AoothMessageCode, type AoothMessageParams, type AoothMessages, type AuditEmitter, type AuditEvent, type AuthBindings, type AuthContext, AuthController, type AuthDeliveryPayload, type AuthEmailEvent, type AuthEmailKind, type AuthEmailOutletDeps, AuthGuarded, type AuthLoginResponse, type AuthLogoutBody, type AuthOkResponse, type AuthOptions, type AuthRefreshBody, type AuthSmsEvent, type AuthSmsKind, type AuthWfCompletionState, type AuthWfConsentsState, type AuthWfCtx, type AuthWfMfaEnrollState, type AuthWfOAuthState, type AuthWfPasswordUiState, type AuthWfPincodeUiState, AuthWorkflow, type AuthWorkflowOpts, type AuthorizationServerMetadata, AuthorizeController, AuthorizeRuntime, type AuthzReauthPolicy, type BuildAuthorizationServerMetadataOptions, type BuildMagicLinkUrl, type BuildProtectedResourceMetadataOptions, CHANGE_PASSWORD_WORKFLOW, CLIENT_REDIRECT_POLICY_TOKEN, type ConcurrencyLimitOptions, type ConnectedAccount, type ConsentDescriptor, type ConsentDescriptorLike, type ConsentEvent, ConsentStore, DEFAULT_AUTH_WORKFLOWS, DYNAMIC_CLIENT_STORE_TOKEN, DynamicClientRegistration, type DynamicClientRegistrationOptions, type EmailSender, type EnrichedSession, FEDERATED_IDENTITY_STORE_TOKEN, INVITE_OUTLET, type IssueResult, type LoginRedirect, type MfaSummary, type MfaTransport, OAUTH_CSRF_COOKIE, OAuthController, OAuthRuntime, PENDING_AUTHORIZATION_STORE_TOKEN, type ProtectedResourceMetadata, Public, RESERVED_USER_KEYS, RateLimit, type RateLimitBindings, type RateLimitDecision, type RateLimitDecoratorOptions, type RateLimitInterceptorOptions, type RateLimitKeyStrategy, type RateLimitRule, type RateLimitRuleInput, type RateLimitStore, RateLimitStoreMemory, RateLimited, RateLimiter, type RateLimiterOptions, type ResolvedAuthCookieConfig, type ResolvedAuthOptions, type ResolvedAuthWorkflowOpts, type SessionEnricher, SessionEnricherProvider, type SessionInfo, SessionsController, type SmsSender, type SsoProvider, type TAuthMeta, type TRateLimitMeta, UserId, WfTrigger, type WfTriggerOpts, WfTriggerProvider, type WwwAuthenticateBearerChallengeOptions, authGuardInterceptor, authzBindingCookieAttrs, buildAuthorizationServerMetadata, buildInviteAlreadyAcceptedEnvelope, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, createAuthEmailOutlet, createInviteOutlet, deriveWfStateSecret, generateMagicLinkToken, getAuthMate, getRateLimitMate, getRateLimitSubject, haversineKm, humanizeUserAgent, isSafeRelativeRedirect, oauthCsrfCookieAttrs, parseInviteRoles, rateLimitInterceptors, renderAoothMessage, resolveAoothMessage, resolveOAuthRedirect, setRateLimitSubject, stripReservedUserKeys, useAuth, useRateLimit };
|