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
|
@@ -38,7 +38,7 @@ export declare function setPendingLoginEmailVerification(ctx: Context<{
|
|
|
38
38
|
* to "code" like the u2 password reset, so the user stays on the login page
|
|
39
39
|
* instead of depending on an emailed link.
|
|
40
40
|
*/
|
|
41
|
-
export declare function getEmailVerificationMethod(client: EnrichedClient): EmailVerificationMethod;
|
|
41
|
+
export declare function getEmailVerificationMethod(client: EnrichedClient, requested?: string): EmailVerificationMethod;
|
|
42
42
|
/**
|
|
43
43
|
* Mint a one-time code bound to the login session and email it. The code is
|
|
44
44
|
* only issued after the password has been validated, so redeeming it proves
|
|
@@ -175,8 +175,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
175
175
|
authenticated_at?: string | undefined;
|
|
176
176
|
tenant_id?: string | undefined;
|
|
177
177
|
};
|
|
178
|
-
connectionType: "username" | "
|
|
179
|
-
authConnection: "username" | "
|
|
178
|
+
connectionType: "username" | "sms" | "email";
|
|
179
|
+
authConnection: "username" | "sms" | "email";
|
|
180
180
|
session_id: string | undefined;
|
|
181
181
|
authParams: {
|
|
182
182
|
audience?: string | undefined;
|
|
@@ -963,6 +963,90 @@ export interface StatusScreen {
|
|
|
963
963
|
successTitle: () => string;
|
|
964
964
|
title: () => string;
|
|
965
965
|
}
|
|
966
|
+
export interface SelfServiceSelfServiceAppScreen {
|
|
967
|
+
title: () => string;
|
|
968
|
+
description: (vars: {
|
|
969
|
+
tenantName: string;
|
|
970
|
+
}) => string;
|
|
971
|
+
editTitle: (vars: {
|
|
972
|
+
appName: string;
|
|
973
|
+
}) => string;
|
|
974
|
+
editDescription: (vars: {
|
|
975
|
+
appName: string;
|
|
976
|
+
}) => string;
|
|
977
|
+
expiresText: (vars: {
|
|
978
|
+
date: string;
|
|
979
|
+
}) => string;
|
|
980
|
+
appTypeLabel: () => string;
|
|
981
|
+
appTypeNative: () => string;
|
|
982
|
+
appTypeSpa: () => string;
|
|
983
|
+
appTypeRegularWeb: () => string;
|
|
984
|
+
nameLabel: () => string;
|
|
985
|
+
callbacksLabel: () => string;
|
|
986
|
+
callbacksHintNative: () => string;
|
|
987
|
+
callbacksHintWeb: () => string;
|
|
988
|
+
logoutUrlsLabel: () => string;
|
|
989
|
+
webOriginsLabel: () => string;
|
|
990
|
+
webOriginsHint: () => string;
|
|
991
|
+
logoUrlLabel: () => string;
|
|
992
|
+
websiteLabel: () => string;
|
|
993
|
+
privacyLabel: () => string;
|
|
994
|
+
termsLabel: () => string;
|
|
995
|
+
contactLabel: () => string;
|
|
996
|
+
registerButton: () => string;
|
|
997
|
+
saveButton: () => string;
|
|
998
|
+
savedText: () => string;
|
|
999
|
+
clientIdLabel: () => string;
|
|
1000
|
+
requiredError: () => string;
|
|
1001
|
+
invalidValueError: () => string;
|
|
1002
|
+
uriTooMany: () => string;
|
|
1003
|
+
uriTooLong: () => string;
|
|
1004
|
+
uriInvalid: (vars: {
|
|
1005
|
+
value: string;
|
|
1006
|
+
}) => string;
|
|
1007
|
+
uriWildcard: (vars: {
|
|
1008
|
+
value: string;
|
|
1009
|
+
}) => string;
|
|
1010
|
+
uriFragment: (vars: {
|
|
1011
|
+
value: string;
|
|
1012
|
+
}) => string;
|
|
1013
|
+
uriUserinfo: (vars: {
|
|
1014
|
+
value: string;
|
|
1015
|
+
}) => string;
|
|
1016
|
+
uriHttpNotLoopback: (vars: {
|
|
1017
|
+
value: string;
|
|
1018
|
+
}) => string;
|
|
1019
|
+
uriSchemeNotAllowed: (vars: {
|
|
1020
|
+
value: string;
|
|
1021
|
+
}) => string;
|
|
1022
|
+
uriCustomSchemeNeedsDot: (vars: {
|
|
1023
|
+
value: string;
|
|
1024
|
+
}) => string;
|
|
1025
|
+
uriOriginOnly: (vars: {
|
|
1026
|
+
value: string;
|
|
1027
|
+
}) => string;
|
|
1028
|
+
uriNotForNative: () => string;
|
|
1029
|
+
errorText: () => string;
|
|
1030
|
+
}
|
|
1031
|
+
export interface SelfServiceSelfServiceAppDoneScreen {
|
|
1032
|
+
title: () => string;
|
|
1033
|
+
description: (vars: {
|
|
1034
|
+
appName: string;
|
|
1035
|
+
}) => string;
|
|
1036
|
+
clientIdLabel: () => string;
|
|
1037
|
+
domainLabel: () => string;
|
|
1038
|
+
discoveryLabel: () => string;
|
|
1039
|
+
clientSecretLabel: () => string;
|
|
1040
|
+
clientSecretWarning: () => string;
|
|
1041
|
+
pkceNote: () => string;
|
|
1042
|
+
editLaterText: (vars: {
|
|
1043
|
+
tenantName: string;
|
|
1044
|
+
}) => string;
|
|
1045
|
+
}
|
|
1046
|
+
export interface SelfServiceSelfServiceTicketInvalidScreen {
|
|
1047
|
+
title: () => string;
|
|
1048
|
+
description: () => string;
|
|
1049
|
+
}
|
|
966
1050
|
export interface ScreenMap {
|
|
967
1051
|
"common.common": CommonScreen;
|
|
968
1052
|
"common.account": CommonAccountScreen;
|
|
@@ -1010,4 +1094,7 @@ export interface ScreenMap {
|
|
|
1010
1094
|
"signup-password.signup-password": SignupPasswordScreen;
|
|
1011
1095
|
"sms-otp-challenge.sms-otp-challenge": SmsOtpChallengeScreen;
|
|
1012
1096
|
"status.status": StatusScreen;
|
|
1097
|
+
"self-service.self-service-app": SelfServiceSelfServiceAppScreen;
|
|
1098
|
+
"self-service.self-service-app-done": SelfServiceSelfServiceAppDoneScreen;
|
|
1099
|
+
"self-service.self-service-ticket-invalid": SelfServiceSelfServiceTicketInvalidScreen;
|
|
1013
1100
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Context } from "hono";
|
|
2
|
+
import type { Client, Tenant } from "@authhero/adapter-interfaces";
|
|
3
|
+
import type { Bindings, Variables } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* The client a tenant-level browser flow (the /connect/start consent, the
|
|
6
|
+
* developer app setup page) anchors its login session to. The session is only
|
|
7
|
+
* used to carry state through u2 screens; the anchor client_id is never
|
|
8
|
+
* traversed in an OAuth flow. Prefers the tenant's `default_client_id`
|
|
9
|
+
* (analogous to Auth0's Default App) so branding stays deterministic, and
|
|
10
|
+
* falls back to the first *interactive* client — never an M2M client, which
|
|
11
|
+
* can't render a screen. Returns null when the tenant has neither.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveAnchorClient(ctx: Context<{
|
|
14
|
+
Bindings: Bindings;
|
|
15
|
+
Variables: Variables;
|
|
16
|
+
}>, tenant: Tenant): Promise<Client | null>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Connection, ConnectionsAdapter, User } from "@authhero/adapter-interfaces";
|
|
2
|
+
import { JSONHTTPException } from "../errors/json-http-exception";
|
|
2
3
|
/**
|
|
3
4
|
* Scopes a database-user lookup to one database connection (#1702).
|
|
4
5
|
*
|
|
@@ -23,7 +24,9 @@ export interface DatabaseConnectionScope {
|
|
|
23
24
|
databaseConnectionNames: ReadonlySet<string>;
|
|
24
25
|
}
|
|
25
26
|
/** True when `user` belongs to the scoped connection. No scope matches all. */
|
|
26
|
-
export declare function isUserInConnectionScope(user:
|
|
27
|
+
export declare function isUserInConnectionScope(user: {
|
|
28
|
+
connection?: string;
|
|
29
|
+
}, scope: DatabaseConnectionScope | undefined): boolean;
|
|
27
30
|
/**
|
|
28
31
|
* Order rows so an exact connection match comes before an unattributed legacy
|
|
29
32
|
* row. Only relevant once one identifier can exist in several connections.
|
|
@@ -40,28 +43,55 @@ export declare function compareByConnectionScope(scope: DatabaseConnectionScope)
|
|
|
40
43
|
* generic `Username-Password-Authentication` realm on a tenant whose
|
|
41
44
|
* connection has another name.
|
|
42
45
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
46
|
+
* The name set must cover every database connection in the tenant, or a row
|
|
47
|
+
* of a missing connection would pass the scope; see
|
|
48
|
+
* {@link listAllTenantConnections}.
|
|
45
49
|
*/
|
|
46
50
|
export declare function resolveDatabaseConnectionScope(connections: Pick<ConnectionsAdapter, "list">, tenant_id: string, name: string | undefined): Promise<DatabaseConnectionScope | undefined>;
|
|
47
51
|
/**
|
|
48
|
-
* The database connection a login or
|
|
49
|
-
*
|
|
50
|
-
* agree.
|
|
52
|
+
* The database connection a login, signup or password reset for `client`
|
|
53
|
+
* uses (#1703). This is the one place that decides it; lookups scope to it and
|
|
54
|
+
* new database users are written with it, so the two always agree.
|
|
51
55
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
56
|
+
* Auth0's rule, in order:
|
|
57
|
+
* 1. A connection the request names (`/authorize` `connection`, carried on the
|
|
58
|
+
* login session as `authParams.connection`; the password-realm `realm`; the
|
|
59
|
+
* `/dbconnections` `connection` field) is used when it is a database
|
|
60
|
+
* connection enabled on the client. A name that isn't enabled on the client
|
|
61
|
+
* is rejected, never replaced by another connection.
|
|
62
|
+
* 2. Otherwise the client's first enabled database connection, in the
|
|
63
|
+
* client's stored order. A client with no explicit connection list (it
|
|
64
|
+
* falls back to every tenant connection, as CIMD clients do) gets its
|
|
65
|
+
* database connections oldest first, see
|
|
66
|
+
* {@link orderFallbackDatabaseConnections}, so this is the tenant's oldest.
|
|
61
67
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
68
|
+
* `Username-Password-Authentication` is the generic realm that callers from
|
|
69
|
+
* before named database connections send for "this client's database
|
|
70
|
+
* connection". It names a connection when one has that exact name, and
|
|
71
|
+
* otherwise means "no explicit choice".
|
|
72
|
+
*
|
|
73
|
+
* Returns `undefined` when the client has no database connection.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveClientDatabaseConnection<T extends Pick<Connection, "name" | "strategy">>(client: {
|
|
76
|
+
connections: T[];
|
|
77
|
+
}, requested?: string): T | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Name of the connection {@link resolveClientDatabaseConnection} picks, or the
|
|
80
|
+
* generic `Username-Password-Authentication` when the client has no database
|
|
81
|
+
* connection (the name such users were always written with).
|
|
64
82
|
*/
|
|
65
83
|
export declare function resolveClientDatabaseConnectionName(client: {
|
|
66
84
|
connections: Pick<Connection, "name" | "strategy">[];
|
|
67
|
-
},
|
|
85
|
+
}, requested?: string): string;
|
|
86
|
+
/** A request named a connection that isn't a database connection of the client. */
|
|
87
|
+
export declare function databaseConnectionNotEnabled(name: string): JSONHTTPException;
|
|
88
|
+
/**
|
|
89
|
+
* Order a client's fallback connection list (every tenant connection, used
|
|
90
|
+
* when the client enables none explicitly) so its database connections come
|
|
91
|
+
* oldest first. Only the database connections move, within the slots they
|
|
92
|
+
* already hold, so the order of login buttons doesn't change.
|
|
93
|
+
*
|
|
94
|
+
* Oldest is by `created_at`; a connection without one (imported or seeded
|
|
95
|
+
* rows) counts as newest, and ties break on id.
|
|
96
|
+
*/
|
|
97
|
+
export declare function orderFallbackDatabaseConnections<T extends Connection>(connections: T[]): T[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Context } from "hono";
|
|
2
|
+
import type { Bindings, Variables } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Dynamic Client Registration never provisions a client grant for the
|
|
5
|
+
* Management API: the built-in `urn:authhero:management` identifier and any
|
|
6
|
+
* extra management audiences the deployment accepts
|
|
7
|
+
* (`init({ additionalManagementAudiences })`). Clients that need Management
|
|
8
|
+
* API access are created through the Management API itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isRegistrationDeniedAudience(ctx: Context<{
|
|
11
|
+
Bindings: Bindings;
|
|
12
|
+
Variables: Variables;
|
|
13
|
+
}>, tenantId: string, audience: string): Promise<boolean>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Context } from "hono";
|
|
2
|
+
import type { ContentfulStatusCode } from "hono/utils/http-status";
|
|
3
|
+
import { type Client, type ClientRegistrationToken, type Tenant } from "@authhero/adapter-interfaces";
|
|
4
|
+
import type { Bindings, Variables } from "../../types";
|
|
5
|
+
import { JSONHTTPException } from "../../errors/json-http-exception";
|
|
6
|
+
import { type DcrRequest } from "./metadata-mapping";
|
|
7
|
+
import { type AppPreset } from "./presets";
|
|
8
|
+
import { type UriViolation } from "./uri-policy";
|
|
9
|
+
type Ctx = Context<{
|
|
10
|
+
Bindings: Bindings;
|
|
11
|
+
Variables: Variables;
|
|
12
|
+
}>;
|
|
13
|
+
/** Registration access tokens of invite-created apps expire after 7 days. */
|
|
14
|
+
export declare const INVITE_REGISTRATION_ACCESS_TOKEN_TTL_SEC: number;
|
|
15
|
+
/**
|
|
16
|
+
* A rejected registration or update. `field` names the metadata field at
|
|
17
|
+
* fault (in wire form) so the setup page can show the error next to it.
|
|
18
|
+
*/
|
|
19
|
+
export declare class DcrMetadataError extends JSONHTTPException {
|
|
20
|
+
readonly field?: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
/** Set when a URL broke the developer URL rules (see uri-policy.ts). */
|
|
23
|
+
readonly uriViolation?: UriViolation;
|
|
24
|
+
constructor(error: string, description: string, field?: string, status?: ContentfulStatusCode, uriViolation?: UriViolation);
|
|
25
|
+
}
|
|
26
|
+
export declare function readIatConstraints(registrationMetadata: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
27
|
+
export interface RegisterClientOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Return a registration access token, as `POST /oidc/register` does. The
|
|
30
|
+
* setup page does not: the developer gets no standing access and asks the
|
|
31
|
+
* operator for an edit link instead.
|
|
32
|
+
*/
|
|
33
|
+
issueRegistrationAccessToken: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface RegisteredClient {
|
|
36
|
+
client: Client;
|
|
37
|
+
/** Only for confidential clients; shown once. */
|
|
38
|
+
client_secret?: string;
|
|
39
|
+
registration_access_token?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* RFC 7591 registration shared by `POST /oidc/register` and the developer
|
|
43
|
+
* setup page. `iat` is the authenticated Initial Access Token, or undefined
|
|
44
|
+
* for open registration. The token is marked used in the same transaction
|
|
45
|
+
* that creates the client.
|
|
46
|
+
*/
|
|
47
|
+
export declare function registerClient(ctx: Ctx, tenant: Tenant, iat: ClientRegistrationToken | undefined, body: DcrRequest, options: RegisterClientOptions): Promise<RegisteredClient>;
|
|
48
|
+
/**
|
|
49
|
+
* Fields an outside developer may change after registration, through an edit
|
|
50
|
+
* link or (for invite-created apps) RFC 7592. Everything else stays as the
|
|
51
|
+
* operator configured it.
|
|
52
|
+
*/
|
|
53
|
+
export declare const EDITABLE_FIELDS: readonly ["client_name", "logo_uri", "redirect_uris", "post_logout_redirect_uris", "web_origins", "client_uri", "policy_uri", "tos_uri", "contacts"];
|
|
54
|
+
export type EditableField = (typeof EDITABLE_FIELDS)[number];
|
|
55
|
+
export interface UpdateRegisteredClientOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Restrict the update to `EDITABLE_FIELDS`: other fields must be omitted
|
|
58
|
+
* (kept as stored) or equal to the stored value. Used for edit links and
|
|
59
|
+
* for every app created from an invite preset.
|
|
60
|
+
*/
|
|
61
|
+
editableFieldsOnly: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface UpdatedClient {
|
|
64
|
+
client: Client;
|
|
65
|
+
/** Wire names of the editable fields whose value changed. */
|
|
66
|
+
changed: string[];
|
|
67
|
+
}
|
|
68
|
+
/** The app type whose URL rules apply when editing `client`. */
|
|
69
|
+
export declare function editPolicyAppType(client: Client): AppPreset;
|
|
70
|
+
/**
|
|
71
|
+
* RFC 7592 update shared by `PUT /oidc/register/{client_id}` and the
|
|
72
|
+
* developer setup page.
|
|
73
|
+
*/
|
|
74
|
+
export declare function updateRegisteredClient(ctx: Ctx, tenant: Tenant, existing: Client, body: DcrRequest, options: UpdateRegisteredClientOptions): Promise<UpdatedClient>;
|
|
75
|
+
/**
|
|
76
|
+
* Whether RFC 7592 updates to this client are limited to `EDITABLE_FIELDS`:
|
|
77
|
+
* always through an edit link, and for every app created from an invite
|
|
78
|
+
* preset.
|
|
79
|
+
*/
|
|
80
|
+
export declare function updatesRestrictedToEditableFields(client: Client, token: ClientRegistrationToken): boolean;
|
|
81
|
+
export {};
|
|
@@ -24,10 +24,10 @@ export declare const dcrRequestSchema: z.ZodObject<{
|
|
|
24
24
|
response_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
25
|
token_endpoint_auth_method: z.ZodOptional<z.ZodEnum<{
|
|
26
26
|
none: "none";
|
|
27
|
-
private_key_jwt: "private_key_jwt";
|
|
28
27
|
client_secret_post: "client_secret_post";
|
|
29
28
|
client_secret_basic: "client_secret_basic";
|
|
30
29
|
client_secret_jwt: "client_secret_jwt";
|
|
30
|
+
private_key_jwt: "private_key_jwt";
|
|
31
31
|
}>>;
|
|
32
32
|
jwks_uri: z.ZodOptional<z.ZodString>;
|
|
33
33
|
jwks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -36,6 +36,12 @@ export declare const dcrRequestSchema: z.ZodObject<{
|
|
|
36
36
|
client_id: z.ZodOptional<z.ZodString>;
|
|
37
37
|
client_secret: z.ZodOptional<z.ZodString>;
|
|
38
38
|
audience: z.ZodOptional<z.ZodString>;
|
|
39
|
+
application_type: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
native: "native";
|
|
41
|
+
web: "web";
|
|
42
|
+
}>>;
|
|
43
|
+
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
web_origins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
45
|
}, z.core.$strip>;
|
|
40
46
|
export type DcrRequest = z.infer<typeof dcrRequestSchema>;
|
|
41
47
|
export declare const dcrResponseSchema: z.ZodObject<{
|
|
@@ -59,6 +65,12 @@ export declare const dcrResponseSchema: z.ZodObject<{
|
|
|
59
65
|
jwks_uri: z.ZodOptional<z.ZodString>;
|
|
60
66
|
software_id: z.ZodOptional<z.ZodString>;
|
|
61
67
|
software_version: z.ZodOptional<z.ZodString>;
|
|
68
|
+
application_type: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
native: "native";
|
|
70
|
+
web: "web";
|
|
71
|
+
}>>;
|
|
72
|
+
post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
web_origins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
74
|
}, z.core.$strip>;
|
|
63
75
|
export type DcrResponse = z.infer<typeof dcrResponseSchema>;
|
|
64
76
|
export interface RegistrationMapping {
|
|
@@ -67,6 +79,11 @@ export interface RegistrationMapping {
|
|
|
67
79
|
/** Additional metadata preserved on the client for round-trip. */
|
|
68
80
|
extraMetadata: Record<string, unknown>;
|
|
69
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* OIDC `application_type` to Auth0 `app_type`. A browser app (`web`) without
|
|
84
|
+
* a client secret is a single-page app.
|
|
85
|
+
*/
|
|
86
|
+
export declare function appTypeFromApplicationType(applicationType: "web" | "native", tokenEndpointAuthMethod: string | undefined): "native" | "spa" | "regular_web";
|
|
70
87
|
/**
|
|
71
88
|
* Map an RFC 7591 DCR request to internal Client fields.
|
|
72
89
|
*/
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { ClientRegistrationToken, ClientRegistrationTokensAdapter } from "@authhero/adapter-interfaces";
|
|
1
|
+
import type { ClientRegistrationToken, ClientRegistrationTokenSource, ClientRegistrationTokensAdapter } from "@authhero/adapter-interfaces";
|
|
2
2
|
export interface MintIatOptions {
|
|
3
3
|
sub?: string;
|
|
4
4
|
constraints?: Record<string, unknown>;
|
|
5
5
|
expires_in_seconds?: number;
|
|
6
6
|
single_use?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
created_by?: string;
|
|
9
|
+
source?: ClientRegistrationTokenSource;
|
|
7
10
|
}
|
|
8
11
|
export interface MintedIat {
|
|
9
12
|
id: string;
|
|
@@ -3,5 +3,9 @@ export interface GeneratedRegistrationToken {
|
|
|
3
3
|
token: string;
|
|
4
4
|
token_hash: string;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Registration tokens (IATs, RATs) are self-service tickets: an invite or
|
|
8
|
+
* edit link carries the token itself as its ticket id.
|
|
9
|
+
*/
|
|
6
10
|
export declare function hashRegistrationToken(token: string): Promise<string>;
|
|
7
11
|
export declare function mintRegistrationToken(): Promise<GeneratedRegistrationToken>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-type presets for developer invites (#1776). A preset is expanded into
|
|
3
|
+
* Initial Access Token constraints, so the restrictions hold whether the
|
|
4
|
+
* developer registers through the setup page or calls `POST /oidc/register`
|
|
5
|
+
* with the token directly. No machine-to-machine preset: invites are for
|
|
6
|
+
* interactive apps.
|
|
7
|
+
*/
|
|
8
|
+
export declare const APP_PRESETS: readonly ["native", "spa", "regular_web"];
|
|
9
|
+
export type AppPreset = (typeof APP_PRESETS)[number];
|
|
10
|
+
export declare function isAppPreset(value: unknown): value is AppPreset;
|
|
11
|
+
/**
|
|
12
|
+
* Constraint keys only an operator may set (on the IAT). They are not RFC 7591
|
|
13
|
+
* metadata, the request schema drops them, and registration reads them from
|
|
14
|
+
* the token's constraints only:
|
|
15
|
+
* - `app_type`: the preset (`native`, `spa`, `regular_web`)
|
|
16
|
+
* - `is_first_party`: whether the app skips the consent screen
|
|
17
|
+
* - `connections`: connection ids the app may use; unset means all
|
|
18
|
+
* - `require_pkce`: PKCE with S256 is required at /authorize
|
|
19
|
+
*/
|
|
20
|
+
export interface OperatorConstraints {
|
|
21
|
+
app_type?: AppPreset;
|
|
22
|
+
is_first_party?: boolean;
|
|
23
|
+
connections?: string[];
|
|
24
|
+
require_pkce?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function readOperatorConstraints(constraints: Record<string, unknown> | undefined): OperatorConstraints;
|
|
27
|
+
/**
|
|
28
|
+
* The constraints a preset pins. Every preset is a code-flow app with refresh
|
|
29
|
+
* tokens and PKCE; native and single-page apps are public clients (no
|
|
30
|
+
* secret), regular web apps use `client_secret_post` (Auth0's default).
|
|
31
|
+
*/
|
|
32
|
+
export declare function presetConstraints(preset: AppPreset): Record<string, unknown>;
|
|
33
|
+
/** Which preset (if any) a registered client was created from. */
|
|
34
|
+
export declare function clientPreset(registrationMetadata: Record<string, unknown> | undefined): AppPreset | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AppPreset } from "./presets";
|
|
2
|
+
/**
|
|
3
|
+
* URL rules for apps registered or edited by an outside developer (#1776):
|
|
4
|
+
* invite-created apps and apps edited through an edit link.
|
|
5
|
+
*
|
|
6
|
+
* - Every URL: no wildcards, no fragment, no userinfo, at most 1024
|
|
7
|
+
* characters; at most 20 entries per list.
|
|
8
|
+
* - https is always allowed. http only on a loopback host (`localhost`,
|
|
9
|
+
* `127.0.0.1`, `[::1]`), any port, for local development (RFC 8252 §7.3).
|
|
10
|
+
* - Native apps may also use a private-use URI scheme containing a dot, e.g.
|
|
11
|
+
* `com.example.app:/callback` (RFC 8252 §7.1).
|
|
12
|
+
* - Web origins are bare origins (no path, query or fragment) and only for
|
|
13
|
+
* browser apps.
|
|
14
|
+
*
|
|
15
|
+
* Values already stored on the client are accepted as they are, so an edit
|
|
16
|
+
* link on an older, hand-made client can still save without first fixing
|
|
17
|
+
* every existing URL. New values must follow the rules.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MAX_URIS = 20;
|
|
20
|
+
export declare const MAX_URI_LENGTH = 1024;
|
|
21
|
+
export declare const FORBIDDEN_SCHEMES: Set<string>;
|
|
22
|
+
export type UriField = "redirect_uris" | "post_logout_redirect_uris" | "web_origins";
|
|
23
|
+
export interface UriViolation {
|
|
24
|
+
field: UriField;
|
|
25
|
+
value?: string;
|
|
26
|
+
reason: UriViolationReason;
|
|
27
|
+
}
|
|
28
|
+
export type UriViolationReason = "too_many" | "too_long" | "invalid" | "wildcard" | "fragment" | "userinfo" | "http_not_loopback" | "scheme_not_allowed" | "custom_scheme_needs_dot" | "origin_only" | "not_for_native";
|
|
29
|
+
/**
|
|
30
|
+
* Returns the first violation in `values`, or null. `existing` are the values
|
|
31
|
+
* already stored on the client for this field; those are not re-checked.
|
|
32
|
+
*/
|
|
33
|
+
export declare function checkUris(field: UriField, values: string[] | undefined, appType: AppPreset, existing?: string[]): UriViolation | null;
|
|
34
|
+
export declare function describeUriViolation(violation: UriViolation): string;
|
|
@@ -60,6 +60,20 @@ export interface CreateDefaultDestinationsConfig {
|
|
|
60
60
|
*/
|
|
61
61
|
pipeline?: OutboxPipelineConfig;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* The archive destinations configured on `init({ outbox })`, in delivery
|
|
65
|
+
* order. Shared by the per-request route middleware and
|
|
66
|
+
* `createDefaultDestinations` so both paths archive to the same places.
|
|
67
|
+
*
|
|
68
|
+
* Append these after every other destination: the relay stops an event's
|
|
69
|
+
* destination loop on the first failure, so an archive outage must not be
|
|
70
|
+
* able to block real delivery. Nothing depends on the archives, so they are
|
|
71
|
+
* the destinations that can afford to be blocked — the cost is that an event
|
|
72
|
+
* which permanently fails an earlier destination never reaches them.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createArchiveDestinations(outbox: {
|
|
75
|
+
pipeline?: OutboxPipelineConfig;
|
|
76
|
+
} | undefined): EventDestination[];
|
|
63
77
|
/**
|
|
64
78
|
* Build the same array of outbox destinations that authhero's per-request
|
|
65
79
|
* `outboxMiddleware` constructs internally. Intended for consumers that want
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const FIREHOSE_MAX_RECORD_BYTES: number;
|
|
2
|
+
export interface FirehoseTarget {
|
|
3
|
+
/** AWS region of the delivery stream, e.g. `eu-north-1`. */
|
|
4
|
+
region: string;
|
|
5
|
+
/** Name (not ARN) of the Direct PUT delivery stream. */
|
|
6
|
+
deliveryStreamName: string;
|
|
7
|
+
accessKeyId: string;
|
|
8
|
+
secretAccessKey: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PutFirehoseRecordsOptions {
|
|
11
|
+
/** Per-request timeout (default: 10s). */
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
/** Override for tests. */
|
|
14
|
+
fetchImpl?: typeof fetch;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Why a target cannot be used, or `undefined` when it can. The region is
|
|
18
|
+
* interpolated into the endpoint hostname, so anything but a plain region id
|
|
19
|
+
* is rejected — it could otherwise redirect a signed request elsewhere.
|
|
20
|
+
*/
|
|
21
|
+
export declare function firehoseTargetError(target: FirehoseTarget): string | undefined;
|
|
22
|
+
export declare function firehoseEndpoint(region: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Sends already-encoded records to an Amazon Data Firehose Direct PUT stream
|
|
25
|
+
* with SigV4-signed `PutRecordBatch` calls, split at the per-call limits.
|
|
26
|
+
* Callers keep each record within `FIREHOSE_MAX_RECORD_BYTES`; this throws
|
|
27
|
+
* before sending if one is not, since Firehose would reject the whole call.
|
|
28
|
+
*/
|
|
29
|
+
export declare function putFirehoseRecords(target: FirehoseTarget, records: Uint8Array[], options?: PutFirehoseRecordsOptions): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AuditEvent, LogStreamsAdapter } from "@authhero/adapter-interfaces";
|
|
2
2
|
import { EventDestination } from "../outbox-relay";
|
|
3
|
+
import { type FirehoseTarget } from "../firehose-client";
|
|
3
4
|
interface LogStreamData {
|
|
4
5
|
date: string;
|
|
5
6
|
type: string;
|
|
@@ -46,8 +47,26 @@ interface StreamDelivery {
|
|
|
46
47
|
logType: string;
|
|
47
48
|
payload: LogStreamPayload;
|
|
48
49
|
}
|
|
50
|
+
export interface FirehoseSinkConfig {
|
|
51
|
+
target: FirehoseTarget;
|
|
52
|
+
/**
|
|
53
|
+
* Terminate each record with `\n` so records Firehose concatenates into one
|
|
54
|
+
* S3 object are newline-delimited JSON (default: true).
|
|
55
|
+
*/
|
|
56
|
+
newlineDelimited: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reads a `firehose` log stream's sink. Shared by delivery and the management
|
|
60
|
+
* API, so a sink the API accepts is one delivery can use.
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseFirehoseSink(sink: Record<string, unknown>): {
|
|
63
|
+
config: FirehoseSinkConfig;
|
|
64
|
+
} | {
|
|
65
|
+
error: string;
|
|
66
|
+
};
|
|
49
67
|
/**
|
|
50
|
-
* Delivers audit events to tenant-configured
|
|
68
|
+
* Delivers audit events to tenant-configured `http` and `firehose` log
|
|
69
|
+
* streams. Mirrors
|
|
51
70
|
* Auth0's log_stream wire shape so Loki / Logstash / Datadog sinks
|
|
52
71
|
* configured for an Auth0 tenant can be pointed at authhero unchanged.
|
|
53
72
|
*
|
|
@@ -66,6 +85,7 @@ export declare class LogStreamDestination implements EventDestination {
|
|
|
66
85
|
accepts(event: AuditEvent): boolean;
|
|
67
86
|
transform(event: AuditEvent): StreamDelivery;
|
|
68
87
|
deliver(events: StreamDelivery[]): Promise<void>;
|
|
88
|
+
private deliverToFirehose;
|
|
69
89
|
private deliverToStream;
|
|
70
90
|
}
|
|
71
91
|
export {};
|
|
@@ -7,10 +7,12 @@ import type { EnrichedClient } from "./client";
|
|
|
7
7
|
* fallback rather than the tenant's actual connection. Centralised here so the
|
|
8
8
|
* HTML route and the screen handler resolve it identically.
|
|
9
9
|
*
|
|
10
|
+
* The connection is the one {@link resolveClientDatabaseConnection} picks.
|
|
11
|
+
*
|
|
10
12
|
* @param fallbackConnection connection name to use when the client has no
|
|
11
13
|
* database connection (typically `user.connection`).
|
|
12
14
|
*/
|
|
13
|
-
export declare function resolvePasswordConnection(client: EnrichedClient, fallbackConnection: string): {
|
|
15
|
+
export declare function resolvePasswordConnection(client: EnrichedClient, fallbackConnection: string, requested?: string): {
|
|
14
16
|
connection: string;
|
|
15
17
|
connectionId?: string;
|
|
16
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PromptPartials } from "@authhero/adapter-interfaces";
|
|
2
|
-
export declare const promptPartialPrompts: readonly ["signup", "signup-id", "signup-password", "login", "login-id", "login-password", "login-passwordless", "login-passwordless-sms-otp", "login-passwordless-email-code"];
|
|
2
|
+
export declare const promptPartialPrompts: readonly ["signup", "signup-id", "signup-password", "login", "login-id", "login-password", "login-passwordless", "login-passwordless-sms-otp", "login-passwordless-email-code", "reset-password", "mfa-otp", "mfa-phone", "mfa-login-options"];
|
|
3
3
|
export declare const MAX_PROMPT_PARTIAL_LENGTH = 100000;
|
|
4
4
|
export declare function isAllowedPromptPartialMappingTarget(target: string): boolean;
|
|
5
5
|
export declare function sanitizePromptPartials(partials: PromptPartials): PromptPartials;
|
|
@@ -14,9 +14,9 @@ export declare const USERINFO_RESERVED_CLAIMS: readonly ["iss", "sub", "aud", "e
|
|
|
14
14
|
* vendor/tenant for downstream APIs while `sub` stays `auth-service`.
|
|
15
15
|
* Client-bound mints keep `azp` locked (see below).
|
|
16
16
|
*/
|
|
17
|
-
export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "org_name" | "
|
|
17
|
+
export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("scope" | "tenant_id" | "client_id" | "org_name" | "sid" | "sub" | "jti" | "iat" | "org_id" | "iss" | "exp" | "aud" | "auth_time" | "acr" | "amr" | "gty" | "nbf" | "act" | "permissions" | "requested_userinfo_claims")[];
|
|
18
18
|
/** Client-bound mints: `azp` must stay the registered client id. */
|
|
19
|
-
export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("
|
|
19
|
+
export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("scope" | "tenant_id" | "client_id" | "org_name" | "sid" | "sub" | "jti" | "iat" | "org_id" | "iss" | "exp" | "aud" | "auth_time" | "acr" | "amr" | "azp" | "gty" | "nbf" | "act" | "permissions" | "requested_userinfo_claims")[];
|
|
20
20
|
export type AccessTokenReservedClaim = (typeof ACCESS_TOKEN_RESERVED_CLAIMS)[number];
|
|
21
21
|
export type IdTokenReservedClaim = (typeof ID_TOKEN_RESERVED_CLAIMS)[number];
|
|
22
22
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
|
|
2
|
-
import type { ActionExecutionLogCapture, WebhookInvoker } from "../types/AuthHeroConfig";
|
|
2
|
+
import type { ActionExecutionLogCapture, OutboxPipelineConfig, WebhookInvoker } from "../types/AuthHeroConfig";
|
|
3
3
|
import type { OutboxMetricsSink } from "../types/OutboxMetrics";
|
|
4
4
|
export interface RunOutboxRelayConfig {
|
|
5
5
|
/** Same `DataAdapters` passed to `init()`. Must include `outbox` to drain. */
|
|
@@ -45,6 +45,12 @@ export interface RunOutboxRelayConfig {
|
|
|
45
45
|
* the events this cron drain handles, tagged `source: "cron"`.
|
|
46
46
|
*/
|
|
47
47
|
metrics?: OutboxMetricsSink;
|
|
48
|
+
/**
|
|
49
|
+
* Same value as `init({ outbox: { pipeline } })`. Pass it so events retried
|
|
50
|
+
* by this drain still reach the archive — otherwise an event whose inline
|
|
51
|
+
* archive delivery failed is marked processed here without being archived.
|
|
52
|
+
*/
|
|
53
|
+
pipeline?: OutboxPipelineConfig;
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
50
56
|
* One-call outbox relay for cron / scheduled handlers.
|
|
@@ -52,7 +58,8 @@ export interface RunOutboxRelayConfig {
|
|
|
52
58
|
* Internally:
|
|
53
59
|
* 1. Skips gracefully when `dataAdapter.outbox` is undefined.
|
|
54
60
|
* 2. Builds the same destination array as the inline dispatcher
|
|
55
|
-
* (`LogsDestination`, `WebhookDestination`, `RegistrationFinalizerDestination
|
|
61
|
+
* (`LogsDestination`, `WebhookDestination`, `RegistrationFinalizerDestination`,
|
|
62
|
+
* plus the Pipelines archive when `pipeline` is passed).
|
|
56
63
|
* 3. Mints per-tenant service tokens via the same in-process path
|
|
57
64
|
* (`createServiceTokenCore`) that the request-time webhookInvoker uses,
|
|
58
65
|
* driven by the supplied dataAdapter.
|