authhero 9.35.0 → 9.37.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.
Files changed (77) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +144 -141
  3. package/dist/authhero.d.ts +562 -369
  4. package/dist/authhero.mjs +13530 -11568
  5. package/dist/{mfa-fD5vp7ql.mjs → mfa-BpHxTir1.mjs} +25 -25
  6. package/dist/{mfa-XAWdFO9R.js → mfa-DuNbh_YF.js} +1 -1
  7. package/dist/mfa-attempts-D5U1FCSY.js +275 -0
  8. package/dist/{mfa-attempts-CpIqAsQd.mjs → mfa-attempts-DDgCBTDW.mjs} +6022 -5686
  9. package/dist/{passkey-enrollment-BB99mHdQ.js → passkey-enrollment-D6ZZmelw.js} +1 -1
  10. package/dist/tsconfig.types.tsbuildinfo +1 -1
  11. package/dist/types/authentication-flows/email-verification.d.ts +1 -1
  12. package/dist/types/authentication-flows/passwordless.d.ts +5 -2
  13. package/dist/types/errors/management-api-error.d.ts +3 -0
  14. package/dist/types/generated/locale-types.d.ts +87 -0
  15. package/dist/types/helpers/anchor-client.d.ts +16 -0
  16. package/dist/types/helpers/database-connection-scope.d.ts +97 -0
  17. package/dist/types/helpers/dcr/audience-policy.d.ts +13 -0
  18. package/dist/types/helpers/dcr/client-registration.d.ts +81 -0
  19. package/dist/types/helpers/dcr/constraint-enforcement.d.ts +1 -0
  20. package/dist/types/helpers/dcr/metadata-mapping.d.ts +17 -0
  21. package/dist/types/helpers/dcr/mint-iat.d.ts +4 -1
  22. package/dist/types/helpers/dcr/mint-token.d.ts +4 -0
  23. package/dist/types/helpers/dcr/presets.d.ts +34 -0
  24. package/dist/types/helpers/dcr/uri-policy.d.ts +34 -0
  25. package/dist/types/helpers/password-connection.d.ts +3 -1
  26. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  27. package/dist/types/helpers/self-service-tickets.d.ts +34 -0
  28. package/dist/types/helpers/sso-access-tickets.d.ts +18 -0
  29. package/dist/types/helpers/users.d.ts +29 -4
  30. package/dist/types/index.d.ts +502 -310
  31. package/dist/types/routes/auth-api/authenticate.d.ts +1 -1
  32. package/dist/types/routes/auth-api/dbconnections.d.ts +2 -2
  33. package/dist/types/routes/auth-api/device.d.ts +8 -8
  34. package/dist/types/routes/auth-api/index.d.ts +54 -37
  35. package/dist/types/routes/auth-api/passwordless.d.ts +18 -16
  36. package/dist/types/routes/auth-api/register/index.d.ts +15 -0
  37. package/dist/types/routes/auth-api/token.d.ts +10 -10
  38. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  39. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  40. package/dist/types/routes/management-api/branding.d.ts +13 -13
  41. package/dist/types/routes/management-api/client-grants.d.ts +9 -9
  42. package/dist/types/routes/management-api/client-registration-tokens.d.ts +149 -0
  43. package/dist/types/routes/management-api/connections.d.ts +1 -1
  44. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  45. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  46. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  47. package/dist/types/routes/management-api/forms.d.ts +144 -144
  48. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  49. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  50. package/dist/types/routes/management-api/index.d.ts +411 -266
  51. package/dist/types/routes/management-api/keys.d.ts +16 -16
  52. package/dist/types/routes/management-api/log-streams.d.ts +6 -6
  53. package/dist/types/routes/management-api/logs.d.ts +4 -4
  54. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  55. package/dist/types/routes/management-api/organizations.d.ts +5 -5
  56. package/dist/types/routes/management-api/prompts.d.ts +6 -6
  57. package/dist/types/routes/management-api/roles.d.ts +1 -1
  58. package/dist/types/routes/management-api/rollouts.d.ts +6 -6
  59. package/dist/types/routes/management-api/self-service-profiles.d.ts +345 -0
  60. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  61. package/dist/types/routes/management-api/tenant-operations.d.ts +10 -10
  62. package/dist/types/routes/management-api/tenants.d.ts +17 -17
  63. package/dist/types/routes/management-api/themes.d.ts +9 -9
  64. package/dist/types/routes/management-api/users.d.ts +17 -17
  65. package/dist/types/routes/universal-login/common.d.ts +10 -8
  66. package/dist/types/routes/universal-login/flow-api.d.ts +8 -8
  67. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  68. package/dist/types/routes/universal-login/index.d.ts +2 -2
  69. package/dist/types/routes/universal-login/screens/connect-authz.d.ts +9 -0
  70. package/dist/types/routes/universal-login/screens/self-service-app.d.ts +46 -0
  71. package/dist/types/routes/universal-login/u2-index.d.ts +35 -5
  72. package/dist/types/routes/universal-login/u2-routes.d.ts +35 -5
  73. package/dist/types/state-machines/login-session.d.ts +19 -1
  74. package/dist/types/types/Bindings.d.ts +2 -0
  75. package/dist/types/utils/username-password-provider.d.ts +14 -3
  76. package/package.json +6 -6
  77. package/dist/mfa-attempts-C7toCIRn.js +0 -275
