authhero 8.21.0 → 8.22.1
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 +142 -142
- package/dist/authhero.d.ts +529 -276
- package/dist/authhero.mjs +22201 -17447
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/authentication-flows/passwordless.d.ts +7 -7
- package/dist/types/errors/is-http-exception-like.d.ts +11 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +2 -2
- package/dist/types/index.d.ts +407 -273
- package/dist/types/routes/auth-api/account.d.ts +2 -2
- package/dist/types/routes/auth-api/authorize.d.ts +14 -14
- package/dist/types/routes/auth-api/index.d.ts +46 -46
- package/dist/types/routes/auth-api/oidc-logout.d.ts +2 -2
- package/dist/types/routes/auth-api/passwordless.d.ts +18 -18
- 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/auth-api/well-known.d.ts +2 -2
- package/dist/types/routes/management-api/action-executions.d.ts +1 -1
- package/dist/types/routes/management-api/actions.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/clients.d.ts +110 -15
- package/dist/types/routes/management-api/connections.d.ts +21 -21
- package/dist/types/routes/management-api/email-templates.d.ts +18 -18
- package/dist/types/routes/management-api/flows.d.ts +7 -7
- package/dist/types/routes/management-api/forms.d.ts +126 -126
- package/dist/types/routes/management-api/guardian.d.ts +5 -5
- package/dist/types/routes/management-api/index.d.ts +353 -220
- package/dist/types/routes/management-api/logs.d.ts +41 -3
- package/dist/types/routes/management-api/organizations.d.ts +2 -2
- package/dist/types/routes/management-api/prompts.d.ts +4 -4
- package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
- package/dist/types/routes/management-api/tenants.d.ts +6 -6
- package/dist/types/routes/management-api/users.d.ts +2 -2
- package/dist/types/routes/proxy-control-plane/wfp-tenant-hosts.d.ts +122 -0
- package/dist/types/routes/proxy-control-plane/wfp-tenant-hosts.test.d.ts +1 -0
- package/dist/types/routes/universal-login/common.d.ts +10 -10
- 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 +5 -5
- package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
- package/dist/types/utils/crypto.d.ts +3 -0
- package/dist/types/utils/jwks.d.ts +4 -4
- package/dist/types/utils/jwt.d.ts +29 -0
- package/dist/types/utils/request-origin.d.ts +6 -0
- package/dist/types/utils/totp.d.ts +10 -0
- package/package.json +6 -7
|
@@ -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?: "code" | "password" | 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?: "code" | "password" | undefined;
|
|
533
533
|
};
|
|
534
534
|
};
|
|
535
535
|
output: {};
|
|
@@ -165,7 +165,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
165
165
|
$get: {
|
|
166
166
|
input: {
|
|
167
167
|
param: {
|
|
168
|
-
screen: "signup" | "
|
|
168
|
+
screen: "signup" | "login" | "account" | "reset-password" | "consent" | "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" | "login" | "account" | "reset-password" | "consent" | "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: {
|
|
@@ -197,7 +197,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
197
197
|
} | {
|
|
198
198
|
input: {
|
|
199
199
|
param: {
|
|
200
|
-
screen: "signup" | "
|
|
200
|
+
screen: "signup" | "login" | "account" | "reset-password" | "consent" | "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";
|
|
201
201
|
};
|
|
202
202
|
} & {
|
|
203
203
|
query: {
|
|
@@ -217,7 +217,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
217
217
|
$post: {
|
|
218
218
|
input: {
|
|
219
219
|
param: {
|
|
220
|
-
screen: "signup" | "
|
|
220
|
+
screen: "signup" | "login" | "reset-password" | "consent" | "enter-password" | "impersonate" | "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";
|
|
221
221
|
};
|
|
222
222
|
} & {
|
|
223
223
|
query: {
|
|
@@ -235,7 +235,7 @@ export default function createU2App(config: AuthHeroConfig): OpenAPIHono<{
|
|
|
235
235
|
} | {
|
|
236
236
|
input: {
|
|
237
237
|
param: {
|
|
238
|
-
screen: "signup" | "
|
|
238
|
+
screen: "signup" | "login" | "reset-password" | "consent" | "enter-password" | "impersonate" | "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";
|
|
239
239
|
};
|
|
240
240
|
} & {
|
|
241
241
|
query: {
|
|
@@ -170,7 +170,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
170
170
|
$get: {
|
|
171
171
|
input: {
|
|
172
172
|
param: {
|
|
173
|
-
screen: "signup" | "
|
|
173
|
+
screen: "signup" | "login" | "account" | "reset-password" | "consent" | "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" | "login" | "account" | "reset-password" | "consent" | "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: {
|
|
@@ -202,7 +202,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
202
202
|
} | {
|
|
203
203
|
input: {
|
|
204
204
|
param: {
|
|
205
|
-
screen: "signup" | "
|
|
205
|
+
screen: "signup" | "login" | "account" | "reset-password" | "consent" | "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";
|
|
206
206
|
};
|
|
207
207
|
} & {
|
|
208
208
|
query: {
|
|
@@ -222,7 +222,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
222
222
|
$post: {
|
|
223
223
|
input: {
|
|
224
224
|
param: {
|
|
225
|
-
screen: "signup" | "
|
|
225
|
+
screen: "signup" | "login" | "reset-password" | "consent" | "enter-password" | "impersonate" | "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";
|
|
226
226
|
};
|
|
227
227
|
} & {
|
|
228
228
|
query: {
|
|
@@ -240,7 +240,7 @@ export declare const u2Routes: OpenAPIHono<{
|
|
|
240
240
|
} | {
|
|
241
241
|
input: {
|
|
242
242
|
param: {
|
|
243
|
-
screen: "signup" | "
|
|
243
|
+
screen: "signup" | "login" | "reset-password" | "consent" | "enter-password" | "impersonate" | "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";
|
|
244
244
|
};
|
|
245
245
|
} & {
|
|
246
246
|
query: {
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function pemToBuffer(pem: string): ArrayBuffer;
|
|
2
|
+
/** A high-entropy PKCE code verifier (RFC 7636 §4.1): 32 random bytes,
|
|
3
|
+
* base64url-encoded to 43 characters. */
|
|
4
|
+
export declare function generateCodeVerifier(): string;
|
|
2
5
|
export declare function computeCodeChallenge(codeVerifier: string, method: "plain" | "S256"): Promise<string>;
|
|
@@ -7,8 +7,8 @@ import { SigningKeyModeOption } from "../types/AuthHeroConfig";
|
|
|
7
7
|
* still verify during the per-tenant key rollout.
|
|
8
8
|
*/
|
|
9
9
|
export declare function getJwksForPublication(data: DataAdapters, tenantId: string, modeOption: SigningKeyModeOption | undefined): Promise<{
|
|
10
|
-
alg: "
|
|
11
|
-
kty: "
|
|
10
|
+
alg: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512";
|
|
11
|
+
kty: "RSA" | "EC" | "oct";
|
|
12
12
|
kid?: string | undefined;
|
|
13
13
|
use?: "sig" | "enc" | undefined;
|
|
14
14
|
n?: string | undefined;
|
|
@@ -26,8 +26,8 @@ export declare function getJwksForPublication(data: DataAdapters, tenantId: stri
|
|
|
26
26
|
* subdomain), only control-plane-signed tokens are accepted.
|
|
27
27
|
*/
|
|
28
28
|
export declare function getJwksForVerification(data: DataAdapters, tenantId: string | undefined, modeOption: SigningKeyModeOption | undefined): Promise<{
|
|
29
|
-
alg: "
|
|
30
|
-
kty: "
|
|
29
|
+
alg: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512";
|
|
30
|
+
kty: "RSA" | "EC" | "oct";
|
|
31
31
|
kid?: string | undefined;
|
|
32
32
|
use?: "sig" | "enc" | undefined;
|
|
33
33
|
n?: string | undefined;
|
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
import { Context } from "hono";
|
|
2
2
|
import { JSONHTTPException } from "../errors/json-http-exception";
|
|
3
|
+
import type { TokenHeader } from "hono/utils/jwt/jwt";
|
|
4
|
+
import type { JWTPayload } from "hono/utils/jwt/types";
|
|
5
|
+
export type JWTSigningAlg = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512";
|
|
6
|
+
export interface SignJWTOptions {
|
|
7
|
+
/** Sets `exp` to now + this many seconds. */
|
|
8
|
+
expiresInSeconds?: number;
|
|
9
|
+
/** Sets `iat` to now. */
|
|
10
|
+
includeIssuedTimestamp?: boolean;
|
|
11
|
+
/** Extra JOSE header members (e.g. `kid`); merged over `alg`/`typ`. */
|
|
12
|
+
headers?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Sign a JWT (compact JWS) on Web Crypto. `key` is the raw HMAC secret for
|
|
16
|
+
* HS* or a PKCS#8 private key for RS* and ES*. ECDSA signatures use the raw
|
|
17
|
+
* `r ‖ s` form Web Crypto produces, as JWS requires.
|
|
18
|
+
*/
|
|
19
|
+
export declare function signJWT(algorithm: JWTSigningAlg, key: ArrayBuffer | Uint8Array, payloadClaims: Record<string, unknown>, options?: SignJWTOptions): Promise<string>;
|
|
20
|
+
export interface ParsedJWT {
|
|
21
|
+
header: TokenHeader;
|
|
22
|
+
payload: JWTPayload;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Decode a compact JWT without verifying its signature; null on malformed
|
|
26
|
+
* input. For reading claims out of tokens we minted ourselves or received
|
|
27
|
+
* over a channel that authenticates the issuer (e.g. an IdP token
|
|
28
|
+
* endpoint). Anything accepted from the outside goes through
|
|
29
|
+
* `validateJwtToken` or the JWKS verifiers in helpers/ instead.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseJWT(jwt: string): ParsedJWT | null;
|
|
3
32
|
export interface JwtPayload {
|
|
4
33
|
sub: string;
|
|
5
34
|
iss: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether a request's Origin header matches one of the allowed
|
|
3
|
+
* domains, comparing by URL host (replaces oslo/request). Entries may be
|
|
4
|
+
* bare hosts or full origins; comparison ignores scheme and path.
|
|
5
|
+
*/
|
|
6
|
+
export declare function verifyRequestOrigin(origin: string | null | undefined, allowedDomains: string[]): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The TOTP code for the current 30-second period. */
|
|
2
|
+
export declare function generateTOTP(secret: Uint8Array): Promise<string>;
|
|
3
|
+
/**
|
|
4
|
+
* Verify a code against the current period ±1 (RFC 6238 §6 recommends
|
|
5
|
+
* tolerating one step of transmission delay / clock drift, and oslo's
|
|
6
|
+
* current-slice-only check made codes fail at period boundaries).
|
|
7
|
+
*/
|
|
8
|
+
export declare function verifyTOTP(code: string, secret: Uint8Array): Promise<boolean>;
|
|
9
|
+
/** otpauth:// URI for enrolling the secret in an authenticator app. */
|
|
10
|
+
export declare function createTOTPKeyURI(issuer: string, accountName: string, secret: Uint8Array): string;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/markusahlstrand/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "8.
|
|
14
|
+
"version": "8.22.1",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"vite": "^8.0.14",
|
|
64
64
|
"vite-plugin-dts": "^4.5.4",
|
|
65
65
|
"vitest": "^4.1.7",
|
|
66
|
-
"@authhero/kysely-adapter": "11.
|
|
67
|
-
"@authhero/widget": "0.34.
|
|
66
|
+
"@authhero/kysely-adapter": "11.17.1",
|
|
67
|
+
"@authhero/widget": "0.34.12"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@peculiar/x509": "^1.14.0",
|
|
@@ -78,13 +78,12 @@
|
|
|
78
78
|
"libphonenumber-js": "^1.13.3",
|
|
79
79
|
"liquidjs": "^10.27.0",
|
|
80
80
|
"nanoid": "^5.1.11",
|
|
81
|
-
"oslo": "^1.2.1",
|
|
82
81
|
"qrcode": "^1.5.4",
|
|
83
82
|
"sanitize-html": "^2.17.4",
|
|
84
83
|
"xstate": "^5.31.1",
|
|
85
|
-
"@authhero/adapter-interfaces": "3.
|
|
86
|
-
"@authhero/proxy": "0.9.
|
|
87
|
-
"@authhero/saml": "0.4.
|
|
84
|
+
"@authhero/adapter-interfaces": "3.12.0",
|
|
85
|
+
"@authhero/proxy": "0.9.2",
|
|
86
|
+
"@authhero/saml": "0.4.3"
|
|
88
87
|
},
|
|
89
88
|
"peerDependencies": {
|
|
90
89
|
"@authhero/widget": "^0.1.0",
|