authhero 5.11.0 → 5.13.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 +125 -125
- package/dist/authhero.d.ts +272 -221
- package/dist/authhero.mjs +10547 -10122
- package/dist/stats.html +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/adapters/createEncryptedDataAdapter.d.ts +14 -0
- package/dist/types/adapters/index.d.ts +2 -0
- package/dist/types/authentication-flows/passwordless.d.ts +6 -6
- package/dist/types/helpers/custom-domain.d.ts +8 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
- package/dist/types/helpers/users.d.ts +28 -0
- package/dist/types/index.d.ts +220 -220
- package/dist/types/routes/auth-api/index.d.ts +22 -22
- package/dist/types/routes/auth-api/passwordless.d.ts +14 -14
- package/dist/types/routes/auth-api/register/index.d.ts +2 -2
- package/dist/types/routes/auth-api/revoke.d.ts +6 -6
- 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/clients.d.ts +13 -13
- package/dist/types/routes/management-api/connections.d.ts +16 -16
- package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
- package/dist/types/routes/management-api/email-templates.d.ts +14 -14
- package/dist/types/routes/management-api/failed-events.d.ts +1 -1
- package/dist/types/routes/management-api/forms.d.ts +119 -119
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/index.d.ts +193 -193
- package/dist/types/routes/management-api/logs.d.ts +3 -3
- package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/proxy-routes.d.ts +221 -0
- package/dist/types/routes/management-api/users.d.ts +2 -2
- package/dist/types/routes/proxy-control-plane/index.d.ts +22 -0
- package/dist/types/routes/universal-login/common.d.ts +8 -8
- package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
- package/dist/types/routes/universal-login/identifier.d.ts +2 -2
- package/dist/types/routes/universal-login/index.d.ts +2 -2
- package/dist/types/routes/universal-login/u2-index.d.ts +3 -3
- package/dist/types/routes/universal-login/u2-routes.d.ts +3 -3
- package/dist/types/types/AuthHeroConfig.d.ts +14 -0
- package/dist/types/types/Bindings.d.ts +1 -0
- package/dist/types/types/IdToken.d.ts +3 -3
- package/dist/types/utils/field-encryption.d.ts +21 -0
- package/package.json +6 -5
|
@@ -515,7 +515,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
515
515
|
} & {
|
|
516
516
|
form: {
|
|
517
517
|
username: string;
|
|
518
|
-
login_selection?: "
|
|
518
|
+
login_selection?: "password" | "code" | undefined;
|
|
519
519
|
};
|
|
520
520
|
};
|
|
521
521
|
output: {};
|
|
@@ -529,7 +529,7 @@ export default function create(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
529
529
|
} & {
|
|
530
530
|
form: {
|
|
531
531
|
username: string;
|
|
532
|
-
login_selection?: "
|
|
532
|
+
login_selection?: "password" | "code" | undefined;
|
|
533
533
|
};
|
|
534
534
|
};
|
|
535
535
|
output: {};
|
|
@@ -149,7 +149,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
149
149
|
$get: {
|
|
150
150
|
input: {
|
|
151
151
|
param: {
|
|
152
|
-
screen: "signup" | "
|
|
152
|
+
screen: "signup" | "account" | "login" | "reset-password" | "enter-password" | "impersonate" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
|
|
153
153
|
};
|
|
154
154
|
} & {
|
|
155
155
|
query: {
|
|
@@ -165,7 +165,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
165
165
|
} | {
|
|
166
166
|
input: {
|
|
167
167
|
param: {
|
|
168
|
-
screen: "signup" | "
|
|
168
|
+
screen: "signup" | "account" | "login" | "reset-password" | "enter-password" | "impersonate" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
|
|
169
169
|
};
|
|
170
170
|
} & {
|
|
171
171
|
query: {
|
|
@@ -181,7 +181,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
181
181
|
} | {
|
|
182
182
|
input: {
|
|
183
183
|
param: {
|
|
184
|
-
screen: "signup" | "
|
|
184
|
+
screen: "signup" | "account" | "login" | "reset-password" | "enter-password" | "impersonate" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
|
|
185
185
|
};
|
|
186
186
|
} & {
|
|
187
187
|
query: {
|
|
@@ -154,7 +154,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
154
154
|
$get: {
|
|
155
155
|
input: {
|
|
156
156
|
param: {
|
|
157
|
-
screen: "signup" | "
|
|
157
|
+
screen: "signup" | "account" | "login" | "reset-password" | "enter-password" | "impersonate" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
|
|
158
158
|
};
|
|
159
159
|
} & {
|
|
160
160
|
query: {
|
|
@@ -170,7 +170,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
170
170
|
} | {
|
|
171
171
|
input: {
|
|
172
172
|
param: {
|
|
173
|
-
screen: "signup" | "
|
|
173
|
+
screen: "signup" | "account" | "login" | "reset-password" | "enter-password" | "impersonate" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
|
|
174
174
|
};
|
|
175
175
|
} & {
|
|
176
176
|
query: {
|
|
@@ -186,7 +186,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
186
186
|
} | {
|
|
187
187
|
input: {
|
|
188
188
|
param: {
|
|
189
|
-
screen: "signup" | "
|
|
189
|
+
screen: "signup" | "account" | "login" | "reset-password" | "enter-password" | "impersonate" | "try-connection-result" | "reset-password/request" | "reset-password/code" | "login/identifier" | "login/email-otp-challenge" | "login/sms-otp-challenge" | "login/login-passwordless-identifier" | "mfa/login-options" | "mfa/totp-challenge" | "mfa/totp-enrollment" | "mfa/phone-challenge" | "mfa/phone-enrollment" | "passkey/challenge" | "passkey/enrollment" | "passkey/enrollment-nudge" | "account/profile" | "account/security" | "account/security/totp-enrollment" | "account/security/phone-enrollment" | "account/linked" | "account/delete" | "account/passkeys" | "connect/start" | "connect/select-tenant";
|
|
190
190
|
};
|
|
191
191
|
} & {
|
|
192
192
|
query: {
|
|
@@ -276,6 +276,20 @@ export interface AuthHeroConfig {
|
|
|
276
276
|
* ```
|
|
277
277
|
*/
|
|
278
278
|
managementApiExtensions?: ManagementApiExtension[];
|
|
279
|
+
/**
|
|
280
|
+
* Optional privileged control-plane endpoint for the `@authhero/proxy`
|
|
281
|
+
* data plane. When set, mounts `GET /api/v2/proxy/control-plane/hosts/:host`
|
|
282
|
+
* which returns the cross-tenant `ResolvedHost` for the given hostname.
|
|
283
|
+
*
|
|
284
|
+
* This endpoint is read by remote proxy deployments via
|
|
285
|
+
* `createHttpProxyAdapter`. It is **cross-tenant** — gate it with a
|
|
286
|
+
* dedicated credential (shared secret, mTLS, or a JWT scoped to
|
|
287
|
+
* `proxy:resolve_host`), never with a tenant token.
|
|
288
|
+
*/
|
|
289
|
+
proxyControlPlane?: {
|
|
290
|
+
resolveHost: (host: string) => Promise<import("@authhero/proxy").ResolvedHost | null>;
|
|
291
|
+
authenticate: (request: Request) => Promise<boolean> | boolean;
|
|
292
|
+
};
|
|
279
293
|
/**
|
|
280
294
|
* Optional powered-by logo to display at the bottom left of the login widget.
|
|
281
295
|
* This is only configurable in code, not stored in the database.
|
|
@@ -18,13 +18,13 @@ export declare const idTokenSchema: z.ZodObject<{
|
|
|
18
18
|
c_hash: z.ZodOptional<z.ZodString>;
|
|
19
19
|
}, z.core.$loose>;
|
|
20
20
|
export declare const userInfoSchema: z.ZodObject<{
|
|
21
|
-
email: z.ZodOptional<z.ZodString>;
|
|
22
21
|
name: z.ZodOptional<z.ZodString>;
|
|
22
|
+
email: z.ZodOptional<z.ZodString>;
|
|
23
|
+
given_name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
family_name: z.ZodOptional<z.ZodString>;
|
|
23
25
|
sub: z.ZodString;
|
|
24
26
|
iss: z.ZodString;
|
|
25
27
|
aud: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
26
28
|
exp: z.ZodNumber;
|
|
27
|
-
given_name: z.ZodOptional<z.ZodString>;
|
|
28
|
-
family_name: z.ZodOptional<z.ZodString>;
|
|
29
29
|
}, z.core.$loose>;
|
|
30
30
|
export type IdToken = z.infer<typeof idTokenSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const PREFIX = "enc:v1:";
|
|
2
|
+
export type EncryptedField = `${typeof PREFIX}${string}`;
|
|
3
|
+
export declare function isEncrypted(value: string): value is EncryptedField;
|
|
4
|
+
/**
|
|
5
|
+
* Imports a base64-encoded 32-byte key as an AES-256-GCM CryptoKey. Throws if
|
|
6
|
+
* the decoded key is not exactly 32 bytes so a misconfigured secret fails loudly
|
|
7
|
+
* at boot rather than silently weakening encryption.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadEncryptionKey(b64: string): Promise<CryptoKey>;
|
|
10
|
+
/**
|
|
11
|
+
* Encrypts a string with AES-256-GCM using a fresh random IV. The output is
|
|
12
|
+
* `enc:v1:<base64url(iv ‖ ciphertext ‖ tag)>`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function encryptField(plaintext: string, key: CryptoKey): Promise<EncryptedField>;
|
|
15
|
+
/**
|
|
16
|
+
* Decrypts a value produced by `encryptField`. Values without the `enc:v1:`
|
|
17
|
+
* prefix are assumed to be legacy plaintext and returned unchanged. Throws if a
|
|
18
|
+
* prefixed value cannot be decrypted (wrong key or corrupted ciphertext).
|
|
19
|
+
*/
|
|
20
|
+
export declare function decryptField(value: string, key: CryptoKey): Promise<string>;
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/markusahlstrand/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "5.
|
|
14
|
+
"version": "5.13.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"vite": "^8.0.14",
|
|
63
63
|
"vite-plugin-dts": "^4.5.4",
|
|
64
64
|
"vitest": "^4.1.7",
|
|
65
|
-
"@authhero/kysely-adapter": "11.
|
|
66
|
-
"@authhero/widget": "0.32.
|
|
65
|
+
"@authhero/kysely-adapter": "11.5.0",
|
|
66
|
+
"@authhero/widget": "0.32.30"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@peculiar/x509": "^1.14.0",
|
|
@@ -81,8 +81,9 @@
|
|
|
81
81
|
"qrcode": "^1.5.4",
|
|
82
82
|
"sanitize-html": "^2.17.4",
|
|
83
83
|
"xstate": "^5.31.1",
|
|
84
|
-
"@authhero/adapter-interfaces": "2.
|
|
85
|
-
"@authhero/saml": "0.4.1"
|
|
84
|
+
"@authhero/adapter-interfaces": "2.8.0",
|
|
85
|
+
"@authhero/saml": "0.4.1",
|
|
86
|
+
"@authhero/proxy": "0.3.0"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
89
|
"@authhero/widget": "^0.1.0",
|