authhero 9.34.0 → 9.36.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 (65) hide show
  1. package/dist/assets/u/widget/index.esm.js +1 -1
  2. package/dist/authhero.cjs +105 -104
  3. package/dist/authhero.d.ts +304 -220
  4. package/dist/authhero.mjs +16782 -15989
  5. package/dist/{mfa-CDFRupfM.mjs → mfa-B044FRjD.mjs} +18 -18
  6. package/dist/{mfa-DF3O3Z8H.js → mfa-DPwn1ajo.js} +1 -1
  7. package/dist/mfa-attempts-BiU_pMOV.js +275 -0
  8. package/dist/{mfa-attempts-C06Bkdy9.mjs → mfa-attempts-DGOLb2oh.mjs} +6417 -6092
  9. package/dist/{passkey-enrollment-RGw-WaSq.js → passkey-enrollment-BDboqoaP.js} +1 -1
  10. package/dist/tsconfig.types.tsbuildinfo +1 -1
  11. package/dist/types/authentication-flows/passwordless.d.ts +6 -412
  12. package/dist/types/emails/from-address.d.ts +21 -0
  13. package/dist/types/errors/management-api-error.d.ts +3 -0
  14. package/dist/types/helpers/branding-assets.d.ts +28 -0
  15. package/dist/types/helpers/client.d.ts +5 -2
  16. package/dist/types/helpers/database-connection-scope.d.ts +67 -0
  17. package/dist/types/helpers/dcr/metadata-mapping.d.ts +1 -1
  18. package/dist/types/helpers/link-candidates.d.ts +7 -1
  19. package/dist/types/helpers/reserved-claims.d.ts +2 -2
  20. package/dist/types/helpers/self-service-connections.d.ts +42 -0
  21. package/dist/types/helpers/sso-access-tickets.d.ts +18 -0
  22. package/dist/types/helpers/users.d.ts +29 -4
  23. package/dist/types/index.d.ts +298 -217
  24. package/dist/types/routes/assets.d.ts +11 -0
  25. package/dist/types/routes/auth-api/device.d.ts +8 -8
  26. package/dist/types/routes/auth-api/index.d.ts +40 -38
  27. package/dist/types/routes/auth-api/passwordless.d.ts +14 -12
  28. package/dist/types/routes/auth-api/register/index.d.ts +2 -2
  29. package/dist/types/routes/auth-api/revoke.d.ts +6 -6
  30. package/dist/types/routes/auth-api/token.d.ts +10 -10
  31. package/dist/types/routes/management-api/action-executions.d.ts +1 -1
  32. package/dist/types/routes/management-api/authentication-methods.d.ts +1 -1
  33. package/dist/types/routes/management-api/branding-uploads.d.ts +85 -0
  34. package/dist/types/routes/management-api/branding.d.ts +92 -13
  35. package/dist/types/routes/management-api/clients.d.ts +32 -32
  36. package/dist/types/routes/management-api/connections.d.ts +24 -24
  37. package/dist/types/routes/management-api/custom-domains.d.ts +6 -6
  38. package/dist/types/routes/management-api/email-templates.d.ts +18 -18
  39. package/dist/types/routes/management-api/failed-events.d.ts +2 -2
  40. package/dist/types/routes/management-api/guardian.d.ts +5 -5
  41. package/dist/types/routes/management-api/helpers.d.ts +1 -1
  42. package/dist/types/routes/management-api/hook-code.d.ts +2 -2
  43. package/dist/types/routes/management-api/index.d.ts +251 -172
  44. package/dist/types/routes/management-api/keys.d.ts +8 -8
  45. package/dist/types/routes/management-api/log-streams.d.ts +6 -6
  46. package/dist/types/routes/management-api/logs.d.ts +4 -4
  47. package/dist/types/routes/management-api/migration-sources.d.ts +6 -6
  48. package/dist/types/routes/management-api/organizations.d.ts +4 -4
  49. package/dist/types/routes/management-api/prompts.d.ts +6 -6
  50. package/dist/types/routes/management-api/self-service-profiles.d.ts +345 -0
  51. package/dist/types/routes/management-api/tenant-export-import.d.ts +5 -5
  52. package/dist/types/routes/management-api/tenant-operations.d.ts +10 -10
  53. package/dist/types/routes/management-api/tenants.d.ts +13 -13
  54. package/dist/types/routes/management-api/themes.d.ts +9 -9
  55. package/dist/types/routes/management-api/users.d.ts +29 -29
  56. package/dist/types/routes/universal-login/common.d.ts +12 -828
  57. package/dist/types/routes/universal-login/identifier.d.ts +2 -2
  58. package/dist/types/routes/universal-login/index.d.ts +2 -2
  59. package/dist/types/routes/universal-login/u2-index.d.ts +5 -5
  60. package/dist/types/routes/universal-login/u2-routes.d.ts +5 -5
  61. package/dist/types/state-machines/login-session.d.ts +1 -1
  62. package/dist/types/types/Bindings.d.ts +1 -0
  63. package/dist/types/utils/username-password-provider.d.ts +14 -3
  64. package/package.json +6 -6
  65. package/dist/mfa-attempts-BOWgbEPg.js +0 -275
