authhero 9.36.0 → 9.38.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/assets/u/widget/authhero-widget.esm.js +1 -1
- package/dist/assets/u/widget/index.esm.js +1 -1
- package/dist/assets/u/widget/{p-ce8560f6.entry.js → p-32247347.entry.js} +1 -1
- package/dist/assets/u/widget/p-3f908508.entry.js +1 -0
- package/dist/assets/u/widget/p-Wx4M-olY.js +2 -0
- package/dist/authhero.cjs +165 -141
- package/dist/authhero.d.ts +633 -331
- package/dist/authhero.mjs +19149 -16716
- package/dist/{mfa-DPwn1ajo.js → mfa-DBhvi2B5.js} +1 -1
- package/dist/{mfa-B044FRjD.mjs → mfa-DnCary4g.mjs} +19 -19
- package/dist/{mfa-attempts-DGOLb2oh.mjs → mfa-attempts-BK-gWrgJ.mjs} +5161 -5045
- package/dist/mfa-attempts-C5kobAHS.js +275 -0
- package/dist/{passkey-enrollment-BDboqoaP.js → passkey-enrollment-CmKahPq7.js} +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/email-verification.d.ts +1 -1
- package/dist/types/authentication-flows/passwordless.d.ts +2 -2
- package/dist/types/generated/locale-types.d.ts +87 -0
- package/dist/types/helpers/anchor-client.d.ts +16 -0
- package/dist/types/helpers/database-connection-scope.d.ts +48 -18
- package/dist/types/helpers/dcr/audience-policy.d.ts +13 -0
- package/dist/types/helpers/dcr/client-registration.d.ts +81 -0
- package/dist/types/helpers/dcr/constraint-enforcement.d.ts +1 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +18 -1
- package/dist/types/helpers/dcr/mint-iat.d.ts +4 -1
- package/dist/types/helpers/dcr/mint-token.d.ts +4 -0
- package/dist/types/helpers/dcr/presets.d.ts +34 -0
- package/dist/types/helpers/dcr/uri-policy.d.ts +34 -0
- package/dist/types/helpers/default-destinations.d.ts +14 -0
- package/dist/types/helpers/firehose-client.d.ts +29 -0
- package/dist/types/helpers/outbox-destinations/log-streams.d.ts +21 -1
- package/dist/types/helpers/password-connection.d.ts +3 -1
- package/dist/types/helpers/prompt-partials.d.ts +1 -1
- package/dist/types/helpers/reserved-claims.d.ts +2 -2
- package/dist/types/helpers/run-outbox-relay.d.ts +9 -2
- package/dist/types/helpers/self-service-tickets.d.ts +34 -0
- package/dist/types/helpers/users.d.ts +17 -2
- package/dist/types/index.d.ts +565 -271
- package/dist/types/routes/auth-api/authenticate.d.ts +1 -1
- package/dist/types/routes/auth-api/dbconnections.d.ts +2 -2
- package/dist/types/routes/auth-api/index.d.ts +38 -23
- package/dist/types/routes/auth-api/passwordless.d.ts +10 -10
- package/dist/types/routes/auth-api/register/index.d.ts +15 -0
- package/dist/types/routes/auth-api/token.d.ts +10 -10
- package/dist/types/routes/management-api/action-executions.d.ts +2 -2
- package/dist/types/routes/management-api/actions.d.ts +9 -9
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/branding-preview.d.ts +9 -1
- package/dist/types/routes/management-api/branding.d.ts +105 -1
- package/dist/types/routes/management-api/client-registration-tokens.d.ts +149 -0
- package/dist/types/routes/management-api/clients.d.ts +8 -8
- package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
- package/dist/types/routes/management-api/email-templates.d.ts +20 -20
- package/dist/types/routes/management-api/emails.d.ts +2 -2
- package/dist/types/routes/management-api/failed-events.d.ts +4 -4
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/helpers.d.ts +1 -1
- package/dist/types/routes/management-api/hook-code.d.ts +2 -2
- package/dist/types/routes/management-api/hooks.d.ts +4 -4
- package/dist/types/routes/management-api/index.d.ts +482 -233
- package/dist/types/routes/management-api/keys.d.ts +4 -4
- package/dist/types/routes/management-api/log-streams.d.ts +12 -12
- package/dist/types/routes/management-api/logs.d.ts +4 -4
- package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
- package/dist/types/routes/management-api/organizations.d.ts +7 -7
- package/dist/types/routes/management-api/prompts.d.ts +8 -8
- package/dist/types/routes/management-api/roles.d.ts +1 -1
- package/dist/types/routes/management-api/self-service-profiles.d.ts +7 -7
- package/dist/types/routes/management-api/tenant-operations.d.ts +10 -10
- package/dist/types/routes/management-api/tenants.d.ts +29 -29
- package/dist/types/routes/management-api/themes.d.ts +69 -0
- package/dist/types/routes/management-api/users.d.ts +16 -16
- package/dist/types/routes/universal-login/common.d.ts +52 -0
- package/dist/types/routes/universal-login/dark-theme.d.ts +25 -0
- package/dist/types/routes/universal-login/flow-api.d.ts +4 -4
- package/dist/types/routes/universal-login/form-node.d.ts +4 -4
- package/dist/types/routes/universal-login/index.d.ts +4 -4
- package/dist/types/routes/universal-login/legal-links.d.ts +18 -0
- package/dist/types/routes/universal-login/screen-prompt-map.d.ts +31 -0
- package/dist/types/routes/universal-login/screens/connect-authz.d.ts +9 -0
- package/dist/types/routes/universal-login/screens/login-partials.d.ts +9 -1
- package/dist/types/routes/universal-login/screens/self-service-app.d.ts +46 -0
- package/dist/types/routes/universal-login/u2-form-node.d.ts +2 -2
- package/dist/types/routes/universal-login/u2-index.d.ts +35 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +35 -5
- package/dist/types/routes/universal-login/u2-widget-page.d.ts +6 -1
- package/dist/types/routes/universal-login/universal-login-template.d.ts +1 -0
- package/dist/types/state-machines/login-session.d.ts +19 -1
- package/dist/types/types/Bindings.d.ts +2 -0
- package/package.json +7 -6
- package/dist/assets/u/widget/p-FUW5zvoZ.js +0 -2
- package/dist/assets/u/widget/p-c6ec4c36.entry.js +0 -1
- package/dist/mfa-attempts-BiU_pMOV.js +0 -275
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Context } from "hono";
|
|
2
|
+
import type { Bindings, Variables } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Shared helpers for self-service tickets: the bearer links that let an
|
|
5
|
+
* outside party set something up without an account. Used by Self-Service
|
|
6
|
+
* SSO tickets (#1763) and developer app invites and edit links (#1776).
|
|
7
|
+
*
|
|
8
|
+
* A ticket id is 32 random bytes, base64url-encoded, returned once inside the
|
|
9
|
+
* ticket URL and stored only as its hex SHA-256 hash.
|
|
10
|
+
*/
|
|
11
|
+
/** A new ticket id: 32 random bytes, base64url (43 characters). */
|
|
12
|
+
export declare function generateTicketId(): string;
|
|
13
|
+
/** The stored form of a ticket id: hex SHA-256. */
|
|
14
|
+
export declare function hashTicketId(ticketId: string): Promise<string>;
|
|
15
|
+
/** Developer app setup page (invite and edit links), on the tenant's domain. */
|
|
16
|
+
export declare const APP_TICKET_PATH = "u2/self-service/app";
|
|
17
|
+
/** Default and maximum lifetime of app invite and edit links. */
|
|
18
|
+
export declare const APP_TICKET_DEFAULT_TTL_SEC: number;
|
|
19
|
+
export declare const APP_TICKET_MAX_TTL_SEC: number;
|
|
20
|
+
/** The query parameter carrying a ticket id in a ticket URL. */
|
|
21
|
+
export declare const TICKET_PARAM = "ticket";
|
|
22
|
+
/**
|
|
23
|
+
* The ticket URL for `path` on the tenant's login domain. On the shared
|
|
24
|
+
* issuer host nothing else identifies the tenant, so `tenant_id` is added.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildTicketUrl(ctx: Context<{
|
|
27
|
+
Bindings: Bindings;
|
|
28
|
+
Variables: Variables;
|
|
29
|
+
}>, path: string, ticketId: string, tenantId: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* A logged query record with any ticket id replaced: a log reader must never
|
|
32
|
+
* get a usable ticket.
|
|
33
|
+
*/
|
|
34
|
+
export declare function redactTicketQuery<T>(query: Record<string, T>): Record<string, T | string>;
|
|
@@ -16,6 +16,11 @@ export declare function getUsersByEmail(userAdapter: UserDataAdapter, tenantId:
|
|
|
16
16
|
* in `resolveLinkCandidates`.
|
|
17
17
|
*/
|
|
18
18
|
export declare function getAllUsersByEmail(userAdapter: UserDataAdapter, tenantId: string, email: string): Promise<User[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Every user sharing `username`, across all pages. The username counterpart
|
|
21
|
+
* of {@link getAllUsersByEmail}, for the same uniqueness checks.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getAllUsersByUsername(userAdapter: UserDataAdapter, tenantId: string, username: string): Promise<User[]>;
|
|
19
24
|
interface GetUserByProviderParams {
|
|
20
25
|
userAdapter: UserDataAdapter;
|
|
21
26
|
tenant_id: string;
|
|
@@ -209,10 +214,20 @@ interface EmailConflictParams {
|
|
|
209
214
|
* of its linked secondaries (when the caller passed `connection`).
|
|
210
215
|
*/
|
|
211
216
|
clusterRootId: string;
|
|
217
|
+
/**
|
|
218
|
+
* The target's database connection scope, when the tenant has several
|
|
219
|
+
* database connections (see `resolveDatabaseConnectionScope`). Between two
|
|
220
|
+
* database users, "same connection" then means what the login lookups see:
|
|
221
|
+
* a legacy row whose `connection` names no database connection counts as
|
|
222
|
+
* part of every connection. Without a scope it is a plain name comparison.
|
|
223
|
+
*/
|
|
224
|
+
connectionScope?: DatabaseConnectionScope;
|
|
212
225
|
}
|
|
213
226
|
/**
|
|
214
227
|
* Find the user, if any, that genuinely blocks changing `target`'s email to an
|
|
215
|
-
* address already present on other rows.
|
|
228
|
+
* address already present on other rows. The same rules apply to a username
|
|
229
|
+
* change, with candidates from {@link getAllUsersByUsername}: usernames have
|
|
230
|
+
* the same `(tenant_id, provider, username)` unique index.
|
|
216
231
|
*
|
|
217
232
|
* Two rows sharing an email is only a *conflict* when it makes a login ambiguous,
|
|
218
233
|
* and login lookups are always provider-scoped (`getUserByProvider` filters on
|
|
@@ -239,7 +254,7 @@ interface EmailConflictParams {
|
|
|
239
254
|
* Because AuthHero keeps secondaries as real rows (Auth0 folds them into the
|
|
240
255
|
* primary's `identities[]`), they'd otherwise surface here as "another user".
|
|
241
256
|
*/
|
|
242
|
-
export declare function findEmailConflict({ candidates, target, clusterRootId, }: EmailConflictParams): User | undefined;
|
|
257
|
+
export declare function findEmailConflict({ candidates, target, clusterRootId, connectionScope, }: EmailConflictParams): User | undefined;
|
|
243
258
|
interface CascadeEmailParams {
|
|
244
259
|
userAdapter: UserDataAdapter;
|
|
245
260
|
tenant_id: string;
|