authhero 9.18.0 → 9.20.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/index.esm.js +1 -1
- package/dist/authhero.cjs +185 -173
- package/dist/authhero.d.ts +389 -159
- package/dist/authhero.mjs +19766 -17178
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/email-verification.d.ts +74 -0
- package/dist/types/authentication-flows/password.d.ts +3 -2
- package/dist/types/authentication-flows/passwordless.d.ts +2 -2
- package/dist/types/emails/index.d.ts +27 -1
- package/dist/types/generated/locale-types.d.ts +282 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +2 -2
- package/dist/types/helpers/default-destinations.d.ts +7 -1
- package/dist/types/helpers/http-certificate-issuer.d.ts +55 -0
- package/dist/types/helpers/logging.d.ts +5 -0
- package/dist/types/helpers/outbox-destinations/code-hooks.d.ts +5 -1
- package/dist/types/helpers/outbox-destinations/log-streams.d.ts +3 -0
- package/dist/types/helpers/renew-signing-certificates.d.ts +61 -0
- package/dist/types/helpers/request-data.d.ts +15 -0
- package/dist/types/helpers/reserved-claims.d.ts +2 -2
- package/dist/types/helpers/run-outbox-relay.d.ts +7 -1
- package/dist/types/hooks/codehooks.d.ts +14 -1
- package/dist/types/index.d.ts +211 -155
- package/dist/types/routes/auth-api/index.d.ts +26 -26
- package/dist/types/routes/auth-api/passwordless.d.ts +18 -18
- 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 +1 -1
- package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
- package/dist/types/routes/management-api/branding.d.ts +1 -1
- package/dist/types/routes/management-api/client-grants.d.ts +9 -9
- package/dist/types/routes/management-api/connections.d.ts +6 -6
- package/dist/types/routes/management-api/email-templates.d.ts +18 -18
- package/dist/types/routes/management-api/failed-events.d.ts +53 -1
- 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/index.d.ts +178 -126
- package/dist/types/routes/management-api/keys.d.ts +8 -8
- package/dist/types/routes/management-api/log-streams.d.ts +6 -6
- 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 +3 -3
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/tenant-operations.d.ts +5 -5
- package/dist/types/routes/management-api/tenants.d.ts +1 -1
- package/dist/types/routes/management-api/themes.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +33 -33
- package/dist/types/routes/universal-login/common.d.ts +4 -4
- package/dist/types/routes/universal-login/error-page.d.ts +9 -2
- package/dist/types/routes/universal-login/flow-api.d.ts +4 -4
- package/dist/types/routes/universal-login/sanitization-utils.d.ts +7 -0
- package/dist/types/routes/universal-login/screen-prompt-map.d.ts +2 -0
- package/dist/types/routes/universal-login/screens/email-verification.d.ts +29 -0
- package/dist/types/routes/universal-login/screens/handler-error.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/reset-password.d.ts +5 -1
- package/dist/types/routes/universal-login/screens/signup.d.ts +6 -0
- package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
- package/dist/types/state-machines/login-session.d.ts +1 -1
- package/dist/types/types/AuthHeroConfig.d.ts +25 -0
- package/dist/types/types/Bindings.d.ts +8 -1
- package/dist/types/types/Variables.d.ts +18 -1
- package/package.json +6 -6
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
import { LoginSession, User } from "@authhero/adapter-interfaces";
|
|
3
|
+
import { Bindings, Variables } from "../types";
|
|
4
|
+
import { EnrichedClient } from "../helpers/client";
|
|
5
|
+
export type EmailVerificationMethod = "link" | "code";
|
|
6
|
+
/**
|
|
7
|
+
* How a login that is blocked on an unverified email (client
|
|
8
|
+
* `email_validation: "enforced"`) should verify it. UI flows pass this to
|
|
9
|
+
* `passwordGrant`; without it the grant falls back to emailing a link and
|
|
10
|
+
* failing the login session (token endpoint, legacy /u routes).
|
|
11
|
+
*/
|
|
12
|
+
export interface LoginEmailVerification {
|
|
13
|
+
method: EmailVerificationMethod;
|
|
14
|
+
/** Link method only: where the emailed link returns the user. */
|
|
15
|
+
resultUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PendingLoginEmailVerification {
|
|
18
|
+
/** The password-validated identity whose email must be verified. */
|
|
19
|
+
user_id: string;
|
|
20
|
+
/** The connection the password login targeted. */
|
|
21
|
+
connection: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The pending verification of a still-pending login session, or undefined
|
|
25
|
+
* when no password has been validated for it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getPendingLoginEmailVerification(loginSession: LoginSession): PendingLoginEmailVerification | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Record (or with `undefined`, clear) the pending verification on the login
|
|
30
|
+
* session. Re-reads the session so other `state_data` keys aren't clobbered.
|
|
31
|
+
*/
|
|
32
|
+
export declare function setPendingLoginEmailVerification(ctx: Context<{
|
|
33
|
+
Bindings: Bindings;
|
|
34
|
+
Variables: Variables;
|
|
35
|
+
}>, tenantId: string, loginSessionId: string, pending: PendingLoginEmailVerification | undefined): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* The database connection's `attributes.email.verification_method`. Defaults
|
|
38
|
+
* to "code" like the u2 password reset, so the user stays on the login page
|
|
39
|
+
* instead of depending on an emailed link.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getEmailVerificationMethod(client: EnrichedClient): EmailVerificationMethod;
|
|
42
|
+
/**
|
|
43
|
+
* Mint a one-time code bound to the login session and email it. The code is
|
|
44
|
+
* only issued after the password has been validated, so redeeming it proves
|
|
45
|
+
* both factors and lets the same login session complete.
|
|
46
|
+
*/
|
|
47
|
+
export declare function sendLoginEmailVerificationCode(ctx: Context<{
|
|
48
|
+
Bindings: Bindings;
|
|
49
|
+
Variables: Variables;
|
|
50
|
+
}>, params: {
|
|
51
|
+
client: EnrichedClient;
|
|
52
|
+
user: User;
|
|
53
|
+
loginSession: LoginSession;
|
|
54
|
+
connection: string;
|
|
55
|
+
language?: string;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
export type VerifyLoginEmailCodeResult = {
|
|
58
|
+
ok: true;
|
|
59
|
+
/** The primary user to complete the login as. */
|
|
60
|
+
user: User;
|
|
61
|
+
/** The connection the password login targeted. */
|
|
62
|
+
connection: string;
|
|
63
|
+
} | {
|
|
64
|
+
ok: false;
|
|
65
|
+
reason: "invalid" | "rate_limited";
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Redeem a login email-verification code: marks the verified identity's
|
|
69
|
+
* email as verified and returns the user to complete the login with.
|
|
70
|
+
*/
|
|
71
|
+
export declare function verifyLoginEmailCode(ctx: Context<{
|
|
72
|
+
Bindings: Bindings;
|
|
73
|
+
Variables: Variables;
|
|
74
|
+
}>, client: EnrichedClient, loginSession: LoginSession, code: string): Promise<VerifyLoginEmailCodeResult>;
|
|
@@ -2,6 +2,7 @@ import { Context } from "hono";
|
|
|
2
2
|
import { AuthParams, LoginSession, User } from "@authhero/adapter-interfaces";
|
|
3
3
|
import { EnrichedClient } from "../helpers/client";
|
|
4
4
|
import { Bindings, GrantFlowUserResult, Variables } from "../types";
|
|
5
|
+
import { LoginEmailVerification } from "./email-verification";
|
|
5
6
|
/**
|
|
6
7
|
* Clear the failed-login counter for a user. Failed logins are always
|
|
7
8
|
* recorded on the primary account (see {@link recordFailedLogin}), so this
|
|
@@ -23,13 +24,13 @@ export declare function passwordGrant(ctx: Context<{
|
|
|
23
24
|
Variables: Variables;
|
|
24
25
|
}>, client: EnrichedClient, authParams: AuthParams & {
|
|
25
26
|
password: string;
|
|
26
|
-
}, loginSession?: LoginSession, realm?: string): Promise<GrantFlowUserResult>;
|
|
27
|
+
}, loginSession?: LoginSession, realm?: string, emailVerification?: LoginEmailVerification): Promise<GrantFlowUserResult>;
|
|
27
28
|
export declare function loginWithPassword(ctx: Context<{
|
|
28
29
|
Bindings: Bindings;
|
|
29
30
|
Variables: Variables;
|
|
30
31
|
}>, client: EnrichedClient, authParams: AuthParams & {
|
|
31
32
|
password: string;
|
|
32
|
-
}, loginSession?: LoginSession, ticketAuth?: boolean, realm?: string): Promise<Response>;
|
|
33
|
+
}, loginSession?: LoginSession, ticketAuth?: boolean, realm?: string, emailVerification?: LoginEmailVerification): Promise<Response>;
|
|
33
34
|
export declare function changePassword(ctx: Context<{
|
|
34
35
|
Bindings: Bindings;
|
|
35
36
|
Variables: Variables;
|
|
@@ -561,8 +561,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
|
|
|
561
561
|
} | undefined;
|
|
562
562
|
authenticated_at?: string | undefined;
|
|
563
563
|
};
|
|
564
|
-
connectionType: "
|
|
565
|
-
authConnection: "
|
|
564
|
+
connectionType: "username" | "sms" | "email";
|
|
565
|
+
authConnection: "username" | "sms" | "email";
|
|
566
566
|
session_id: string | undefined;
|
|
567
567
|
authParams: {
|
|
568
568
|
audience?: string | undefined;
|
|
@@ -45,10 +45,36 @@ export declare function sendLink(ctx: Context<{
|
|
|
45
45
|
Bindings: Bindings;
|
|
46
46
|
Variables: Variables;
|
|
47
47
|
}>, { to, code, authParams, language }: SendLinkParams): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Where the verification landing page's "Continue" button should lead. Stored
|
|
50
|
+
* on the ticket so the page can send the user back to the app that triggered
|
|
51
|
+
* the email — it never resumes the original login session.
|
|
52
|
+
*/
|
|
53
|
+
export type EmailVerificationReturnTo = {
|
|
54
|
+
client_id?: string;
|
|
55
|
+
redirect_uri?: string;
|
|
56
|
+
};
|
|
57
|
+
export interface SendValidateEmailAddressOptions extends EmailVerificationReturnTo {
|
|
58
|
+
/**
|
|
59
|
+
* Where the ticket endpoint redirects after verifying. Set by the login
|
|
60
|
+
* flow so the link lands the user back on the login screen of the session
|
|
61
|
+
* that asked for verification instead of the landing page.
|
|
62
|
+
*/
|
|
63
|
+
resultUrl?: string;
|
|
64
|
+
}
|
|
48
65
|
export declare function sendValidateEmailAddress(ctx: Context<{
|
|
49
66
|
Bindings: Bindings;
|
|
50
67
|
Variables: Variables;
|
|
51
|
-
}>, user: User, language?: string): Promise<void>;
|
|
68
|
+
}>, user: User, language?: string, { resultUrl, client_id, redirect_uri }?: SendValidateEmailAddressOptions): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Email a one-time code that verifies the user's email address. Used by the
|
|
71
|
+
* login flow when the database connection's `verification_method` is "code";
|
|
72
|
+
* the code is entered on the u2 email-verification screen.
|
|
73
|
+
*/
|
|
74
|
+
export declare function sendEmailVerificationCode(ctx: Context<{
|
|
75
|
+
Bindings: Bindings;
|
|
76
|
+
Variables: Variables;
|
|
77
|
+
}>, user: User, code: string, language?: string): Promise<void>;
|
|
52
78
|
export declare function sendSignupValidateEmailAddress(ctx: Context<{
|
|
53
79
|
Bindings: Bindings;
|
|
54
80
|
Variables: Variables;
|
|
@@ -20,6 +20,162 @@ export interface CommonScreen {
|
|
|
20
20
|
termsShortText: () => string;
|
|
21
21
|
tryAgainText: () => string;
|
|
22
22
|
}
|
|
23
|
+
export interface CommonAccountScreen {
|
|
24
|
+
title: () => string;
|
|
25
|
+
description: () => string;
|
|
26
|
+
editProfileLabel: () => string;
|
|
27
|
+
editProfileDetail: () => string;
|
|
28
|
+
securityLabel: () => string;
|
|
29
|
+
securityDetail: () => string;
|
|
30
|
+
securityMethodsCountOne: (vars: {
|
|
31
|
+
count: string;
|
|
32
|
+
}) => string;
|
|
33
|
+
securityMethodsCount: (vars: {
|
|
34
|
+
count: string;
|
|
35
|
+
}) => string;
|
|
36
|
+
passkeysLabel: () => string;
|
|
37
|
+
passkeysDetail: () => string;
|
|
38
|
+
passkeysCountOne: (vars: {
|
|
39
|
+
count: string;
|
|
40
|
+
}) => string;
|
|
41
|
+
passkeysCount: (vars: {
|
|
42
|
+
count: string;
|
|
43
|
+
}) => string;
|
|
44
|
+
linkedAccountsLabel: () => string;
|
|
45
|
+
linkedAccountsDetail: () => string;
|
|
46
|
+
linkedAccountsCountOne: (vars: {
|
|
47
|
+
count: string;
|
|
48
|
+
}) => string;
|
|
49
|
+
linkedAccountsCount: (vars: {
|
|
50
|
+
count: string;
|
|
51
|
+
}) => string;
|
|
52
|
+
deleteAccountLabel: () => string;
|
|
53
|
+
deleteAccountDetail: () => string;
|
|
54
|
+
logoutText: () => string;
|
|
55
|
+
}
|
|
56
|
+
export interface CommonAccountProfileScreen {
|
|
57
|
+
title: () => string;
|
|
58
|
+
description: () => string;
|
|
59
|
+
givenNameLabel: () => string;
|
|
60
|
+
familyNameLabel: () => string;
|
|
61
|
+
nicknameLabel: () => string;
|
|
62
|
+
phoneNumberLabel: () => string;
|
|
63
|
+
pictureLabel: () => string;
|
|
64
|
+
buttonText: () => string;
|
|
65
|
+
backToAccountText: () => string;
|
|
66
|
+
updateFailed: () => string;
|
|
67
|
+
}
|
|
68
|
+
export interface CommonAccountDeleteScreen {
|
|
69
|
+
title: () => string;
|
|
70
|
+
description: () => string;
|
|
71
|
+
warningTitle: () => string;
|
|
72
|
+
warningText: () => string;
|
|
73
|
+
confirmationLabel: (vars: {
|
|
74
|
+
confirmationWord: string;
|
|
75
|
+
}) => string;
|
|
76
|
+
buttonText: () => string;
|
|
77
|
+
cancelText: () => string;
|
|
78
|
+
confirmationError: (vars: {
|
|
79
|
+
confirmationWord: string;
|
|
80
|
+
}) => string;
|
|
81
|
+
deleteSuccess: () => string;
|
|
82
|
+
deleteFailed: () => string;
|
|
83
|
+
}
|
|
84
|
+
export interface CommonAccountLinkedScreen {
|
|
85
|
+
title: () => string;
|
|
86
|
+
description: () => string;
|
|
87
|
+
noLinkedAccounts: () => string;
|
|
88
|
+
unlinkButtonText: () => string;
|
|
89
|
+
backToAccountText: () => string;
|
|
90
|
+
unlinkSuccess: () => string;
|
|
91
|
+
unlinkFailed: () => string;
|
|
92
|
+
}
|
|
93
|
+
export interface CommonAccountSecurityScreen {
|
|
94
|
+
title: () => string;
|
|
95
|
+
description: () => string;
|
|
96
|
+
noEnrollments: () => string;
|
|
97
|
+
addedOn: (vars: {
|
|
98
|
+
date: string;
|
|
99
|
+
}) => string;
|
|
100
|
+
removeButtonText: () => string;
|
|
101
|
+
addTotpLabel: () => string;
|
|
102
|
+
addTotpDetail: () => string;
|
|
103
|
+
addSmsLabel: () => string;
|
|
104
|
+
addSmsDetail: () => string;
|
|
105
|
+
typeTotp: () => string;
|
|
106
|
+
typePhone: () => string;
|
|
107
|
+
typeEmail: () => string;
|
|
108
|
+
typePush: () => string;
|
|
109
|
+
typeWebauthn: () => string;
|
|
110
|
+
backToAccountText: () => string;
|
|
111
|
+
enrollmentNotFound: () => string;
|
|
112
|
+
removeSuccess: () => string;
|
|
113
|
+
removeFailed: () => string;
|
|
114
|
+
}
|
|
115
|
+
export interface CommonAccountPasskeysScreen {
|
|
116
|
+
title: () => string;
|
|
117
|
+
description: () => string;
|
|
118
|
+
noPasskeysText: () => string;
|
|
119
|
+
defaultPasskeyName: () => string;
|
|
120
|
+
syncedBadgeText: () => string;
|
|
121
|
+
addedOnText: (vars: {
|
|
122
|
+
date: string;
|
|
123
|
+
}) => string;
|
|
124
|
+
renameButtonText: () => string;
|
|
125
|
+
removeButtonText: () => string;
|
|
126
|
+
renamePromptText: () => string;
|
|
127
|
+
addPasskeyButtonText: () => string;
|
|
128
|
+
backToAccountText: () => string;
|
|
129
|
+
logoutText: () => string;
|
|
130
|
+
passkeyNotFoundText: () => string;
|
|
131
|
+
passkeyRemovedText: () => string;
|
|
132
|
+
removeFailedText: () => string;
|
|
133
|
+
invalidNameText: () => string;
|
|
134
|
+
passkeyRenamedText: () => string;
|
|
135
|
+
renameFailedText: () => string;
|
|
136
|
+
startRegistrationFailedText: () => string;
|
|
137
|
+
missingCredentialText: () => string;
|
|
138
|
+
challengeExpiredText: () => string;
|
|
139
|
+
invalidCredentialText: () => string;
|
|
140
|
+
verificationFailedText: () => string;
|
|
141
|
+
passkeyAddedText: () => string;
|
|
142
|
+
registrationFailedText: () => string;
|
|
143
|
+
}
|
|
144
|
+
export interface CommonAccountMfaPhoneEnrollmentScreen {
|
|
145
|
+
title: () => string;
|
|
146
|
+
description: () => string;
|
|
147
|
+
phoneLabel: () => string;
|
|
148
|
+
sendCodeButtonText: () => string;
|
|
149
|
+
backToSecurityText: () => string;
|
|
150
|
+
verifyTitle: () => string;
|
|
151
|
+
verifyDescription: () => string;
|
|
152
|
+
codeSentText: (vars: {
|
|
153
|
+
phoneNumber: string;
|
|
154
|
+
}) => string;
|
|
155
|
+
codeSentToYourPhoneText: () => string;
|
|
156
|
+
codeLabel: () => string;
|
|
157
|
+
codePlaceholder: () => string;
|
|
158
|
+
verifyButtonText: () => string;
|
|
159
|
+
noPhoneText: () => string;
|
|
160
|
+
invalidPhoneText: () => string;
|
|
161
|
+
sendCodeFailedText: () => string;
|
|
162
|
+
noCodeText: () => string;
|
|
163
|
+
invalidCodeText: () => string;
|
|
164
|
+
sessionInvalidText: () => string;
|
|
165
|
+
}
|
|
166
|
+
export interface CommonAccountMfaTotpEnrollmentScreen {
|
|
167
|
+
title: () => string;
|
|
168
|
+
description: () => string;
|
|
169
|
+
qrCodeAltText: () => string;
|
|
170
|
+
manualKeyText: () => string;
|
|
171
|
+
codeLabel: () => string;
|
|
172
|
+
codePlaceholder: () => string;
|
|
173
|
+
verifyButtonText: () => string;
|
|
174
|
+
backToSecurityText: () => string;
|
|
175
|
+
noCodeText: () => string;
|
|
176
|
+
invalidCodeText: () => string;
|
|
177
|
+
verificationFailedText: () => string;
|
|
178
|
+
}
|
|
23
179
|
export interface ConsentScreen {
|
|
24
180
|
buttonText: () => string;
|
|
25
181
|
cancelButtonText: () => string;
|
|
@@ -35,6 +191,51 @@ export interface ConsentScreen {
|
|
|
35
191
|
title: (vars: {
|
|
36
192
|
clientName: string;
|
|
37
193
|
}) => string;
|
|
194
|
+
accessAccountText: (vars: {
|
|
195
|
+
tenantName: string;
|
|
196
|
+
userName: string;
|
|
197
|
+
}) => string;
|
|
198
|
+
notAuthenticated: () => string;
|
|
199
|
+
sessionExpired: () => string;
|
|
200
|
+
consentStorageNotConfigured: () => string;
|
|
201
|
+
}
|
|
202
|
+
export interface ConsentConnectConsentScreen {
|
|
203
|
+
title: () => string;
|
|
204
|
+
description: (vars: {
|
|
205
|
+
domain: string;
|
|
206
|
+
}) => string;
|
|
207
|
+
connectAccountText: (vars: {
|
|
208
|
+
tenantName: string;
|
|
209
|
+
userName: string;
|
|
210
|
+
}) => string;
|
|
211
|
+
workspaceLabel: () => string;
|
|
212
|
+
apiLabel: () => string;
|
|
213
|
+
permissionsLabel: () => string;
|
|
214
|
+
localDevBadge: () => string;
|
|
215
|
+
localDevTooltip: () => string;
|
|
216
|
+
buttonText: () => string;
|
|
217
|
+
cancelText: () => string;
|
|
218
|
+
notAuthenticated: () => string;
|
|
219
|
+
sessionExpired: () => string;
|
|
220
|
+
workspaceSelectionRequired: () => string;
|
|
221
|
+
noWorkspaceAccess: () => string;
|
|
222
|
+
workspaceNotFound: () => string;
|
|
223
|
+
}
|
|
224
|
+
export interface ConsentConnectTenantSelectScreen {
|
|
225
|
+
title: () => string;
|
|
226
|
+
description: (vars: {
|
|
227
|
+
domain: string;
|
|
228
|
+
tenantName: string;
|
|
229
|
+
}) => string;
|
|
230
|
+
noWorkspacesDescription: () => string;
|
|
231
|
+
noWorkspacesText: (vars: {
|
|
232
|
+
tenantName: string;
|
|
233
|
+
}) => string;
|
|
234
|
+
cancelText: () => string;
|
|
235
|
+
notAuthenticated: () => string;
|
|
236
|
+
sessionExpired: () => string;
|
|
237
|
+
noWorkspaceSelected: () => string;
|
|
238
|
+
noWorkspaceAccess: () => string;
|
|
38
239
|
}
|
|
39
240
|
export interface DeviceFlowScreen {
|
|
40
241
|
buttonText: () => string;
|
|
@@ -65,11 +266,17 @@ export interface EmailOtpChallengeScreen {
|
|
|
65
266
|
title: () => string;
|
|
66
267
|
unexpectedError: () => string;
|
|
67
268
|
usePasswordText: () => string;
|
|
269
|
+
tooManyRequests: () => string;
|
|
68
270
|
}
|
|
69
271
|
export interface EmailVerificationScreen {
|
|
70
272
|
description: (vars: {
|
|
71
273
|
email: string;
|
|
72
274
|
}) => string;
|
|
275
|
+
linkAlreadyUsed: () => string;
|
|
276
|
+
linkInvalid: () => string;
|
|
277
|
+
linkInvalidOrExpired: () => string;
|
|
278
|
+
linkInvalidTitle: () => string;
|
|
279
|
+
linkWrongType: () => string;
|
|
73
280
|
pageTitle: (vars: {
|
|
74
281
|
clientName: string;
|
|
75
282
|
}) => string;
|
|
@@ -78,6 +285,39 @@ export interface EmailVerificationScreen {
|
|
|
78
285
|
successTitle: () => string;
|
|
79
286
|
title: () => string;
|
|
80
287
|
}
|
|
288
|
+
export interface EmailVerificationEmailVerificationCodeScreen {
|
|
289
|
+
buttonText: () => string;
|
|
290
|
+
codeLabel: () => string;
|
|
291
|
+
codePlaceholder: () => string;
|
|
292
|
+
defaultDescription: () => string;
|
|
293
|
+
description: (vars: {
|
|
294
|
+
email: string;
|
|
295
|
+
}) => string;
|
|
296
|
+
invalidCode: () => string;
|
|
297
|
+
noCode: () => string;
|
|
298
|
+
pageTitle: (vars: {
|
|
299
|
+
clientName: string;
|
|
300
|
+
}) => string;
|
|
301
|
+
resendFailed: () => string;
|
|
302
|
+
resendSuccess: () => string;
|
|
303
|
+
resendText: () => string;
|
|
304
|
+
sessionExpired: () => string;
|
|
305
|
+
title: () => string;
|
|
306
|
+
tooManyAttempts: () => string;
|
|
307
|
+
}
|
|
308
|
+
export interface EmailVerificationEmailVerificationLinkSentScreen {
|
|
309
|
+
defaultDescription: () => string;
|
|
310
|
+
description: (vars: {
|
|
311
|
+
email: string;
|
|
312
|
+
}) => string;
|
|
313
|
+
pageTitle: (vars: {
|
|
314
|
+
clientName: string;
|
|
315
|
+
}) => string;
|
|
316
|
+
resendFailed: () => string;
|
|
317
|
+
resendSuccess: () => string;
|
|
318
|
+
resendText: () => string;
|
|
319
|
+
title: () => string;
|
|
320
|
+
}
|
|
81
321
|
export interface InvitationScreen {
|
|
82
322
|
acceptButtonText: () => string;
|
|
83
323
|
description: (vars: {
|
|
@@ -89,6 +329,8 @@ export interface InvitationScreen {
|
|
|
89
329
|
clientName: string;
|
|
90
330
|
}) => string;
|
|
91
331
|
title: () => string;
|
|
332
|
+
defaultOrganizationName: () => string;
|
|
333
|
+
acceptFailed: () => string;
|
|
92
334
|
}
|
|
93
335
|
export interface LoginScreen {
|
|
94
336
|
alertListTitle: () => string;
|
|
@@ -145,6 +387,9 @@ export interface LoginScreen {
|
|
|
145
387
|
}) => string;
|
|
146
388
|
passkeyButtonText: () => string;
|
|
147
389
|
wrongCredentials: () => string;
|
|
390
|
+
userBlocked: () => string;
|
|
391
|
+
tooManyRequests: () => string;
|
|
392
|
+
unexpectedError: () => string;
|
|
148
393
|
}
|
|
149
394
|
export interface LoginIdScreen {
|
|
150
395
|
alertListTitle: () => string;
|
|
@@ -272,6 +517,9 @@ export interface LoginPasswordScreen {
|
|
|
272
517
|
"user-blocked": () => string;
|
|
273
518
|
"wrong-credentials": () => string;
|
|
274
519
|
sendCodeText: () => string;
|
|
520
|
+
sessionExpired: () => string;
|
|
521
|
+
tooManyRequests: () => string;
|
|
522
|
+
unexpectedError: () => string;
|
|
275
523
|
}
|
|
276
524
|
export interface LoginPasswordlessScreen {
|
|
277
525
|
authMethodEmail: () => string;
|
|
@@ -345,6 +593,8 @@ export interface MfaOtpMfaTotpEnrollmentScreen {
|
|
|
345
593
|
clientName: string;
|
|
346
594
|
}) => string;
|
|
347
595
|
enrollmentComplete: () => string;
|
|
596
|
+
pickAuthenticatorText: () => string;
|
|
597
|
+
qrCodeAltText: () => string;
|
|
348
598
|
}
|
|
349
599
|
export interface MfaOtpMfaTotpChallengeScreen {
|
|
350
600
|
title: () => string;
|
|
@@ -494,6 +744,9 @@ export interface PasskeysPasskeyEnrollmentScreen {
|
|
|
494
744
|
pageTitle: (vars: {
|
|
495
745
|
clientName: string;
|
|
496
746
|
}) => string;
|
|
747
|
+
sessionExpired: () => string;
|
|
748
|
+
enrollmentRequired: () => string;
|
|
749
|
+
challengeExpired: () => string;
|
|
497
750
|
}
|
|
498
751
|
export interface PasskeysPasskeyChallengeScreen {
|
|
499
752
|
title: () => string;
|
|
@@ -504,6 +757,7 @@ export interface PasskeysPasskeyChallengeScreen {
|
|
|
504
757
|
pageTitle: (vars: {
|
|
505
758
|
clientName: string;
|
|
506
759
|
}) => string;
|
|
760
|
+
sessionExpired: () => string;
|
|
507
761
|
}
|
|
508
762
|
export interface OrganizationsScreen {
|
|
509
763
|
description: () => string;
|
|
@@ -535,6 +789,8 @@ export interface ResetPasswordScreen {
|
|
|
535
789
|
successTitle: () => string;
|
|
536
790
|
title: () => string;
|
|
537
791
|
"user-not-found": () => string;
|
|
792
|
+
noPassword: () => string;
|
|
793
|
+
sessionExpired: () => string;
|
|
538
794
|
}
|
|
539
795
|
export interface ResetPasswordResetPasswordCodeScreen {
|
|
540
796
|
backToLoginText: () => string;
|
|
@@ -562,6 +818,7 @@ export interface ResetPasswordResetPasswordCodeScreen {
|
|
|
562
818
|
resendText: () => string;
|
|
563
819
|
sessionExpired: () => string;
|
|
564
820
|
title: () => string;
|
|
821
|
+
noPassword: () => string;
|
|
565
822
|
}
|
|
566
823
|
export interface SignupScreen {
|
|
567
824
|
buttonText: () => string;
|
|
@@ -595,6 +852,8 @@ export interface SignupScreen {
|
|
|
595
852
|
"username-already-exists": () => string;
|
|
596
853
|
usernamePlaceholder: () => string;
|
|
597
854
|
verifyEmailText: () => string;
|
|
855
|
+
confirmPasswordRequired: () => string;
|
|
856
|
+
createUserFailed: () => string;
|
|
598
857
|
}
|
|
599
858
|
export interface SignupIdScreen {
|
|
600
859
|
buttonText: () => string;
|
|
@@ -629,6 +888,16 @@ export interface SignupPasswordScreen {
|
|
|
629
888
|
passwordPlaceholder: () => string;
|
|
630
889
|
showPasswordText: () => string;
|
|
631
890
|
title: () => string;
|
|
891
|
+
passwordTooShort: (vars: {
|
|
892
|
+
minLength: string;
|
|
893
|
+
}) => string;
|
|
894
|
+
passwordMissingLowercase: () => string;
|
|
895
|
+
passwordMissingUppercase: () => string;
|
|
896
|
+
passwordMissingNumber: () => string;
|
|
897
|
+
passwordMissingSpecial: () => string;
|
|
898
|
+
passwordReused: () => string;
|
|
899
|
+
passwordContainsPersonalInfo: () => string;
|
|
900
|
+
passwordContainsForbiddenWord: () => string;
|
|
632
901
|
}
|
|
633
902
|
export interface SmsOtpChallengeScreen {
|
|
634
903
|
buttonText: () => string;
|
|
@@ -647,6 +916,7 @@ export interface SmsOtpChallengeScreen {
|
|
|
647
916
|
sessionExpired: () => string;
|
|
648
917
|
title: () => string;
|
|
649
918
|
unexpectedError: () => string;
|
|
919
|
+
tooManyRequests: () => string;
|
|
650
920
|
}
|
|
651
921
|
export interface StatusScreen {
|
|
652
922
|
continueButtonText: () => string;
|
|
@@ -659,10 +929,22 @@ export interface StatusScreen {
|
|
|
659
929
|
}
|
|
660
930
|
export interface ScreenMap {
|
|
661
931
|
"common.common": CommonScreen;
|
|
932
|
+
"common.account": CommonAccountScreen;
|
|
933
|
+
"common.account-profile": CommonAccountProfileScreen;
|
|
934
|
+
"common.account-delete": CommonAccountDeleteScreen;
|
|
935
|
+
"common.account-linked": CommonAccountLinkedScreen;
|
|
936
|
+
"common.account-security": CommonAccountSecurityScreen;
|
|
937
|
+
"common.account-passkeys": CommonAccountPasskeysScreen;
|
|
938
|
+
"common.account-mfa-phone-enrollment": CommonAccountMfaPhoneEnrollmentScreen;
|
|
939
|
+
"common.account-mfa-totp-enrollment": CommonAccountMfaTotpEnrollmentScreen;
|
|
662
940
|
"consent.consent": ConsentScreen;
|
|
941
|
+
"consent.connect-consent": ConsentConnectConsentScreen;
|
|
942
|
+
"consent.connect-tenant-select": ConsentConnectTenantSelectScreen;
|
|
663
943
|
"device-flow.device-flow": DeviceFlowScreen;
|
|
664
944
|
"email-otp-challenge.email-otp-challenge": EmailOtpChallengeScreen;
|
|
665
945
|
"email-verification.email-verification": EmailVerificationScreen;
|
|
946
|
+
"email-verification.email-verification-code": EmailVerificationEmailVerificationCodeScreen;
|
|
947
|
+
"email-verification.email-verification-link-sent": EmailVerificationEmailVerificationLinkSentScreen;
|
|
666
948
|
"invitation.invitation": InvitationScreen;
|
|
667
949
|
"login.login": LoginScreen;
|
|
668
950
|
"login-id.login-id": LoginIdScreen;
|
|
@@ -23,11 +23,11 @@ export declare const dcrRequestSchema: z.ZodObject<{
|
|
|
23
23
|
grant_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
24
|
response_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
25
|
token_endpoint_auth_method: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
none: "none";
|
|
27
|
+
private_key_jwt: "private_key_jwt";
|
|
26
28
|
client_secret_post: "client_secret_post";
|
|
27
29
|
client_secret_basic: "client_secret_basic";
|
|
28
|
-
none: "none";
|
|
29
30
|
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>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
|
|
2
2
|
import { EventDestination } from "./outbox-relay";
|
|
3
3
|
import { type GetServiceToken } from "./outbox-destinations/webhooks";
|
|
4
|
-
import type { OutboxPipelineConfig, WebhookInvoker } from "../types/AuthHeroConfig";
|
|
4
|
+
import type { ActionExecutionLogCapture, OutboxPipelineConfig, WebhookInvoker } from "../types/AuthHeroConfig";
|
|
5
5
|
export interface CreateDefaultDestinationsConfig {
|
|
6
6
|
/**
|
|
7
7
|
* Data adapter — the `logs`, `hooks`, `users`, and `logStreams` adapters are
|
|
@@ -47,6 +47,12 @@ export interface CreateDefaultDestinationsConfig {
|
|
|
47
47
|
* failed per-request delivery would be silently skipped on retry.
|
|
48
48
|
*/
|
|
49
49
|
codeExecutor?: CodeExecutor;
|
|
50
|
+
/**
|
|
51
|
+
* Same value as `init({ actionExecutionLogs })`. Controls which console
|
|
52
|
+
* output cron-drained code hooks persist to `action_executions.logs`, so
|
|
53
|
+
* they match inline deliveries. Defaults to `"full"`.
|
|
54
|
+
*/
|
|
55
|
+
actionExecutionLogs?: ActionExecutionLogCapture;
|
|
50
56
|
/**
|
|
51
57
|
* Same shape as `init({ outbox: { pipeline } })`. When set, cron-drained
|
|
52
58
|
* events are also archived to the Cloudflare Pipelines stream, matching the
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import { CertificateIssuer, SigningCertificateRequest } from "./signing-certificate-authority";
|
|
3
|
+
export interface HttpCertificateIssuerOptions {
|
|
4
|
+
/** Base URL of a service mounted with `createCertificateIssuerApp`. */
|
|
5
|
+
url: string;
|
|
6
|
+
/**
|
|
7
|
+
* Headers sent with every certificate request — typically the credential
|
|
8
|
+
* that identifies this caller to the CA service.
|
|
9
|
+
*/
|
|
10
|
+
headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
11
|
+
/**
|
|
12
|
+
* How long to cache the issuer certificates used to build `x5c`.
|
|
13
|
+
*
|
|
14
|
+
* @default 300
|
|
15
|
+
*/
|
|
16
|
+
issuerCertificatesTtlSeconds?: number;
|
|
17
|
+
/** Override for tests or a service binding's `fetch`. */
|
|
18
|
+
fetch?: typeof fetch;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A `CertificateIssuer` that asks a remote CA service to certify keys, so the
|
|
22
|
+
* CA private key never has to live in the auth worker. Pair it with
|
|
23
|
+
* `createCertificateIssuerApp` on the service side.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createHttpCertificateIssuer(options: HttpCertificateIssuerOptions): CertificateIssuer;
|
|
26
|
+
export interface CertificateIssuerAppOptions {
|
|
27
|
+
/** The issuer that actually signs, typically `createLocalCertificateIssuer`. */
|
|
28
|
+
issuer: CertificateIssuer;
|
|
29
|
+
/**
|
|
30
|
+
* Decide whether the caller may have this certificate. This is the only
|
|
31
|
+
* thing stopping one tenant from obtaining a certificate that names another
|
|
32
|
+
* tenant, or the control plane, so check the caller's identity against
|
|
33
|
+
* `certificateRequest.uri`.
|
|
34
|
+
*/
|
|
35
|
+
authorize: (params: {
|
|
36
|
+
request: Request;
|
|
37
|
+
certificateRequest: SigningCertificateRequest;
|
|
38
|
+
}) => boolean | Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* The longest lifetime and time from now until expiry a caller may request.
|
|
41
|
+
* Keeps a compromised caller
|
|
42
|
+
* from minting a certificate that outlives its access.
|
|
43
|
+
*
|
|
44
|
+
* @default 90
|
|
45
|
+
*/
|
|
46
|
+
maxValidityDays?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Serves a `CertificateIssuer` over HTTP for `createHttpCertificateIssuer`.
|
|
50
|
+
*
|
|
51
|
+
* - `POST /certificates` issues a leaf after `authorize` approves it.
|
|
52
|
+
* - `GET /issuer-certificates` returns the intermediates. They are published
|
|
53
|
+
* in every JWKS `x5c` anyway, so this route is not authorized.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createCertificateIssuerApp(options: CertificateIssuerAppOptions): Hono;
|
|
@@ -44,6 +44,11 @@ export type LogParams = {
|
|
|
44
44
|
* both authorizing as the same client).
|
|
45
45
|
*/
|
|
46
46
|
redirect_uri?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The original `/authorize` URL of the login. Carried on the audit event
|
|
49
|
+
* (and so to log streams) but not written to the log's `details`.
|
|
50
|
+
*/
|
|
51
|
+
authorization_url?: string;
|
|
47
52
|
/**
|
|
48
53
|
* Response details to include in the log (for Management API operations)
|
|
49
54
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AuditEvent, CodeExecutor } from "@authhero/adapter-interfaces";
|
|
2
2
|
import { EventDestination } from "../outbox-relay";
|
|
3
3
|
import { CodeHookData } from "../../hooks/codehooks";
|
|
4
|
+
import type { ActionExecutionLogCapture } from "../../types/AuthHeroConfig";
|
|
4
5
|
interface CodeHookInvocation {
|
|
5
6
|
eventId: string;
|
|
6
7
|
tenantId: string;
|
|
@@ -42,7 +43,10 @@ export declare class CodeHookDestination implements EventDestination {
|
|
|
42
43
|
name: string;
|
|
43
44
|
private data;
|
|
44
45
|
private codeExecutor?;
|
|
45
|
-
|
|
46
|
+
private logCapture?;
|
|
47
|
+
constructor(data: CodeHookData, codeExecutor?: CodeExecutor, options?: {
|
|
48
|
+
logCapture?: ActionExecutionLogCapture;
|
|
49
|
+
});
|
|
46
50
|
accepts(event: AuditEvent): boolean;
|
|
47
51
|
transform(event: AuditEvent): CodeHookInvocation;
|
|
48
52
|
deliver(invocations: CodeHookInvocation[]): Promise<void>;
|
|
@@ -24,11 +24,14 @@ interface LogStreamData {
|
|
|
24
24
|
path: string;
|
|
25
25
|
qs?: Record<string, string>;
|
|
26
26
|
body?: unknown;
|
|
27
|
+
redirect_uri?: string;
|
|
28
|
+
authorization_url?: string;
|
|
27
29
|
};
|
|
28
30
|
response?: {
|
|
29
31
|
statusCode: number;
|
|
30
32
|
body?: unknown;
|
|
31
33
|
};
|
|
34
|
+
execution_id?: string;
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
interface LogStreamPayload {
|