@@ -39,6 +39,7 @@ export declare const passwordlessGrantParamsSchema: z.ZodObject<{
39
39
  values: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
40
40
  }, z.core.$strip>]>>>>;
41
41
  }, z.core.$strip>>;
42
+ connection: z.ZodOptional<z.ZodString>;
42
43
  vendor_id: z.ZodOptional<z.ZodString>;
43
44
  }, z.core.$strip>>;
44
45
  enforceIpCheck: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -116,416 +117,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
116
117
  } | undefined;
117
118
  }[] | undefined;
118
119
  };
119
- client: {
120
- created_at: string;
121
- updated_at: string;
122
- name: string;
123
- global: boolean;
124
- is_first_party: boolean;
125
- oidc_conformant: boolean;
126
- auth0_conformant: boolean;
127
- sso: boolean;
128
- sso_disabled: boolean;
129
- cross_origin_authentication: boolean;
130
- custom_login_page_on: boolean;
131
- require_pushed_authorization_requests: boolean;
132
- require_proof_of_possession: boolean;
133
- client_id: string;
134
- tenant: {
135
- created_at: string;
136
- updated_at: string;
137
- friendly_name: string;
138
- id: string;
139
- parent_tenant_id?: string | null | undefined;
140
- config_sync?: "inherit-on-read" | "synced" | "detached" | null | undefined;
141
- config_sync_hash?: string | null | undefined;
142
- config_synced_at?: string | null | undefined;
143
- audience?: string | undefined;
144
- picture_url?: string | undefined;
145
- support_email?: string | undefined;
146
- support_url?: string | undefined;
147
- sender_email?: string | undefined;
148
- sender_name?: string | undefined;
149
- session_lifetime?: number | undefined;
150
- idle_session_lifetime?: number | undefined;
151
- ephemeral_session_lifetime?: number | undefined;
152
- idle_ephemeral_session_lifetime?: number | undefined;
153
- session_cookie?: {
154
- mode?: "persistent" | "non-persistent" | undefined;
155
- } | undefined;
156
- allowed_logout_urls?: string[] | undefined;
157
- default_redirection_uri?: string | undefined;
158
- default_client_id?: string | undefined;
159
- enabled_locales?: string[] | undefined;
160
- default_directory?: string | undefined;
161
- error_page?: {
162
- html?: string | undefined;
163
- show_log_link?: boolean | undefined;
164
- url?: string | undefined;
165
- } | null | undefined;
166
- flags?: {
167
- allow_changing_enable_sso?: boolean | undefined;
168
- allow_legacy_delegation_grant_types?: boolean | undefined;
169
- allow_legacy_ro_grant_types?: boolean | undefined;
170
- allow_legacy_tokeninfo_endpoint?: boolean | undefined;
171
- change_pwd_flow_v1?: boolean | undefined;
172
- client_id_metadata_document_registration?: boolean | undefined;
173
- custom_domains_provisioning?: boolean | undefined;
174
- dashboard_insights_view?: boolean | undefined;
175
- dashboard_log_streams_next?: boolean | undefined;
176
- disable_clickjack_protection_headers?: boolean | undefined;
177
- disable_fields_map_fix?: boolean | undefined;
178
- disable_impersonation?: boolean | undefined;
179
- disable_management_api_sms_obfuscation?: boolean | undefined;
180
- enable_adfs_waad_email_verification?: boolean | undefined;
181
- enable_apis_section?: boolean | undefined;
182
- enable_client_connections?: boolean | undefined;
183
- enable_custom_domain_in_emails?: boolean | undefined;
184
- enable_dynamic_client_registration?: boolean | undefined;
185
- dcr_require_initial_access_token?: boolean | undefined;
186
- dcr_allowed_grant_types?: string[] | undefined;
187
- allow_http_return_to?: string[] | undefined;
188
- enable_idtoken_api2?: boolean | undefined;
189
- enable_legacy_logs_search_v2?: boolean | undefined;
190
- enable_legacy_profile?: boolean | undefined;
191
- enable_pipeline2?: boolean | undefined;
192
- enable_public_signup_user_exists_error?: boolean | undefined;
193
- enable_sso?: boolean | undefined;
194
- enforce_client_authentication_on_passwordless_start?: boolean | undefined;
195
- genai_trial?: boolean | undefined;
196
- improved_signup_bot_detection_in_classic?: boolean | undefined;
197
- mfa_show_factor_list_on_enrollment?: boolean | undefined;
198
- no_disclose_enterprise_connections?: boolean | undefined;
199
- remove_alg_from_jwks?: boolean | undefined;
200
- revoke_refresh_token_grant?: boolean | undefined;
201
- trust_azure_adfs_email_verified_connection_property?: boolean | undefined;
202
- use_scope_descriptions_for_consent?: boolean | undefined;
203
- inherit_global_permissions_in_organizations?: boolean | undefined;
204
- restrict_undefined_scopes?: boolean | undefined;
205
- } | undefined;
206
- sandbox_version?: string | undefined;
207
- legacy_sandbox_version?: string | undefined;
208
- sandbox_versions_available?: string[] | undefined;
209
- change_password?: {
210
- enabled?: boolean | undefined;
211
- html?: string | undefined;
212
- } | undefined;
213
- guardian_mfa_page?: {
214
- enabled?: boolean | undefined;
215
- html?: string | undefined;
216
- } | undefined;
217
- device_flow?: {
218
- charset?: "base20" | "digits" | undefined;
219
- mask?: string | undefined;
220
- } | undefined;
221
- default_token_quota?: {
222
- clients?: {
223
- client_credentials?: Record<string, any> | undefined;
224
- } | undefined;
225
- organizations?: {
226
- client_credentials?: Record<string, any> | undefined;
227
- } | undefined;
228
- } | null | undefined;
229
- default_audience?: string | undefined;
230
- default_organization?: string | undefined;
231
- sessions?: {
232
- oidc_logout_prompt_enabled?: boolean | undefined;
233
- } | undefined;
234
- oidc_logout?: {
235
- rp_logout_end_session_endpoint_discovery?: boolean | undefined;
236
- } | undefined;
237
- allow_organization_name_in_authentication_api?: boolean | undefined;
238
- customize_mfa_in_postlogin_action?: boolean | undefined;
239
- acr_values_supported?: string[] | undefined;
240
- mtls?: {
241
- enable_endpoint_aliases?: boolean | undefined;
242
- } | null | undefined;
243
- pushed_authorization_requests_supported?: boolean | undefined;
244
- authorization_response_iss_parameter_supported?: boolean | undefined;
245
- deployment_type?: "shared" | "wfp" | undefined;
246
- provisioning_state?: "pending" | "ready" | "failed" | undefined;
247
- provisioning_error?: string | undefined;
248
- provisioning_state_changed_at?: string | undefined;
249
- bundle_configuration?: string | undefined;
250
- worker_version?: string | undefined;
251
- database_version?: string | undefined;
252
- worker_script_name?: string | undefined;
253
- storage_kind?: "own_d1" | "existing_d1" | "shared_planetscale" | undefined;
254
- d1_database_id?: string | undefined;
255
- attack_protection?: {
256
- breached_password_detection?: {
257
- enabled?: boolean | undefined;
258
- shields?: string[] | undefined;
259
- admin_notification_frequency?: string[] | undefined;
260
- method?: string | undefined;
261
- stage?: {
262
- "pre-user-registration"?: {
263
- shields?: string[] | undefined;
264
- } | undefined;
265
- "pre-change-password"?: {
266
- shields?: string[] | undefined;
267
- } | undefined;
268
- } | undefined;
269
- } | undefined;
270
- brute_force_protection?: {
271
- enabled?: boolean | undefined;
272
- shields?: string[] | undefined;
273
- allowlist?: string[] | undefined;
274
- mode?: string | undefined;
275
- max_attempts?: number | undefined;
276
- } | undefined;
277
- suspicious_ip_throttling?: {
278
- enabled?: boolean | undefined;
279
- shields?: string[] | undefined;
280
- allowlist?: string[] | undefined;
281
- stage?: {
282
- "pre-login"?: {
283
- max_attempts?: number | undefined;
284
- rate?: number | undefined;
285
- } | undefined;
286
- "pre-user-registration"?: {
287
- max_attempts?: number | undefined;
288
- rate?: number | undefined;
289
- } | undefined;
290
- } | undefined;
291
- } | undefined;
292
- } | undefined;
293
- mfa?: {
294
- factors?: {
295
- sms: boolean;
296
- otp: boolean;
297
- email: boolean;
298
- push_notification: boolean;
299
- webauthn_roaming: boolean;
300
- webauthn_platform: boolean;
301
- recovery_code: boolean;
302
- duo: boolean;
303
- } | undefined;
304
- sms_provider?: {
305
- provider?: "twilio" | "vonage" | "aws_sns" | "phone_message_hook" | undefined;
306
- } | undefined;
307
- twilio?: {
308
- sid?: string | undefined;
309
- auth_token?: string | undefined;
310
- from?: string | undefined;
311
- messaging_service_sid?: string | undefined;
312
- } | undefined;
313
- phone_message?: {
314
- message?: string | undefined;
315
- } | undefined;
316
- allow_remember_browser?: boolean | undefined;
317
- remember_browser_lifetime_in_days?: number | undefined;
318
- policy?: "never" | "always" | "all-applications" | "confidence-score" | undefined;
319
- } | undefined;
320
- is_control_plane?: boolean | undefined;
321
- has_children?: boolean | undefined;
322
- };
323
- connections: {
324
- created_at: string;
325
- updated_at: string;
326
- name: string;
327
- strategy: string;
328
- options: {
329
- kid?: string | undefined;
330
- team_id?: string | undefined;
331
- realms?: string | undefined;
332
- authentication_method?: string | undefined;
333
- client_id?: string | undefined;
334
- client_secret?: string | undefined;
335
- app_secret?: string | undefined;
336
- scope?: string | undefined;
337
- client_secret_hint?: string | undefined;
338
- app_secret_hint?: string | undefined;
339
- twilio_token_hint?: string | undefined;
340
- authorization_endpoint?: string | undefined;
341
- token_endpoint?: string | undefined;
342
- userinfo_endpoint?: string | undefined;
343
- jwks_uri?: string | undefined;
344
- discovery_url?: string | undefined;
345
- issuer?: string | undefined;
346
- token_endpoint_auth_method?: "client_secret_post" | "client_secret_basic" | undefined;
347
- provider?: string | undefined;
348
- from?: string | undefined;
349
- twilio_sid?: string | undefined;
350
- twilio_token?: string | undefined;
351
- icon_url?: string | undefined;
352
- domain_aliases?: string[] | undefined;
353
- callback_url?: string | undefined;
354
- passwordPolicy?: "none" | "low" | "fair" | "good" | "excellent" | undefined;
355
- password_complexity_options?: {
356
- min_length?: number | undefined;
357
- } | undefined;
358
- password_history?: {
359
- enable?: boolean | undefined;
360
- size?: number | undefined;
361
- } | undefined;
362
- password_no_personal_info?: {
363
- enable?: boolean | undefined;
364
- } | undefined;
365
- password_dictionary?: {
366
- enable?: boolean | undefined;
367
- dictionary?: string[] | undefined;
368
- } | undefined;
369
- disable_signup?: boolean | undefined;
370
- brute_force_protection?: boolean | undefined;
371
- import_mode?: boolean | undefined;
372
- configuration?: {
373
- token_endpoint?: string | undefined;
374
- userinfo_endpoint?: string | undefined;
375
- client_id?: string | undefined;
376
- client_secret?: string | undefined;
377
- client_secret_hint?: string | undefined;
378
- realm?: string | undefined;
379
- } | undefined;
380
- attributes?: {
381
- email?: {
382
- identifier?: {
383
- active?: boolean | undefined;
384
- } | undefined;
385
- signup?: {
386
- status?: "required" | "optional" | "disabled" | undefined;
387
- verification?: {
388
- active?: boolean | undefined;
389
- } | undefined;
390
- } | undefined;
391
- validation?: {
392
- allowed?: boolean | undefined;
393
- } | undefined;
394
- unique?: boolean | undefined;
395
- profile_required?: boolean | undefined;
396
- verification_method?: "link" | "code" | undefined;
397
- } | undefined;
398
- username?: {
399
- identifier?: {
400
- active?: boolean | undefined;
401
- } | undefined;
402
- signup?: {
403
- status?: "required" | "optional" | "disabled" | undefined;
404
- } | undefined;
405
- validation?: {
406
- max_length?: number | undefined;
407
- min_length?: number | undefined;
408
- allowed_types?: {
409
- email?: boolean | undefined;
410
- phone_number?: boolean | undefined;
411
- } | undefined;
412
- } | undefined;
413
- profile_required?: boolean | undefined;
414
- } | undefined;
415
- phone_number?: {
416
- identifier?: {
417
- active?: boolean | undefined;
418
- } | undefined;
419
- signup?: {
420
- status?: "required" | "optional" | "disabled" | undefined;
421
- } | undefined;
422
- } | undefined;
423
- } | undefined;
424
- authentication_methods?: {
425
- password?: {
426
- enabled?: boolean | undefined;
427
- } | undefined;
428
- passkey?: {
429
- enabled?: boolean | undefined;
430
- } | undefined;
431
- } | undefined;
432
- passkey_options?: {
433
- challenge_ui?: "both" | "autofill" | "button" | undefined;
434
- local_enrollment_enabled?: boolean | undefined;
435
- progressive_enrollment_enabled?: boolean | undefined;
436
- } | undefined;
437
- requires_username?: boolean | undefined;
438
- validation?: {
439
- username?: {
440
- min?: number | undefined;
441
- max?: number | undefined;
442
- } | undefined;
443
- } | undefined;
444
- set_user_root_attributes?: "on_each_login" | "on_first_login" | "never_on_login" | undefined;
445
- };
446
- scope?: "local" | "shared" | "platform" | undefined;
447
- override?: "none" | "secrets" | "fields" | undefined;
448
- enforce?: boolean | undefined;
449
- id?: string | undefined;
450
- display_name?: string | undefined;
451
- enabled_clients?: string[] | undefined;
452
- response_type?: import("@authhero/adapter-interfaces").AuthorizationResponseType | undefined;
453
- response_mode?: import("@authhero/adapter-interfaces").AuthorizationResponseMode | undefined;
454
- is_domain_connection?: boolean | undefined;
455
- show_as_button?: boolean | undefined;
456
- metadata?: Record<string, any> | undefined;
457
- is_system?: boolean | undefined;
458
- }[];
459
- description?: string | undefined;
460
- client_secret?: string | undefined;
461
- app_type?: "resource_server" | "native" | "spa" | "regular_web" | "non_interactive" | "express_configuration" | "rms" | "box" | "cloudbees" | "concur" | "dropbox" | "mscrm" | "echosign" | "egnyte" | "newrelic" | "office365" | "salesforce" | "sentry" | "sharepoint" | "slack" | "springcm" | "zendesk" | "zoom" | "sso_integration" | "oag" | undefined;
462
- logo_uri?: string | undefined;
463
- callbacks?: string[] | undefined;
464
- allowed_origins?: string[] | undefined;
465
- web_origins?: string[] | undefined;
466
- client_aliases?: string[] | undefined;
467
- allowed_clients?: string[] | undefined;
468
- allowed_logout_urls?: string[] | undefined;
469
- session_transfer?: {
470
- [x: string]: unknown;
471
- can_create_session_transfer_token?: boolean | undefined;
472
- enforce_cascade_revocation?: boolean | undefined;
473
- allowed_authentication_methods?: ("query" | "cookie")[] | undefined;
474
- enforce_device_binding?: "none" | "ip" | "asn" | undefined;
475
- allow_refresh_token?: boolean | undefined;
476
- enforce_online_refresh_tokens?: boolean | undefined;
477
- allow_onward_transfer?: boolean | undefined;
478
- trust_forwarded_ip?: boolean | undefined;
479
- } | undefined;
480
- oidc_logout?: {
481
- [x: string]: unknown;
482
- backchannel_logout_urls?: string[] | undefined;
483
- backchannel_logout_initiators?: {
484
- [x: string]: unknown;
485
- mode?: "custom" | "all" | undefined;
486
- selected_initiators?: string[] | undefined;
487
- } | undefined;
488
- } | undefined;
489
- grant_types?: string[] | undefined;
490
- jwt_configuration?: Record<string, any> | undefined;
491
- signing_keys?: Record<string, any>[] | undefined;
492
- encryption_key?: Record<string, any> | undefined;
493
- cross_origin_loc?: string | undefined;
494
- custom_login_page?: string | undefined;
495
- custom_login_page_preview?: string | undefined;
496
- form_template?: string | undefined;
497
- addons?: Record<string, any> | undefined;
498
- token_endpoint_auth_method?: "none" | "client_secret_post" | "client_secret_basic" | "private_key_jwt" | "client_secret_jwt" | undefined;
499
- client_metadata?: Record<string, string> | undefined;
500
- hide_sign_up_disabled_error?: boolean | undefined;
501
- mobile?: Record<string, any> | undefined;
502
- initiate_login_uri?: string | undefined;
503
- native_social_login?: Record<string, any> | undefined;
504
- refresh_token?: {
505
- rotation_type?: "rotating" | "non-rotating" | undefined;
506
- leeway?: number | undefined;
507
- expiration_type?: "expiring" | "non-expiring" | undefined;
508
- token_lifetime?: number | undefined;
509
- infinite_token_lifetime?: boolean | undefined;
510
- idle_token_lifetime?: number | undefined;
511
- infinite_idle_token_lifetime?: boolean | undefined;
512
- } | undefined;
513
- default_organization?: Record<string, any> | undefined;
514
- organization_usage?: "deny" | "allow" | "require" | undefined;
515
- organization_require_behavior?: "no_prompt" | "pre_login_prompt" | "post_login_prompt" | undefined;
516
- client_authentication_methods?: Record<string, any> | undefined;
517
- signed_request_object?: Record<string, any> | undefined;
518
- compliance_level?: "none" | "fapi1_adv_pkj_par" | "fapi1_adv_mtls_par" | "fapi2_sp_pkj_mtls" | "fapi2_sp_mtls_mtls" | undefined;
519
- par_request_expiry?: number | undefined;
520
- token_quota?: Record<string, any> | undefined;
521
- owner_user_id?: string | undefined;
522
- registration_type?: "manual" | "open_dcr" | "iat_dcr" | undefined;
523
- registration_metadata?: Record<string, any> | undefined;
524
- token_exchange?: {
525
- allow_any_profile_of_type?: "custom_authentication"[] | undefined;
526
- } | undefined;
527
- user_linking_mode?: "builtin" | "off" | undefined;
528
- };
120
+ client: EnrichedClient;
529
121
  loginSession: {
530
122
  csrf_token: string;
531
123
  authParams: {
@@ -558,6 +150,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
558
150
  values?: unknown[] | undefined;
559
151
  } | null> | undefined;
560
152
  } | undefined;
