authhero 5.8.1 → 5.9.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 +135 -135
- package/dist/authhero.d.ts +17853 -72311
- package/dist/authhero.mjs +16401 -16771
- package/dist/stats.html +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/adapters/cache/in-memory.d.ts +52 -0
- package/dist/types/adapters/cache/index.d.ts +2 -0
- package/dist/types/adapters/index.d.ts +1 -0
- package/dist/types/authentication-flows/auth0-migration.d.ts +53 -0
- package/dist/types/authentication-flows/authorization-code.d.ts +23 -0
- package/dist/types/authentication-flows/client-credentials.d.ts +16 -0
- package/dist/types/authentication-flows/common.d.ts +253 -0
- package/dist/types/authentication-flows/connection.d.ts +17 -0
- package/dist/types/authentication-flows/mfa.d.ts +49 -0
- package/dist/types/authentication-flows/passkey-enrollment.d.ts +19 -0
- package/dist/types/authentication-flows/password.d.ts +24 -0
- package/dist/types/authentication-flows/passwordless.d.ts +571 -0
- package/dist/types/authentication-flows/refresh-token-migration.d.ts +17 -0
- package/dist/types/authentication-flows/refresh-token.d.ts +15 -0
- package/dist/types/authentication-flows/resume.d.ts +22 -0
- package/dist/types/authentication-flows/silent.d.ts +25 -0
- package/dist/types/authentication-flows/ticket.d.ts +7 -0
- package/dist/types/authentication-flows/try-connection.d.ts +33 -0
- package/dist/types/authentication-flows/universal.d.ts +19 -0
- package/dist/types/build-hash.d.ts +7 -0
- package/dist/types/client/client-bundle.d.ts +1 -0
- package/dist/types/client/form-handler.d.ts +9 -0
- package/dist/types/client/incognito-handler.d.ts +5 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/input-otp.d.ts +12 -0
- package/dist/types/client/password-toggle.d.ts +10 -0
- package/dist/types/client/user-agent-detector.d.ts +22 -0
- package/dist/types/components/AccountChangeEmailPage.d.ts +14 -0
- package/dist/types/components/AccountForm.d.ts +17 -0
- package/dist/types/components/AccountPage.d.ts +15 -0
- package/dist/types/components/AppLogo.d.ts +8 -0
- package/dist/types/components/AuthLayout.d.ts +18 -0
- package/dist/types/components/Button.d.ts +12 -0
- package/dist/types/components/ChangeEmailForm.d.ts +14 -0
- package/dist/types/components/ChangeEmailPage.d.ts +15 -0
- package/dist/types/components/ContinueForm.d.ts +13 -0
- package/dist/types/components/EmailValidatedForm.d.ts +12 -0
- package/dist/types/components/EmailValidatedPage.d.ts +11 -0
- package/dist/types/components/EnterCodeForm.d.ts +13 -0
- package/dist/types/components/EnterCodePage.d.ts +14 -0
- package/dist/types/components/EnterPasswordForm.d.ts +14 -0
- package/dist/types/components/EnterPasswordPage.d.ts +13 -0
- package/dist/types/components/ErrorMessage.d.ts +6 -0
- package/dist/types/components/Footer.d.ts +9 -0
- package/dist/types/components/ForgotPasswordForm.d.ts +14 -0
- package/dist/types/components/ForgotPasswordPage.d.ts +13 -0
- package/dist/types/components/ForgotPasswordSentPage.d.ts +11 -0
- package/dist/types/components/Form.d.ts +6 -0
- package/dist/types/components/FormNodePage.d.ts +16 -0
- package/dist/types/components/GoBack.d.ts +5 -0
- package/dist/types/components/GoogleLogo.d.ts +4 -0
- package/dist/types/components/Icon.d.ts +8 -0
- package/dist/types/components/IconEye.d.ts +8 -0
- package/dist/types/components/IconEyeSlash.d.ts +8 -0
- package/dist/types/components/IconPen.d.ts +7 -0
- package/dist/types/components/IdentifierForm.d.ts +16 -0
- package/dist/types/components/IdentifierPage.d.ts +15 -0
- package/dist/types/components/ImpersonateForm.d.ts +14 -0
- package/dist/types/components/ImpersonationPage.d.ts +13 -0
- package/dist/types/components/InvalidSessionPage.d.ts +11 -0
- package/dist/types/components/Layout.d.ts +11 -0
- package/dist/types/components/LoginForm.d.ts +15 -0
- package/dist/types/components/MessagePage.d.ts +13 -0
- package/dist/types/components/PasswordInput.d.ts +6 -0
- package/dist/types/components/PreSignUpConfirmationPage.d.ts +12 -0
- package/dist/types/components/PreSignUpPage.d.ts +12 -0
- package/dist/types/components/ResetPasswordForm.d.ts +14 -0
- package/dist/types/components/ResetPasswordPage.d.ts +12 -0
- package/dist/types/components/SignUpForm.d.ts +15 -0
- package/dist/types/components/SignUpPage.d.ts +14 -0
- package/dist/types/components/SocialButton.d.ts +10 -0
- package/dist/types/components/Spinner.d.ts +6 -0
- package/dist/types/components/Trans.d.ts +8 -0
- package/dist/types/components/UnverifiedEmailPage.d.ts +11 -0
- package/dist/types/components/UserNotFoundPage.d.ts +12 -0
- package/dist/types/components/VippsLogo.d.ts +4 -0
- package/dist/types/components/index.d.ts +34 -0
- package/dist/types/components/stories/AccountForm.stories.d.ts +13 -0
- package/dist/types/components/stories/AuthLayout.stories.d.ts +27 -0
- package/dist/types/components/stories/ChangeEmailForm.stories.d.ts +11 -0
- package/dist/types/components/stories/ContinueForm.stories.d.ts +10 -0
- package/dist/types/components/stories/EnterCodeForm.stories.d.ts +9 -0
- package/dist/types/components/stories/EnterPasswordForm.stories.d.ts +22 -0
- package/dist/types/components/stories/IdentifierForm.stories.d.ts +42 -0
- package/dist/types/components/stories/IdentifierPage.stories.d.ts +33 -0
- package/dist/types/components/stories/ImpersonateForm.stories.d.ts +11 -0
- package/dist/types/components/stories/LoginForm.stories.d.ts +12 -0
- package/dist/types/components/ui/button.d.ts +12 -0
- package/dist/types/components/ui/card.d.ts +30 -0
- package/dist/types/components/ui/input-otp.d.ts +31 -0
- package/dist/types/components/ui/input.d.ts +15 -0
- package/dist/types/components/ui/label.d.ts +9 -0
- package/dist/types/constants/defaultBranding.d.ts +2 -0
- package/dist/types/constants/defaultTheme.d.ts +2 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/constants.d.ts +15 -0
- package/dist/types/email-services/index.d.ts +3 -0
- package/dist/types/email-services/mailgun.d.ts +18 -0
- package/dist/types/email-services/postmark.d.ts +14 -0
- package/dist/types/email-services/resend.d.ts +14 -0
- package/dist/types/emails/defaults/Layout.d.ts +12 -0
- package/dist/types/emails/defaults/PrimaryButton.d.ts +11 -0
- package/dist/types/emails/defaults/ResetEmail.d.ts +1 -0
- package/dist/types/emails/defaults/ResetEmailByCode.d.ts +1 -0
- package/dist/types/emails/defaults/UserInvitation.d.ts +1 -0
- package/dist/types/emails/defaults/VerifyEmail.d.ts +1 -0
- package/dist/types/emails/defaults/VerifyEmailByCode.d.ts +1 -0
- package/dist/types/emails/defaults/WelcomeEmail.d.ts +1 -0
- package/dist/types/emails/defaults/compiled.d.ts +2 -0
- package/dist/types/emails/defaults/index.d.ts +6 -0
- package/dist/types/emails/defaults/subjects.d.ts +2 -0
- package/dist/types/emails/index.d.ts +70 -0
- package/dist/types/emails/render.d.ts +41 -0
- package/dist/types/errors/is-unique-constraint-error.d.ts +8 -0
- package/dist/types/errors/json-http-exception.d.ts +5 -0
- package/dist/types/errors/redirect-exception.d.ts +6 -0
- package/dist/types/generated/locale-types.d.ts +690 -0
- package/dist/types/helpers/cache-wrapper.d.ts +23 -0
- package/dist/types/helpers/client-assertion.d.ts +49 -0
- package/dist/types/helpers/client-keys.d.ts +27 -0
- package/dist/types/helpers/client.d.ts +496 -0
- package/dist/types/helpers/dcr/constraint-enforcement.d.ts +24 -0
- package/dist/types/helpers/dcr/metadata-mapping.d.ts +83 -0
- package/dist/types/helpers/dcr/mint-iat.d.ts +14 -0
- package/dist/types/helpers/dcr/mint-token.d.ts +7 -0
- package/dist/types/helpers/dcr/validate-connect-origin.d.ts +20 -0
- package/dist/types/helpers/dcr/verify-token.d.ts +8 -0
- package/dist/types/helpers/default-destinations.d.ts +55 -0
- package/dist/types/helpers/entity-hooks-wrapper.d.ts +43 -0
- package/dist/types/helpers/hook-events.d.ts +20 -0
- package/dist/types/helpers/hook-user-payload.d.ts +8 -0
- package/dist/types/helpers/hrd.d.ts +3 -0
- package/dist/types/helpers/logging.d.ts +65 -0
- package/dist/types/helpers/outbox-cleanup.d.ts +10 -0
- package/dist/types/helpers/outbox-destinations/index.d.ts +2 -0
- package/dist/types/helpers/outbox-destinations/log-streams.d.ts +66 -0
- package/dist/types/helpers/outbox-destinations/logs.d.ts +20 -0
- package/dist/types/helpers/outbox-destinations/registration-finalizer.d.ts +29 -0
- package/dist/types/helpers/outbox-destinations/webhooks.d.ts +57 -0
- package/dist/types/helpers/outbox-relay.d.ts +34 -0
- package/dist/types/helpers/password-policy.d.ts +54 -0
- package/dist/types/helpers/request-object.d.ts +40 -0
- package/dist/types/helpers/run-outbox-relay.d.ts +58 -0
- package/dist/types/helpers/saml.d.ts +1 -0
- package/dist/types/helpers/scope-claims.d.ts +4 -0
- package/dist/types/helpers/scopes-permissions.d.ts +38 -0
- package/dist/types/helpers/server-timing.d.ts +12 -0
- package/dist/types/helpers/service-token.d.ts +54 -0
- package/dist/types/helpers/set-tenant-id.d.ts +15 -0
- package/dist/types/helpers/signing-keys.d.ts +16 -0
- package/dist/types/helpers/try-connection-client.d.ts +15 -0
- package/dist/types/helpers/user-linking.d.ts +14 -0
- package/dist/types/helpers/user-session-cleanup.d.ts +21 -0
- package/dist/types/helpers/users.d.ts +46 -0
- package/dist/types/helpers/wait-until.d.ts +21 -0
- package/dist/types/hooks/addDataHooks.d.ts +16 -0
- package/dist/types/hooks/code-executor/local.d.ts +13 -0
- package/dist/types/hooks/codehooks.d.ts +70 -0
- package/dist/types/hooks/formhooks.d.ts +99 -0
- package/dist/types/hooks/helpers/token-api.d.ts +17 -0
- package/dist/types/hooks/index.d.ts +20 -0
- package/dist/types/hooks/link-users.d.ts +29 -0
- package/dist/types/hooks/pagehooks.d.ts +16 -0
- package/dist/types/hooks/post-user-login.d.ts +29 -0
- package/dist/types/hooks/pre-defined/account-linking.d.ts +73 -0
- package/dist/types/hooks/pre-defined/ensure-username.d.ts +86 -0
- package/dist/types/hooks/pre-defined/index.d.ts +23 -0
- package/dist/types/hooks/pre-defined/set-preferred-username.d.ts +26 -0
- package/dist/types/hooks/templatehooks.d.ts +29 -0
- package/dist/types/hooks/user-deletion.d.ts +14 -0
- package/dist/types/hooks/user-registration.d.ts +88 -0
- package/dist/types/hooks/user-update.d.ts +16 -0
- package/dist/types/hooks/validate-signup.d.ts +34 -0
- package/dist/types/hooks/webhooks.d.ts +35 -0
- package/dist/types/i18n/index.d.ts +77 -0
- package/dist/types/index.d.ts +16022 -0
- package/dist/types/locales/index.d.ts +9 -0
- package/dist/types/middlewares/apply-config.d.ts +14 -0
- package/dist/types/middlewares/authentication.d.ts +26 -0
- package/dist/types/middlewares/client-info.d.ts +8 -0
- package/dist/types/middlewares/index.d.ts +6 -0
- package/dist/types/middlewares/outbox.d.ts +24 -0
- package/dist/types/middlewares/register-component.d.ts +10 -0
- package/dist/types/middlewares/tenant.d.ts +12 -0
- package/dist/types/migration-providers/auth0.d.ts +3 -0
- package/dist/types/migration-providers/index.d.ts +5 -0
- package/dist/types/migration-providers/types.d.ts +32 -0
- package/dist/types/routes/auth-api/account.d.ts +36 -0
- package/dist/types/routes/auth-api/authenticate.d.ts +31 -0
- package/dist/types/routes/auth-api/authorize.d.ts +239 -0
- package/dist/types/routes/auth-api/callback.d.ts +234 -0
- package/dist/types/routes/auth-api/connect-start.d.ts +52 -0
- package/dist/types/routes/auth-api/dbconnections.d.ts +43 -0
- package/dist/types/routes/auth-api/index.d.ts +1580 -0
- package/dist/types/routes/auth-api/logout.d.ts +20 -0
- package/dist/types/routes/auth-api/oidc-logout.d.ts +52 -0
- package/dist/types/routes/auth-api/passwordless.d.ts +154 -0
- package/dist/types/routes/auth-api/register/index.d.ts +159 -0
- package/dist/types/routes/auth-api/register/shared.d.ts +30 -0
- package/dist/types/routes/auth-api/revoke.d.ts +73 -0
- package/dist/types/routes/auth-api/token.d.ts +412 -0
- package/dist/types/routes/auth-api/userinfo.d.ts +84 -0
- package/dist/types/routes/auth-api/well-known.d.ts +74 -0
- package/dist/types/routes/management-api/action-executions.d.ts +90 -0
- package/dist/types/routes/management-api/action-triggers.d.ts +118 -0
- package/dist/types/routes/management-api/actions.d.ts +673 -0
- package/dist/types/routes/management-api/analytics.d.ts +18 -0
- package/dist/types/routes/management-api/attack-protection.d.ts +189 -0
- package/dist/types/routes/management-api/authentication-methods.d.ts +115 -0
- package/dist/types/routes/management-api/branding.d.ts +402 -0
- package/dist/types/routes/management-api/client-grants.d.ts +183 -0
- package/dist/types/routes/management-api/client-registration-tokens.d.ts +35 -0
- package/dist/types/routes/management-api/clients.d.ts +995 -0
- package/dist/types/routes/management-api/connections.d.ts +872 -0
- package/dist/types/routes/management-api/custom-domains.d.ts +266 -0
- package/dist/types/routes/management-api/email-templates.d.ts +205 -0
- package/dist/types/routes/management-api/emails.d.ts +124 -0
- package/dist/types/routes/management-api/failed-events.d.ts +146 -0
- package/dist/types/routes/management-api/flows.d.ts +438 -0
- package/dist/types/routes/management-api/forms.d.ts +4090 -0
- package/dist/types/routes/management-api/guardian.d.ts +211 -0
- package/dist/types/routes/management-api/hook-code.d.ts +142 -0
- package/dist/types/routes/management-api/hooks.d.ts +405 -0
- package/dist/types/routes/management-api/index.d.ts +13277 -0
- package/dist/types/routes/management-api/keys.d.ts +98 -0
- package/dist/types/routes/management-api/log-streams.d.ts +170 -0
- package/dist/types/routes/management-api/logs.d.ts +159 -0
- package/dist/types/routes/management-api/migration-sources.d.ts +173 -0
- package/dist/types/routes/management-api/organizations.d.ts +896 -0
- package/dist/types/routes/management-api/prompts.d.ts +150 -0
- package/dist/types/routes/management-api/refresh_tokens.d.ts +66 -0
- package/dist/types/routes/management-api/resource-servers.d.ts +321 -0
- package/dist/types/routes/management-api/roles.d.ts +260 -0
- package/dist/types/routes/management-api/sessions.d.ts +78 -0
- package/dist/types/routes/management-api/stats.d.ts +44 -0
- package/dist/types/routes/management-api/tenants.d.ts +546 -0
- package/dist/types/routes/management-api/themes.d.ts +265 -0
- package/dist/types/routes/management-api/tickets.d.ts +75 -0
- package/dist/types/routes/management-api/users-by-email.d.ts +90 -0
- package/dist/types/routes/management-api/users.d.ts +1085 -0
- package/dist/types/routes/saml/index.d.ts +64 -0
- package/dist/types/routes/saml/samlp.d.ts +64 -0
- package/dist/types/routes/setup.d.ts +6 -0
- package/dist/types/routes/universal-login/account-change-email-confirmation.d.ts +30 -0
- package/dist/types/routes/universal-login/account-change-email-verify.d.ts +66 -0
- package/dist/types/routes/universal-login/account-change-email.d.ts +58 -0
- package/dist/types/routes/universal-login/account.d.ts +64 -0
- package/dist/types/routes/universal-login/common.d.ts +1482 -0
- package/dist/types/routes/universal-login/continue.d.ts +37 -0
- package/dist/types/routes/universal-login/enter-password.d.ts +49 -0
- package/dist/types/routes/universal-login/error-handler.d.ts +14 -0
- package/dist/types/routes/universal-login/error-page.d.ts +32 -0
- package/dist/types/routes/universal-login/error.d.ts +20 -0
- package/dist/types/routes/universal-login/flow-api.d.ts +381 -0
- package/dist/types/routes/universal-login/flow-widget.d.ts +23 -0
- package/dist/types/routes/universal-login/forgot-password.d.ts +32 -0
- package/dist/types/routes/universal-login/form-node.d.ts +74 -0
- package/dist/types/routes/universal-login/identifier.d.ts +55 -0
- package/dist/types/routes/universal-login/impersonate.d.ts +71 -0
- package/dist/types/routes/universal-login/index.d.ts +748 -0
- package/dist/types/routes/universal-login/info.d.ts +20 -0
- package/dist/types/routes/universal-login/invalid-session.d.ts +19 -0
- package/dist/types/routes/universal-login/otp-challenge.d.ts +54 -0
- package/dist/types/routes/universal-login/pre-signup-sent.d.ts +19 -0
- package/dist/types/routes/universal-login/pre-signup.d.ts +32 -0
- package/dist/types/routes/universal-login/reset-password.d.ts +39 -0
- package/dist/types/routes/universal-login/sanitization-utils.d.ts +55 -0
- package/dist/types/routes/universal-login/screen-api.d.ts +20 -0
- package/dist/types/routes/universal-login/screens/accept-invitation.d.ts +13 -0
- package/dist/types/routes/universal-login/screens/account-delete.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account-helpers.d.ts +13 -0
- package/dist/types/routes/universal-login/screens/account-linked.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account-mfa-phone-enrollment.d.ts +10 -0
- package/dist/types/routes/universal-login/screens/account-mfa-totp-enrollment.d.ts +10 -0
- package/dist/types/routes/universal-login/screens/account-passkeys.d.ts +10 -0
- package/dist/types/routes/universal-login/screens/account-profile.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account-security.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/account.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/connect-consent.d.ts +9 -0
- package/dist/types/routes/universal-login/screens/connect-tenant-select.d.ts +13 -0
- package/dist/types/routes/universal-login/screens/email-otp-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/enter-password.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/forgot-password.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/identifier.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/impersonate.d.ts +15 -0
- package/dist/types/routes/universal-login/screens/index.d.ts +29 -0
- package/dist/types/routes/universal-login/screens/login-passwordless-identifier.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/login.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/magic-link-sent.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/mfa-login-options.d.ts +21 -0
- package/dist/types/routes/universal-login/screens/mfa-phone-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/mfa-phone-enrollment.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/mfa-totp-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/mfa-totp-enrollment.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/passkey-challenge.d.ts +16 -0
- package/dist/types/routes/universal-login/screens/passkey-enrollment-nudge.d.ts +17 -0
- package/dist/types/routes/universal-login/screens/passkey-enrollment.d.ts +11 -0
- package/dist/types/routes/universal-login/screens/passkey-utils.d.ts +100 -0
- package/dist/types/routes/universal-login/screens/registry.d.ts +28 -0
- package/dist/types/routes/universal-login/screens/reset-password-code.d.ts +18 -0
- package/dist/types/routes/universal-login/screens/reset-password.d.ts +36 -0
- package/dist/types/routes/universal-login/screens/signup.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/sms-otp-challenge.d.ts +14 -0
- package/dist/types/routes/universal-login/screens/try-connection-result.d.ts +12 -0
- package/dist/types/routes/universal-login/screens/types.d.ts +167 -0
- package/dist/types/routes/universal-login/signup.d.ts +54 -0
- package/dist/types/routes/universal-login/u2-form-node.d.ts +93 -0
- package/dist/types/routes/universal-login/u2-index.d.ts +337 -0
- package/dist/types/routes/universal-login/u2-routes.d.ts +262 -0
- package/dist/types/routes/universal-login/u2-widget-page.d.ts +187 -0
- package/dist/types/routes/universal-login/universal-login-template.d.ts +55 -0
- package/dist/types/routes/universal-login/validate-email.d.ts +20 -0
- package/dist/types/routes/universal-login/widget-routes.d.ts +81 -0
- package/dist/types/seed.d.ts +86 -0
- package/dist/types/state-machines/index.d.ts +1 -0
- package/dist/types/state-machines/login-session.d.ts +173 -0
- package/dist/types/storybook-utils/HonoJSXWrapper.d.ts +43 -0
- package/dist/types/strategies/apple.d.ts +24 -0
- package/dist/types/strategies/facebook.d.ts +20 -0
- package/dist/types/strategies/github.d.ts +23 -0
- package/dist/types/strategies/google-oauth2.d.ts +43 -0
- package/dist/types/strategies/index.d.ts +69 -0
- package/dist/types/strategies/internal-oauth2.d.ts +17 -0
- package/dist/types/strategies/microsoft.d.ts +24 -0
- package/dist/types/strategies/oauth2.d.ts +38 -0
- package/dist/types/strategies/oidc.d.ts +38 -0
- package/dist/types/strategies/saml.d.ts +9 -0
- package/dist/types/strategies/vipps.d.ts +16 -0
- package/dist/types/styles/index.d.ts +9 -0
- package/dist/types/styles/tailwind.d.ts +1 -0
- package/dist/types/types/Auth0Client.d.ts +9 -0
- package/dist/types/types/AuthError.d.ts +14 -0
- package/dist/types/types/AuthHeroConfig.d.ts +415 -0
- package/dist/types/types/Bindings.d.ts +51 -0
- package/dist/types/types/GrantFlowResult.d.ts +22 -0
- package/dist/types/types/Hooks.d.ts +240 -0
- package/dist/types/types/IdToken.d.ts +30 -0
- package/dist/types/types/UserInfo.d.ts +8 -0
- package/dist/types/types/Variables.d.ts +33 -0
- package/dist/types/types/auth0/Query.d.ts +12 -0
- package/dist/types/types/auth0/Totals.d.ts +11 -0
- package/dist/types/types/auth0/UserResponse.d.ts +46 -0
- package/dist/types/types/auth0/index.d.ts +3 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/saml.d.ts +1 -0
- package/dist/types/utils/append-log.d.ts +10 -0
- package/dist/types/utils/auth-header.d.ts +18 -0
- package/dist/types/utils/auth0-upstream.d.ts +60 -0
- package/dist/types/utils/authIframe.d.ts +11 -0
- package/dist/types/utils/client-info.d.ts +47 -0
- package/dist/types/utils/color.d.ts +23 -0
- package/dist/types/utils/connections.d.ts +11 -0
- package/dist/types/utils/cookies.d.ts +28 -0
- package/dist/types/utils/crypto.d.ts +2 -0
- package/dist/types/utils/deep-merge.d.ts +6 -0
- package/dist/types/utils/define-route.d.ts +20 -0
- package/dist/types/utils/encryption.d.ts +22 -0
- package/dist/types/utils/entity-id.d.ts +13 -0
- package/dist/types/utils/fetchAll.d.ts +60 -0
- package/dist/types/utils/form-post.d.ts +1 -0
- package/dist/types/utils/id-token-hash.d.ts +1 -0
- package/dist/types/utils/incognito.d.ts +11 -0
- package/dist/types/utils/instance-to-json.d.ts +8 -0
- package/dist/types/utils/ip.d.ts +8 -0
- package/dist/types/utils/is-valid-redirect-url.d.ts +4 -0
- package/dist/types/utils/jwk-alg.d.ts +20 -0
- package/dist/types/utils/jwks.d.ts +41 -0
- package/dist/types/utils/jwt.d.ts +15 -0
- package/dist/types/utils/organization-id.d.ts +2 -0
- package/dist/types/utils/otp.d.ts +1 -0
- package/dist/types/utils/refresh-token-format.d.ts +20 -0
- package/dist/types/utils/safe-compare.d.ts +1 -0
- package/dist/types/utils/sort.d.ts +4 -0
- package/dist/types/utils/ssrf-fetch.d.ts +44 -0
- package/dist/types/utils/ulid.d.ts +1 -0
- package/dist/types/utils/url.d.ts +16 -0
- package/dist/types/utils/user-id.d.ts +2 -0
- package/dist/types/utils/username-password-provider.d.ts +67 -0
- package/dist/types/utils/username.d.ts +11 -0
- package/dist/types/variables.d.ts +4 -0
- package/package.json +11 -11
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { AuthorizationResponseMode, AuthorizationResponseType, DataAdapters, RolePermissionInsert, User } from "@authhero/adapter-interfaces";
|
|
2
|
+
import { EnrichedClient } from "../helpers/client";
|
|
3
|
+
import { Context } from "hono";
|
|
4
|
+
import { Bindings } from "./Bindings";
|
|
5
|
+
import { Variables } from "./Variables";
|
|
6
|
+
/** Context passed to entity hooks */
|
|
7
|
+
export interface EntityHookContext {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
adapters: DataAdapters;
|
|
10
|
+
}
|
|
11
|
+
/** CRUD hooks for entity operations */
|
|
12
|
+
export interface EntityHooks<TEntity, TInsert, TUpdate = Partial<TInsert>> {
|
|
13
|
+
beforeCreate?: (ctx: EntityHookContext, data: TInsert) => Promise<TInsert>;
|
|
14
|
+
afterCreate?: (ctx: EntityHookContext, entity: TEntity) => Promise<void>;
|
|
15
|
+
beforeUpdate?: (ctx: EntityHookContext, id: string, data: TUpdate) => Promise<TUpdate>;
|
|
16
|
+
afterUpdate?: (ctx: EntityHookContext, id: string, entity: TEntity) => Promise<void>;
|
|
17
|
+
beforeDelete?: (ctx: EntityHookContext, id: string) => Promise<void>;
|
|
18
|
+
afterDelete?: (ctx: EntityHookContext, id: string) => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/** Hooks for role permission assign/remove operations */
|
|
21
|
+
export interface RolePermissionHooks {
|
|
22
|
+
beforeAssign?: (ctx: EntityHookContext, roleId: string, permissions: RolePermissionInsert[]) => Promise<RolePermissionInsert[]>;
|
|
23
|
+
afterAssign?: (ctx: EntityHookContext, roleId: string, permissions: RolePermissionInsert[]) => Promise<void>;
|
|
24
|
+
beforeRemove?: (ctx: EntityHookContext, roleId: string, permissions: Pick<RolePermissionInsert, "resource_server_identifier" | "permission_name">[]) => Promise<Pick<RolePermissionInsert, "resource_server_identifier" | "permission_name">[]>;
|
|
25
|
+
afterRemove?: (ctx: EntityHookContext, roleId: string, permissions: Pick<RolePermissionInsert, "resource_server_identifier" | "permission_name">[]) => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export type Transaction = {
|
|
28
|
+
id?: string;
|
|
29
|
+
locale: string;
|
|
30
|
+
login_hint?: string;
|
|
31
|
+
prompt?: string;
|
|
32
|
+
redirect_uri?: string;
|
|
33
|
+
requested_scopes?: string[];
|
|
34
|
+
response_mode?: AuthorizationResponseMode;
|
|
35
|
+
response_type?: AuthorizationResponseType;
|
|
36
|
+
state?: string;
|
|
37
|
+
ui_locales?: string;
|
|
38
|
+
};
|
|
39
|
+
export type HookRequest = {
|
|
40
|
+
asn?: string;
|
|
41
|
+
body?: Record<string, unknown>;
|
|
42
|
+
geoip?: {
|
|
43
|
+
cityName?: string;
|
|
44
|
+
continentCode?: string;
|
|
45
|
+
countryCode?: string;
|
|
46
|
+
latitude?: number;
|
|
47
|
+
longitude?: number;
|
|
48
|
+
subdivisionCode?: string;
|
|
49
|
+
subdivisionName?: string;
|
|
50
|
+
timeZone?: string;
|
|
51
|
+
};
|
|
52
|
+
hostname?: string;
|
|
53
|
+
ip: string;
|
|
54
|
+
language?: string;
|
|
55
|
+
method: string;
|
|
56
|
+
user_agent?: string;
|
|
57
|
+
url: string;
|
|
58
|
+
};
|
|
59
|
+
export type HookEvent = {
|
|
60
|
+
ctx: Context<{
|
|
61
|
+
Bindings: Bindings;
|
|
62
|
+
Variables: Variables;
|
|
63
|
+
}>;
|
|
64
|
+
client?: EnrichedClient;
|
|
65
|
+
request: HookRequest;
|
|
66
|
+
transaction?: Transaction;
|
|
67
|
+
user?: User;
|
|
68
|
+
scope?: string;
|
|
69
|
+
grant_type?: string;
|
|
70
|
+
audience?: string;
|
|
71
|
+
authentication?: {
|
|
72
|
+
methods: Array<{
|
|
73
|
+
name: string;
|
|
74
|
+
timestamp?: string;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
authorization?: {
|
|
78
|
+
roles: string[];
|
|
79
|
+
};
|
|
80
|
+
connection?: {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
strategy: string;
|
|
84
|
+
metadata?: Record<string, unknown>;
|
|
85
|
+
};
|
|
86
|
+
organization?: {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
display_name: string;
|
|
90
|
+
metadata?: Record<string, unknown>;
|
|
91
|
+
};
|
|
92
|
+
resource_server?: {
|
|
93
|
+
identifier: string;
|
|
94
|
+
};
|
|
95
|
+
stats?: {
|
|
96
|
+
logins_count: number;
|
|
97
|
+
};
|
|
98
|
+
tenant?: {
|
|
99
|
+
id: string;
|
|
100
|
+
};
|
|
101
|
+
session?: {
|
|
102
|
+
id?: string;
|
|
103
|
+
created_at?: string;
|
|
104
|
+
authenticated_at?: string;
|
|
105
|
+
clients?: Array<{
|
|
106
|
+
client_id: string;
|
|
107
|
+
}>;
|
|
108
|
+
device?: {
|
|
109
|
+
initial_ip?: string;
|
|
110
|
+
initial_user_agent?: string;
|
|
111
|
+
last_ip?: string;
|
|
112
|
+
last_user_agent?: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
security_context?: {
|
|
116
|
+
ja3?: string;
|
|
117
|
+
ja4?: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export type TokenAPI = {
|
|
121
|
+
createServiceToken: (params: {
|
|
122
|
+
scope: string;
|
|
123
|
+
expiresInSeconds?: number;
|
|
124
|
+
customClaims?: Record<string, unknown>;
|
|
125
|
+
}) => Promise<string>;
|
|
126
|
+
};
|
|
127
|
+
export type OnExecuteCredentialsExchangeAPI = {
|
|
128
|
+
accessToken: {
|
|
129
|
+
setCustomClaim: (claim: string, value: any) => void;
|
|
130
|
+
};
|
|
131
|
+
idToken: {
|
|
132
|
+
setCustomClaim: (claim: string, value: any) => void;
|
|
133
|
+
};
|
|
134
|
+
access: {
|
|
135
|
+
deny: (code: string, reason?: string) => void;
|
|
136
|
+
};
|
|
137
|
+
token: TokenAPI;
|
|
138
|
+
};
|
|
139
|
+
export type OnExecuteCredentialsExchange = (event: HookEvent, access: OnExecuteCredentialsExchangeAPI) => Promise<void>;
|
|
140
|
+
export type OnExecutePreUserRegistrationAPI = {
|
|
141
|
+
user: {
|
|
142
|
+
setUserMetadata: (key: string, value: any) => void;
|
|
143
|
+
setLinkedTo: (primaryUserId: string) => void;
|
|
144
|
+
};
|
|
145
|
+
access: {
|
|
146
|
+
deny: (code: string, reason?: string) => void;
|
|
147
|
+
};
|
|
148
|
+
token: TokenAPI;
|
|
149
|
+
};
|
|
150
|
+
export type OnExecutePostUserRegistrationAPI = {
|
|
151
|
+
user: {};
|
|
152
|
+
token: TokenAPI;
|
|
153
|
+
};
|
|
154
|
+
export type OnExecutePreUserRegistration = (event: HookEvent, api: OnExecutePreUserRegistrationAPI) => Promise<void>;
|
|
155
|
+
export type OnExecutePostUserRegistration = (event: HookEvent, api: OnExecutePostUserRegistrationAPI) => Promise<void>;
|
|
156
|
+
export type OnExecutePreUserUpdateAPI = {
|
|
157
|
+
user: {
|
|
158
|
+
setUserMetadata: (key: string, value: any) => void;
|
|
159
|
+
};
|
|
160
|
+
cancel: () => void;
|
|
161
|
+
token: TokenAPI;
|
|
162
|
+
};
|
|
163
|
+
export type OnExecutePreUserUpdate = (event: HookEvent & {
|
|
164
|
+
user_id: string;
|
|
165
|
+
updates: Partial<User>;
|
|
166
|
+
}, api: OnExecutePreUserUpdateAPI) => Promise<void>;
|
|
167
|
+
export type OnExecutePostLoginAPI = {
|
|
168
|
+
prompt: {
|
|
169
|
+
render: (formId: string) => void;
|
|
170
|
+
};
|
|
171
|
+
redirect: {
|
|
172
|
+
sendUserTo: (url: string, options?: {
|
|
173
|
+
query?: Record<string, string>;
|
|
174
|
+
}) => void;
|
|
175
|
+
encodeToken: (options: {
|
|
176
|
+
secret: string;
|
|
177
|
+
payload: Record<string, any>;
|
|
178
|
+
expiresInSeconds?: number;
|
|
179
|
+
}) => string;
|
|
180
|
+
validateToken: (options: {
|
|
181
|
+
secret: string;
|
|
182
|
+
tokenParameterName?: string;
|
|
183
|
+
}) => Record<string, any> | null;
|
|
184
|
+
};
|
|
185
|
+
token: TokenAPI;
|
|
186
|
+
};
|
|
187
|
+
export type OnExecutePostLogin = (event: HookEvent, api: OnExecutePostLoginAPI) => Promise<void>;
|
|
188
|
+
export type OnExecutePreUserDeletionAPI = {
|
|
189
|
+
cancel: () => void;
|
|
190
|
+
token: TokenAPI;
|
|
191
|
+
};
|
|
192
|
+
export type OnExecutePreUserDeletion = (event: HookEvent & {
|
|
193
|
+
user_id: string;
|
|
194
|
+
}, api: OnExecutePreUserDeletionAPI) => Promise<void>;
|
|
195
|
+
export type OnExecutePostUserDeletionAPI = {
|
|
196
|
+
token: TokenAPI;
|
|
197
|
+
};
|
|
198
|
+
export type OnExecutePostUserDeletion = (event: HookEvent & {
|
|
199
|
+
user_id: string;
|
|
200
|
+
}, api: OnExecutePostUserDeletionAPI) => Promise<void>;
|
|
201
|
+
export type OnExecuteValidateRegistrationUsernameAPI = {
|
|
202
|
+
deny: (reason?: string) => void;
|
|
203
|
+
token: TokenAPI;
|
|
204
|
+
};
|
|
205
|
+
export type OnExecuteValidateRegistrationUsername = (event: Omit<HookEvent, "user"> & {
|
|
206
|
+
user: {
|
|
207
|
+
email: string;
|
|
208
|
+
connection: string;
|
|
209
|
+
};
|
|
210
|
+
}, api: OnExecuteValidateRegistrationUsernameAPI) => Promise<void>;
|
|
211
|
+
export type UserInfoEvent = {
|
|
212
|
+
ctx: Context<{
|
|
213
|
+
Bindings: Bindings;
|
|
214
|
+
Variables: Variables;
|
|
215
|
+
}>;
|
|
216
|
+
user: User;
|
|
217
|
+
tenant_id: string;
|
|
218
|
+
scopes: string[];
|
|
219
|
+
};
|
|
220
|
+
export type OnFetchUserInfoAPI = {
|
|
221
|
+
setCustomClaim: (claim: string, value: unknown) => void;
|
|
222
|
+
};
|
|
223
|
+
/** Called when /userinfo endpoint is accessed */
|
|
224
|
+
export type OnFetchUserInfo = (event: UserInfoEvent, api: OnFetchUserInfoAPI) => Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* All available auth flow hooks.
|
|
227
|
+
* This type is shared between AuthHeroConfig and Bindings to ensure consistency.
|
|
228
|
+
*/
|
|
229
|
+
export type Hooks = {
|
|
230
|
+
onExecuteCredentialsExchange?: OnExecuteCredentialsExchange;
|
|
231
|
+
onExecutePreUserRegistration?: OnExecutePreUserRegistration;
|
|
232
|
+
onExecutePostUserRegistration?: OnExecutePostUserRegistration;
|
|
233
|
+
onExecutePreUserUpdate?: OnExecutePreUserUpdate;
|
|
234
|
+
onExecutePostLogin?: OnExecutePostLogin;
|
|
235
|
+
onExecutePreUserDeletion?: OnExecutePreUserDeletion;
|
|
236
|
+
onExecutePostUserDeletion?: OnExecutePostUserDeletion;
|
|
237
|
+
onExecuteValidateRegistrationUsername?: OnExecuteValidateRegistrationUsername;
|
|
238
|
+
/** Called when /userinfo endpoint is accessed to add custom claims */
|
|
239
|
+
onFetchUserInfo?: OnFetchUserInfo;
|
|
240
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const idTokenSchema: z.ZodObject<{
|
|
3
|
+
iss: z.ZodString;
|
|
4
|
+
sub: z.ZodString;
|
|
5
|
+
aud: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
6
|
+
exp: z.ZodNumber;
|
|
7
|
+
email: z.ZodOptional<z.ZodString>;
|
|
8
|
+
given_name: z.ZodOptional<z.ZodString>;
|
|
9
|
+
family_name: z.ZodOptional<z.ZodString>;
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
11
|
+
iat: z.ZodNumber;
|
|
12
|
+
auth_time: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
14
|
+
acr: z.ZodOptional<z.ZodString>;
|
|
15
|
+
amr: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
azp: z.ZodOptional<z.ZodString>;
|
|
17
|
+
at_hash: z.ZodOptional<z.ZodString>;
|
|
18
|
+
c_hash: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$loose>;
|
|
20
|
+
export declare const userInfoSchema: z.ZodObject<{
|
|
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>;
|
|
25
|
+
iss: z.ZodString;
|
|
26
|
+
sub: z.ZodString;
|
|
27
|
+
aud: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
28
|
+
exp: z.ZodNumber;
|
|
29
|
+
}, z.core.$loose>;
|
|
30
|
+
export type IdToken = z.infer<typeof idTokenSchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const userInfoSchema: z.ZodObject<{
|
|
3
|
+
sub: z.ZodString;
|
|
4
|
+
email: z.ZodOptional<z.ZodString>;
|
|
5
|
+
family_name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
given_name: z.ZodOptional<z.ZodString>;
|
|
7
|
+
email_verified: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LoginSession } from "@authhero/adapter-interfaces";
|
|
2
|
+
import { CountryCode } from "libphonenumber-js";
|
|
3
|
+
import { Auth0Client } from "./Auth0Client";
|
|
4
|
+
export type Variables = {
|
|
5
|
+
tenant_id: string;
|
|
6
|
+
ip: string;
|
|
7
|
+
client_id?: string;
|
|
8
|
+
user_id?: string;
|
|
9
|
+
username?: string;
|
|
10
|
+
connection?: string;
|
|
11
|
+
body?: any;
|
|
12
|
+
log?: string;
|
|
13
|
+
custom_domain?: string;
|
|
14
|
+
host?: string;
|
|
15
|
+
user?: {
|
|
16
|
+
sub: string;
|
|
17
|
+
tenant_id: string;
|
|
18
|
+
org_name?: string;
|
|
19
|
+
org_id?: string;
|
|
20
|
+
scope?: string;
|
|
21
|
+
};
|
|
22
|
+
organization_id?: string;
|
|
23
|
+
org_name?: string;
|
|
24
|
+
loginSession?: LoginSession;
|
|
25
|
+
auth0_client?: Auth0Client;
|
|
26
|
+
useragent?: string;
|
|
27
|
+
countryCode?: CountryCode;
|
|
28
|
+
outboxEventPromises?: Promise<string>[];
|
|
29
|
+
backgroundPromises?: Promise<void>[];
|
|
30
|
+
client_authenticated_via_assertion?: boolean;
|
|
31
|
+
action_execution_id?: string;
|
|
32
|
+
is_lazy_migration?: boolean;
|
|
33
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const querySchema: z.ZodObject<{
|
|
3
|
+
page: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string>>;
|
|
4
|
+
per_page: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<number, string>>;
|
|
5
|
+
include_totals: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<boolean, string>>;
|
|
6
|
+
from: z.ZodOptional<z.ZodString>;
|
|
7
|
+
take: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
9
|
+
q: z.ZodOptional<z.ZodString>;
|
|
10
|
+
from_date: z.ZodPreprocess<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
to_date: z.ZodPreprocess<z.ZodOptional<z.ZodNumber>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const totalsSchema: z.ZodObject<{
|
|
3
|
+
start: z.ZodNumber;
|
|
4
|
+
limit: z.ZodNumber;
|
|
5
|
+
length: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export interface Totals {
|
|
8
|
+
start: number;
|
|
9
|
+
limit: number;
|
|
10
|
+
length: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BaseUser } from "@authhero/adapter-interfaces";
|
|
2
|
+
import { z } from "@hono/zod-openapi";
|
|
3
|
+
export interface PostUsersBody extends BaseUser {
|
|
4
|
+
password?: string;
|
|
5
|
+
verify_email?: boolean;
|
|
6
|
+
username?: string;
|
|
7
|
+
connection?: string;
|
|
8
|
+
email_verified?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const userResponseSchema: z.ZodObject<{
|
|
11
|
+
username: z.ZodOptional<z.ZodString>;
|
|
12
|
+
phone_number: z.ZodOptional<z.ZodString>;
|
|
13
|
+
phone_verified: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
given_name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
family_name: z.ZodOptional<z.ZodString>;
|
|
16
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
17
|
+
name: z.ZodOptional<z.ZodString>;
|
|
18
|
+
picture: z.ZodOptional<z.ZodString>;
|
|
19
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
20
|
+
linked_to: z.ZodOptional<z.ZodString>;
|
|
21
|
+
profileData: z.ZodOptional<z.ZodString>;
|
|
22
|
+
app_metadata: z.ZodOptional<z.ZodDefault<z.ZodAny>>;
|
|
23
|
+
user_metadata: z.ZodOptional<z.ZodDefault<z.ZodAny>>;
|
|
24
|
+
middle_name: z.ZodOptional<z.ZodString>;
|
|
25
|
+
preferred_username: z.ZodOptional<z.ZodString>;
|
|
26
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
27
|
+
website: z.ZodOptional<z.ZodString>;
|
|
28
|
+
gender: z.ZodOptional<z.ZodString>;
|
|
29
|
+
birthdate: z.ZodOptional<z.ZodString>;
|
|
30
|
+
zoneinfo: z.ZodOptional<z.ZodString>;
|
|
31
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
formatted: z.ZodOptional<z.ZodString>;
|
|
33
|
+
street_address: z.ZodOptional<z.ZodString>;
|
|
34
|
+
locality: z.ZodOptional<z.ZodString>;
|
|
35
|
+
region: z.ZodOptional<z.ZodString>;
|
|
36
|
+
postal_code: z.ZodOptional<z.ZodString>;
|
|
37
|
+
country: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
email: z.ZodString;
|
|
40
|
+
login_count: z.ZodNumber;
|
|
41
|
+
multifactor: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
+
last_ip: z.ZodOptional<z.ZodString>;
|
|
43
|
+
last_login: z.ZodOptional<z.ZodString>;
|
|
44
|
+
user_id: z.ZodString;
|
|
45
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
46
|
+
export type UserResponse = z.infer<typeof userResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@authhero/saml";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
import { Bindings, Variables } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Appends a message to the ctx.var.log variable.
|
|
5
|
+
* If a log already exists, the new message is appended with a newline separator.
|
|
6
|
+
*/
|
|
7
|
+
export declare function appendLog(ctx: Context<{
|
|
8
|
+
Bindings: Bindings;
|
|
9
|
+
Variables: Variables;
|
|
10
|
+
}>, message: string): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse an HTTP `Authorization` header and return the bearer token payload
|
|
3
|
+
* if and only if the scheme is `Bearer` (case-insensitive).
|
|
4
|
+
*
|
|
5
|
+
* Returns `undefined` for missing header, wrong scheme, or empty token.
|
|
6
|
+
*/
|
|
7
|
+
export declare function extractBearerToken(authHeader?: string): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Parse an HTTP `Authorization: Basic` header into `{ client_id, client_secret }`
|
|
10
|
+
* for OAuth 2.0 client_secret_basic authentication (RFC 6749 §2.3.1).
|
|
11
|
+
*
|
|
12
|
+
* Returns an empty object when the header is missing, uses a non-Basic scheme,
|
|
13
|
+
* or fails to decode.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseBasicAuthHeader(authHeader?: string): {
|
|
16
|
+
client_id?: string;
|
|
17
|
+
client_secret?: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers that call an upstream Auth0 tenant during lazy migration.
|
|
3
|
+
*
|
|
4
|
+
* Used by:
|
|
5
|
+
* - password.ts: ROPG (password-realm grant) on missed local password lookup,
|
|
6
|
+
* followed by /userinfo to read the profile.
|
|
7
|
+
* - refresh-token.ts: forward `grant_type=refresh_token` for tokens that don't
|
|
8
|
+
* match any local row.
|
|
9
|
+
*
|
|
10
|
+
* No M2M token is required: ROPG uses the configured client_id/client_secret,
|
|
11
|
+
* and /userinfo is called with the access_token returned by ROPG.
|
|
12
|
+
*/
|
|
13
|
+
export type Auth0UpstreamErrorCode = "invalid_grant" | "invalid_request" | "unauthorized_client" | "mfa_required" | "access_denied" | "network_error" | "malformed_response" | string;
|
|
14
|
+
export declare class Auth0UpstreamError extends Error {
|
|
15
|
+
readonly status: number;
|
|
16
|
+
readonly code: Auth0UpstreamErrorCode;
|
|
17
|
+
readonly description?: string;
|
|
18
|
+
constructor(status: number, code: Auth0UpstreamErrorCode, description?: string);
|
|
19
|
+
}
|
|
20
|
+
export interface Auth0TokenResponse {
|
|
21
|
+
access_token: string;
|
|
22
|
+
id_token?: string;
|
|
23
|
+
refresh_token?: string;
|
|
24
|
+
expires_in?: number;
|
|
25
|
+
token_type?: string;
|
|
26
|
+
scope?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Auth0UserInfo {
|
|
29
|
+
sub: string;
|
|
30
|
+
email?: string;
|
|
31
|
+
email_verified?: boolean;
|
|
32
|
+
name?: string;
|
|
33
|
+
given_name?: string;
|
|
34
|
+
family_name?: string;
|
|
35
|
+
nickname?: string;
|
|
36
|
+
picture?: string;
|
|
37
|
+
locale?: string;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
export interface PasswordRealmGrantParams {
|
|
41
|
+
tokenEndpoint: string;
|
|
42
|
+
clientId: string;
|
|
43
|
+
clientSecret: string;
|
|
44
|
+
realm: string;
|
|
45
|
+
username: string;
|
|
46
|
+
password: string;
|
|
47
|
+
audience?: string;
|
|
48
|
+
scope?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function passwordRealmGrant(params: PasswordRealmGrantParams): Promise<Auth0TokenResponse>;
|
|
51
|
+
export interface UpstreamRefreshTokenGrantParams {
|
|
52
|
+
tokenEndpoint: string;
|
|
53
|
+
clientId: string;
|
|
54
|
+
clientSecret: string;
|
|
55
|
+
refreshToken: string;
|
|
56
|
+
audience?: string;
|
|
57
|
+
scope?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function upstreamRefreshTokenGrant(params: UpstreamRefreshTokenGrantParams): Promise<Auth0TokenResponse>;
|
|
60
|
+
export declare function fetchUserInfo(userinfoEndpoint: string, accessToken: string): Promise<Auth0UserInfo>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
import { Bindings, Variables } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Renders an iframe response for authentication flows.
|
|
5
|
+
* The Server-Timing header prevents Cloudflare from adding the beacon script
|
|
6
|
+
* which might interfere with Safari ITP.
|
|
7
|
+
*/
|
|
8
|
+
export default function renderAuthIframe(ctx: Context<{
|
|
9
|
+
Bindings: Bindings;
|
|
10
|
+
Variables: Variables;
|
|
11
|
+
}>, targetOrigin: string, response: string, additionalHeaders?: Headers): Response;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CountryCode } from "libphonenumber-js";
|
|
2
|
+
import { Variables } from "../types/Variables";
|
|
3
|
+
import { Context } from "hono";
|
|
4
|
+
/**
|
|
5
|
+
* Get client information from Hono context (when using clientInfoMiddleware)
|
|
6
|
+
* @param c - Hono context
|
|
7
|
+
* @returns Client information object
|
|
8
|
+
*/
|
|
9
|
+
export declare function getClientInfoFromContext(c: Context<{
|
|
10
|
+
Variables: Variables;
|
|
11
|
+
}>): {
|
|
12
|
+
auth0_client?: {
|
|
13
|
+
name: string;
|
|
14
|
+
version: string;
|
|
15
|
+
env?: {
|
|
16
|
+
node?: string | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
ip?: string;
|
|
20
|
+
useragent?: string;
|
|
21
|
+
countryCode?: CountryCode;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Convert structured auth0_client object back to string format for storage
|
|
25
|
+
* @param auth0_client - Structured auth0 client object
|
|
26
|
+
* @returns String representation of auth0 client
|
|
27
|
+
*/
|
|
28
|
+
export declare function stringifyAuth0Client(auth0_client?: {
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
env?: {
|
|
32
|
+
node?: string | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
}): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Get client information from context with auth0Client as string (for backward compatibility)
|
|
37
|
+
* @param c - Hono context
|
|
38
|
+
* @returns Client information object with stringified auth0Client
|
|
39
|
+
*/
|
|
40
|
+
export declare function getClientInfoWithStringAuth0Client(c: Context<{
|
|
41
|
+
Variables: Variables;
|
|
42
|
+
}>): {
|
|
43
|
+
auth0Client?: string;
|
|
44
|
+
ip?: string;
|
|
45
|
+
useragent?: string;
|
|
46
|
+
countryCode?: CountryCode;
|
|
47
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const lighten: (hex: string, percent: number) => string;
|
|
2
|
+
export declare const darken: (hex: string, percent: number) => string;
|
|
3
|
+
/**
|
|
4
|
+
* WCAG relative luminance (0 = black, 1 = white)
|
|
5
|
+
*/
|
|
6
|
+
export declare function relativeLuminance(hex: string): number;
|
|
7
|
+
/**
|
|
8
|
+
* WCAG contrast ratio between two colors (1–21)
|
|
9
|
+
*/
|
|
10
|
+
export declare function contrastRatio(hex1: string, hex2: string): number;
|
|
11
|
+
/**
|
|
12
|
+
* Returns "#ffffff" or "#000000" based on which has better contrast
|
|
13
|
+
* against the given background color.
|
|
14
|
+
*
|
|
15
|
+
* In light mode, white text is slightly favored for borderline colors
|
|
16
|
+
* (e.g. pure red gets white text). In dark mode, black text is favored.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getContrastTextColor(backgroundHex: string, mode?: "light" | "dark"): string;
|
|
19
|
+
/**
|
|
20
|
+
* Adjusts a color to ensure it meets WCAG AA contrast (4.5:1)
|
|
21
|
+
* against the given background. Darkens or lightens in steps.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ensureContrast(foregroundHex: string, backgroundHex: string, minRatio?: number): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Connection } from "@authhero/adapter-interfaces";
|
|
2
|
+
import { Context } from "hono";
|
|
3
|
+
import { Bindings, Variables } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Look up a connection by its `name`. Used to resolve the connection an
|
|
6
|
+
* existing user is registered under so we can read its options.
|
|
7
|
+
*/
|
|
8
|
+
export declare function findConnectionByName(ctx: Context<{
|
|
9
|
+
Bindings: Bindings;
|
|
10
|
+
Variables: Variables;
|
|
11
|
+
}>, tenantId: string, name: string): Promise<Connection | null>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get all values for a specific cookie name.
|
|
3
|
+
* The `cookie` package's parse() only returns the first value for duplicate cookies.
|
|
4
|
+
* This function returns all values to handle scenarios where users may have multiple
|
|
5
|
+
* cookies with the same name due to:
|
|
6
|
+
* - Domain conflicts (e.g., `.example.com` vs `auth.example.com`)
|
|
7
|
+
* - Path conflicts
|
|
8
|
+
* - Partitioned vs non-partitioned cookies (CHIPS)
|
|
9
|
+
* - Browser quirks in cookie ordering
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAllAuthCookies(tenant_id: string, cookieHeaders?: string): string[];
|
|
12
|
+
export declare function getAuthCookie(tenant_id: string, cookieHeaders?: string): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* TEMPORARY: Double-Clear mechanism for cookie migration
|
|
15
|
+
* This can be removed after February 28th, 2026
|
|
16
|
+
*
|
|
17
|
+
* Clears both non-partitioned and partitioned cookies to ensure clean migration.
|
|
18
|
+
* Returns an array of Set-Cookie headers.
|
|
19
|
+
*/
|
|
20
|
+
export declare function clearAuthCookie(tenant_id: string, hostname?: string): string[];
|
|
21
|
+
/**
|
|
22
|
+
* TEMPORARY: Double-Clear mechanism for cookie migration
|
|
23
|
+
* This can be removed after February 28th, 2026
|
|
24
|
+
*
|
|
25
|
+
* First clears any non-partitioned cookie, then sets the new partitioned cookie.
|
|
26
|
+
* Returns an array of Set-Cookie headers.
|
|
27
|
+
*/
|
|
28
|
+
export declare function serializeAuthCookie(tenant_id: string, value: string, hostname?: string): string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type Primitive = string | number | boolean | symbol | bigint | null | undefined;
|
|
2
|
+
type DeepPartial<T> = {
|
|
3
|
+
[P in keyof T]?: T[P] extends Primitive ? T[P] : T[P] extends Array<infer U> ? Array<DeepPartial<U>> : DeepPartial<T[P]>;
|
|
4
|
+
};
|
|
5
|
+
export declare function deepMergePatch<T>(target: T, patch: DeepPartial<T>): T;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OpenAPIRoute, RouteConfig } from "@hono/zod-openapi";
|
|
2
|
+
import { Bindings, Variables } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Pin the handler context to the authhero app's `Bindings`/`Variables` so
|
|
5
|
+
* `ctx.var.tenant_id`, `ctx.env.data`, etc. are typed at the call site.
|
|
6
|
+
*
|
|
7
|
+
* Without this wrapper, `defineOpenAPIRoute`'s `E` generic defaults to the
|
|
8
|
+
* base `Env`, and every handler ends up with `ctx.var: object` and
|
|
9
|
+
* `ctx.env: object | undefined`.
|
|
10
|
+
*
|
|
11
|
+
* Each route file imports `defineRoute` and registers its routes via
|
|
12
|
+
* `new OpenAPIHono<{ Bindings; Variables }>().openapiRoutes([...] as const)`
|
|
13
|
+
* — replacing the pre-1.x chained `.openapi(...)` style.
|
|
14
|
+
*/
|
|
15
|
+
type AuthHeroEnv = {
|
|
16
|
+
Bindings: Bindings;
|
|
17
|
+
Variables: Variables;
|
|
18
|
+
};
|
|
19
|
+
export declare const defineRoute: <R extends RouteConfig, const AddRoute extends boolean | undefined = undefined>(def: OpenAPIRoute<R, AuthHeroEnv, AddRoute>) => OpenAPIRoute<R, AuthHeroEnv, AddRoute>;
|
|
20
|
+
export {};
|