@@ -45,6 +45,16 @@ export interface LoginSessionData {
45
45
  inviter_name?: string;
46
46
  roles?: string[];
47
47
  connect?: Record<string, unknown>;
48
+ /**
49
+ * Developer app setup page (#1776): which link opened the page (the
50
+ * registration token row id) and, once a create link registered its app,
51
+ * the new client. See routes/universal-login/screens/self-service-app.ts.
52
+ */
53
+ self_service?: {
54
+ kind: "app_create" | "app_edit";
55
+ token_id: string;
56
+ completed_client_id?: string;
57
+ };
48
58
  deviceFlow?: {
49
59
  deviceCodeHash?: string;
50
60
  userCode?: string;
@@ -53,6 +63,14 @@ export interface LoginSessionData {
53
63
  try_connection_result?: unknown;
54
64
  session_cookie?: SessionCookieDiagnostics;
55
65
  session_transfer?: SessionTransferCarrierState;
66
+ /**
67
+ * The database connection /co/authenticate checked a password in. Written
68
+ * only by its password branch, on the session it creates, and read by
69
+ * ticketAuth. Kept apart from `authParams.connection`, which /authorize and
70
+ * other routes set from the request, so a login ticket can only be redeemed
71
+ * where a password was actually checked.
72
+ */
73
+ ticket_connection?: string;
56
74
  }
57
75
  /** The on-disk JSON shape stays flat for compatibility with existing sessions. */
58
76
  export declare function readLoginSessionData(raw?: string | null): LoginSessionData;
@@ -234,7 +252,7 @@ export declare const loginSessionMachine: import("xstate").StateMachine<LoginSes
234
252
  }, {
235
253
  type: "passwordResetRequested";
236
254
  params: unknown;
237
- }, never, "pending" | "failed" | "expired" | "authenticated" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_consent" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
255
+ }, never, "pending" | "authenticated" | "failed" | "expired" | "awaiting_email_verification" | "awaiting_mfa" | "awaiting_consent" | "awaiting_hook" | "awaiting_continuation" | "completed", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
238
256
  id: "loginSession";