153
+ connection?: string | undefined;
561
154
  vendor_id?: string | undefined;
562
155
  };
563
156
  expires_at: string;
@@ -582,8 +175,8 @@ export declare function passwordlessGrantUser(ctx: Context<{
582
175
  authenticated_at?: string | undefined;
583
176
  tenant_id?: string | undefined;
584
177
  };
585
- connectionType: "username" | "sms" | "email";
586
- authConnection: "username" | "sms" | "email";
178
+ connectionType: "username" | "email" | "sms";
179
+ authConnection: "username" | "email" | "sms";
587
180
  session_id: string | undefined;
588
181
  authParams: {
589
182
  audience?: string | undefined;
@@ -615,6 +208,7 @@ export declare function passwordlessGrantUser(ctx: Context<{
615
208
  values?: unknown[] | undefined;
616
209
  } | null> | undefined;
617
210
  } | undefined;
211
+ connection?: string | undefined;
618
212
  vendor_id?: string | undefined;
619
213
  };
620
214
  }>;
@@ -0,0 +1,21 @@
1
+ import { Bindings } from "../types";
2
+ type FromAddressInput = {
3
+ env: Pick<Bindings, "ISSUER" | "DEFAULT_SENDER_EMAIL">;
4
+ provider?: {
5
+ default_from_address?: string | null;
6
+ } | null;
7
+ tenant?: {
8
+ sender_email?: string | null;
9
+ sender_name?: string | null;
10
+ friendly_name?: string | null;
11
+ } | null;
12
+ };
13
+ /**
14
+ * The `from` address when the template does not set one, in order:
15
+ * the email provider's `default_from_address`, the tenant's `sender_email`
16
+ * (with `sender_name`, else `friendly_name`), the `DEFAULT_SENDER_EMAIL`
17
+ * binding, and last `login@<issuer host>`. `ISSUER` is a full URL, so only
18
+ * its hostname is used.
19
+ */
20
+ export declare function resolveFromAddress({ env, provider, tenant, }: FromAddressInput): string;
21
+ export {};
@@ -70,6 +70,7 @@ export declare const notFound: {
70
70
  tenantOperation: () => JSONHTTPException;
71
71
  rollout: () => JSONHTTPException;
72
72
  tokenExchangeProfile: () => JSONHTTPException;
73
+ selfServiceProfile: () => JSONHTTPException;
73
74
  };
74
75
  /**
75
76
  * 409s. `userExists`, `resourceServer` and `organizationName` are Auth0's
@@ -80,6 +81,8 @@ export declare const conflict: {
80
81
  userExists: () => JSONHTTPException;
81
82
  resourceServer: (identifier: string) => JSONHTTPException;
82
83
  organizationName: () => JSONHTTPException;
84
+ selfServiceProfileLimit: () => JSONHTTPException;
85
+ connectionName: () => JSONHTTPException;
83
86
  /** Any other AuthHero conflict: own message, shared code. */
84
87
  other: (message: string) => JSONHTTPException;
85
88
  };
@@ -0,0 +1,28 @@
1
+ export declare const BRANDING_ASSET_KINDS: readonly ["logo", "favicon", "powered_by_logo", "background", "font"];
2
+ export type BrandingAssetKind = (typeof BRANDING_ASSET_KINDS)[number];
3
+ interface KindRule {
4
+ maxBytes: number;
5
+ /** content type -> file extension */
6
+ types: Record<string, string>;
7
+ }
8
+ export declare const BRANDING_ASSET_RULES: Record<BrandingAssetKind, KindRule>;
9
+ export declare function isBrandingAssetKind(v: string): v is BrandingAssetKind;
10
+ export declare function brandingAssetKey(tenantId: string, kind: BrandingAssetKind, id: string, ext: string): string;
11
+ /** Cache-Control for stored objects. Keys are unique per upload, so immutable. */
12
+ export declare const BRANDING_ASSET_CACHE_CONTROL = "public, max-age=31536000, immutable";
13
+ /** Verifies the file's magic bytes match the declared content type. */
14
+ export declare function matchesSignature(contentType: string, bytes: Uint8Array): boolean;
15
+ /**
16
+ * Defence in depth for SVG uploads. Primary protection is that SVGs are only
17
+ * ever served by the auth server's /assets route with a restrictive CSP; this
18
+ * additionally requires an `<svg>` root (after an optional XML declaration,
19
+ * comments and doctype) and rejects active content, entities and references to
20
+ * external resources.
21
+ */
22
+ export declare function isSafeSvg(bytes: Uint8Array): boolean;
23
+ /**
24
+ * Browsers often report an empty or generic MIME type for fonts. Fall back to
25
+ * the file extension; the magic-byte check still decides acceptance.
26
+ */
27
+ export declare function resolveContentType(kind: BrandingAssetKind, declared: string, filename: string): string;
28
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
+ import { Connection } from "@authhero/adapter-interfaces";
2
3
  import { Bindings } from "../types";