239
257
  states: {
240
258
  readonly pending: {};
@@ -1,6 +1,7 @@
1
1
  import type { SigningCertificateAuthority } from "../helpers/signing-certificate-authority";
2
2
  import { ActionCodeGenerator, CodeExecutor, DataAdapters } from "@authhero/adapter-interfaces";
3
3
  import type { SamlSigner } from "@authhero/saml/core";
4
+ import type { ManagementAudienceResolver } from "../middlewares/authentication";
4
5
  import { Hooks } from "./Hooks";
5
6
  import { ActionExecutionLogCapture, EntityHooksConfig, McpConfig, OutboxConfig, SigningKeyModeOption, RolloutControllerBinding, TenantOperationExecutorBinding, UserLinkingModeOption, UsernamePasswordProviderResolver, WebhookInvoker } from "./AuthHeroConfig";
6
7
  import { StrategyHandler } from "../strategies";
@@ -48,6 +49,7 @@ export type Bindings = {
48
49
  usersImportMaxBytes?: number;
49
50
  usersImportMaxConcurrentJobs?: number;
50
51
  unsafeAllowAzpCustomClaim?: boolean;
52
+ additionalManagementAudiences?: ManagementAudienceResolver;
51
53
  outbox?: OutboxConfig;
52
54
  userLinkingMode?: UserLinkingModeOption;
53
55
  usernamePasswordProvider?: UsernamePasswordProviderResolver;
@@ -38,6 +38,13 @@ interface DualReadParams {
38
38
  env: Bindings;
39
39
  tenant_id: string;
40
40
  username: string;
41
+ /**
42
+ * Name of the database connection to look in (#1702). Rows of the tenant's
43
+ * other database connections are skipped. Has no effect for tenants with a
44
+ * single database connection, or when the name isn't one of the tenant's
45
+ * database connections; see `resolveDatabaseConnectionScope`.
46
+ */
47
+ connection?: string;
41
48
  }
42
49
  /**
43
50
  * Look up a native database user, accepting either provider value.
@@ -49,17 +56,21 @@ interface DualReadParams {
49
56
  * etc.) we want login to keep using the `auth2` row so credentials
50
57
  * continue to work. The migration script merges the duplicates.
51
58
  */
52
- export declare function getUsernamePasswordUser({ env, tenant_id, username, }: DualReadParams): Promise<User | null>;
59
+ export declare function getUsernamePasswordUser({ env, tenant_id, username, connection, }: DualReadParams): Promise<User | null>;
53
60
  /**
54
61
  * Same as {@link getUsernamePasswordUser} but resolves to the primary user
55
- * if a linked secondary is matched. Same `auth2`-first ordering.
62
+ * if a linked secondary is matched. Same ordering: the row is chosen first,
63
+ * then its cluster root.
56
64
  */
57
- export declare function getPrimaryUsernamePasswordUser({ env, tenant_id, username, }: DualReadParams): Promise<User | null>;
65
+ export declare function getPrimaryUsernamePasswordUser(params: DualReadParams): Promise<User | null>;
58
66
  /**
59
67
  * Find-or-create wrapper that first looks for an existing native database
60
68
  * user under EITHER provider value, and only creates a new row (under the
61
69
  * configured provider) if none exists. Prevents duplicating an existing
62
70
  * `auth2|*` user when the tenant is migrated to `"auth0"`.
71
+ *
72
+ * `connection` is written on a new row and scopes the existing-user lookup,
73
+ * see {@link DualReadParams}.
63
74
  */
64
75
  export declare function getOrCreateUsernamePasswordUser(ctx: Context<{
65
76
  Bindings: Bindings;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/sesamyab/authhero"
13
13
  },
14
- "version": "9.35.0",
14
+ "version": "9.37.0",
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": "12.21.0",
67
- "@authhero/widget": "0.41.14"
66
+ "@authhero/kysely-adapter": "12.23.0",
67
+ "@authhero/widget": "0.41.16"
68
68
  },
69
69
  "dependencies": {
70
70
  "@peculiar/x509": "^1.14.3",
@@ -81,9 +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": "4.30.0",
85
- "@authhero/proxy": "0.11.17",
86
- "@authhero/saml": "0.6.10"
84
+ "@authhero/adapter-interfaces": "4.32.0",
85
+ "@authhero/proxy": "0.11.19",
86
+ "@authhero/saml": "0.6.12"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@authhero/widget": ">=0.38.9",