3
4
  import { SsrfFetchOptions } from "../utils/ssrf-fetch";
4
5
  /**
@@ -174,7 +175,7 @@ export declare const enrichedClientSchema: z.ZodObject<{
174
175
  picture_url: z.ZodOptional<z.ZodString>;
175
176
  support_email: z.ZodOptional<z.ZodString>;
176
177
  support_url: z.ZodOptional<z.ZodString>;
177
- sender_email: z.ZodOptional<z.ZodString>;
178
+ sender_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
179
  sender_name: z.ZodOptional<z.ZodString>;
179
180
  session_lifetime: z.ZodOptional<z.ZodNumber>;
180
181
  idle_session_lifetime: z.ZodOptional<z.ZodNumber>;
@@ -555,5 +556,7 @@ export declare const enrichedClientSchema: z.ZodObject<{
555
556
  is_system: z.ZodOptional<z.ZodBoolean>;
556
557
  }, z.core.$strip>>;
557
558
  }, z.core.$strip>;
558
- export type EnrichedClient = z.infer<typeof enrichedClientSchema>;
559
+ export type EnrichedClient = Omit<z.infer<typeof enrichedClientSchema>, "connections"> & {
560
+ connections: Connection[];
561
+ };
559
562
  export declare function getEnrichedClient(env: Bindings, clientId: string, tenantId?: string, fetchOpts?: SsrfFetchOptions): Promise<EnrichedClient>;
@@ -0,0 +1,67 @@
1
+ import { Connection, ConnectionsAdapter, User } from "@authhero/adapter-interfaces";
2
+ /**
3
+ * Scopes a database-user lookup to one database connection (#1702).
4
+ *
5
+ * Every database connection stores its users under the same `auth0` (or
6
+ * legacy `auth2`) provider, so `email:x provider:auth0` cannot tell two
7
+ * database connections apart. A scope narrows the provider-matched rows to
8
+ * the ones that belong to `name`.
9
+ *
10
+ * A row belongs to `name` when its `connection` is `name`, or when its
11
+ * `connection` names no database connection in the tenant at all. The second
12
+ * case covers legacy rows written with a literal instead of the connection's
13
+ * real name (`Username-Password-Authentication` on a tenant whose connection
14
+ * is called something else, `auth0`, `auth2`, or nothing). Those rows can't be
15
+ * attributed to one connection, so they stay visible to every scope, exactly
16
+ * as they are without one. Rows that do name another database connection of
17
+ * the tenant are hidden.
18
+ */
19
+ export interface DatabaseConnectionScope {
20
+ /** The database connection the lookup targets. */
21
+ name: string;
22
+ /** Names of every database connection in the tenant, `name` included. */
23
+ databaseConnectionNames: ReadonlySet<string>;
24
+ }
25
+ /** True when `user` belongs to the scoped connection. No scope matches all. */
26
+ export declare function isUserInConnectionScope(user: Pick<User, "connection">, scope: DatabaseConnectionScope | undefined): boolean;
27
+ /**
28
+ * Order rows so an exact connection match comes before an unattributed legacy
29
+ * row. Only relevant once one identifier can exist in several connections.
30
+ */
31
+ export declare function compareByConnectionScope(scope: DatabaseConnectionScope): (a: Pick<User, "connection">, b: Pick<User, "connection">) => number;
32
+ /**
33
+ * Build the scope for a lookup in database connection `name`.
34
+ *
35
+ * Returns `undefined` (an unscoped lookup, the behaviour before #1702) when:
36
+ * - no name is given,
37
+ * - the tenant has at most one database connection: there is nothing to tell
38
+ * apart, so single-connection tenants never change behaviour,
39
+ * - `name` is not one of the tenant's database connections, for example the
40
+ * generic `Username-Password-Authentication` realm on a tenant whose
41
+ * connection has another name.
42
+ *
43
+ * Lists connections without params so the read is served from the request's
44
+ * client bundle where one exists.
45
+ */
46
+ export declare function resolveDatabaseConnectionScope(connections: Pick<ConnectionsAdapter, "list">, tenant_id: string, name: string | undefined): Promise<DatabaseConnectionScope | undefined>;
47
+ /**
48
+ * The database connection a login or signup for `client` targets. Lookups
49
+ * scope to it and new database users are written with it, so the two always
50
+ * agree.
51
+ *
52
+ * - An explicit realm other than the generic `Username-Password-Authentication`
53
+ * is used as is.
54
+ * - The generic realm (the default) resolves to a client connection carrying
55
+ * that exact name, else to the client's only database connection.
56
+ * - With several database connections on the client and none named like the
57
+ * generic realm, the generic name is returned. A user written with it is
58
+ * visible to every scope unless a tenant connection has that name, and
59
+ * {@link resolveDatabaseConnectionScope} leaves a lookup by it unscoped
60
+ * under the same condition.
61
+ *
62
+ * Choosing between several database connections on one client is #1703; this
63
+ * deliberately does not guess.
64
+ */
65
+ export declare function resolveClientDatabaseConnectionName(client: {
66
+ connections: Pick<Connection, "name" | "strategy">[];
67
+ }, realm?: string): string;
@@ -24,9 +24,9 @@ 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";
27
28
  client_secret_post: "client_secret_post";
28
29
  client_secret_basic: "client_secret_basic";
29
- private_key_jwt: "private_key_jwt";
30
30
  client_secret_jwt: "client_secret_jwt";
31
31
  }>>;
32
32
  jwks_uri: z.ZodOptional<z.ZodString>;
@@ -1,4 +1,4 @@
1
- import { LinkCandidate, User, UserDataAdapter } from "@authhero/adapter-interfaces";
1
+ import { ConnectionsAdapter, LinkCandidate, User, UserDataAdapter } from "@authhero/adapter-interfaces";
2
2
  /**
3
3
  * Resolve the ordered pool of candidate *primary* users that the built-in
4
4
  * email-based account-linking policy would consider for `user`, excluding the
@@ -16,6 +16,12 @@ import { LinkCandidate, User, UserDataAdapter } from "@authhero/adapter-interfac
16
16
  */
17
17
  export declare function resolveLinkCandidates(params: {
18
18
  userAdapter: UserDataAdapter;
19
+ /**
20
+ * When set, users that must never be a link target are left out: users of
21
+ * a self-service SSO connection whose email domain is not verified for it
22
+ * (#1763). Every linking caller passes it.
23
+ */
24
+ connectionAdapter?: Pick<ConnectionsAdapter, "list">;
19
25
  tenantId: string;
20
26
  user: User;
21
27
  }): Promise<User[]>;
@@ -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: ("sub" | "scope" | "tenant_id" | "client_id" | "org_name" | "sid" | "jti" | "permissions" | "exp" | "iat" | "org_id" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "gty" | "nbf" | "act" | "requested_userinfo_claims")[];
17
+ export declare const SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "org_name" | "jti" | "sub" | "scope" | "gty" | "org_id" | "sid" | "permissions" | "iat" | "exp" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "nbf" | "act" | "requested_userinfo_claims")[];
18
18
  /** Client-bound mints: `azp` must stay the registered client id. */
19
- export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("sub" | "scope" | "tenant_id" | "client_id" | "org_name" | "sid" | "jti" | "permissions" | "exp" | "iat" | "org_id" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "azp" | "gty" | "nbf" | "act" | "requested_userinfo_claims")[];
19
+ export declare const CLIENT_SERVICE_TOKEN_RESERVED_CLAIMS: ("tenant_id" | "client_id" | "org_name" | "jti" | "sub" | "scope" | "azp" | "gty" | "org_id" | "sid" | "permissions" | "iat" | "exp" | "iss" | "aud" | "auth_time" | "acr" | "amr" | "nbf" | "act" | "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
  /**