Versions in this module Expand all Collapse all v2 v2.3.0 Aug 28, 2026 Changes in this version + const ErrorReplySchemaName + var AuthenticatedSecurity = &openapi3.SecurityRequirements + var DeviceRegisteredErrCode rout.ErrorCode = "DEVICE_REGISTERED" + var ErrAlreadySwitchedIntoOrg = errors.New("user already switched into organization") + var ErrAnonymousQuestionnaireDraft = errors.New("anonymous questionnaire responses cannot be saved as drafts") + var ErrAssessmentNotFound = errors.New("assessment not found") + var ErrAssessmentResponseAlreadyCompleted = errors.New("assessment response has already been completed") + var ErrAssessmentResponseNotFound = errors.New("assessment response not found") + var ErrAssessmentResponseOverdue = errors.New("assessment response is overdue") + var ErrAuthenticationRequired = errors.New("authentication required") + var ErrBadRequest = errors.New("invalid request") + var ErrConflict = errors.New("conflict") + var ErrDevModeRequired = errors.New("endpoint is only available in dev mode") + var ErrDeviceAlreadyRegistered = errors.New("device already registered") + var ErrDispatcherNotFound = errors.New("no dispatcher found matching the requested name") + var ErrDownloadTokenMissingFile = errors.New("download token missing associated file") + var ErrEmailAlreadyConfirmed = errors.New("email address has already been verified") + var ErrEmailClientNotAvailable = errors.New("runtime email client is not available") + var ErrExchangeAuthCode = errors.New("failed to exchange authorization code") + var ErrExpiredToken = errors.New("token has expired") + var ErrFailedToExtractSessionID = errors.New("failed to extract session ID from token") + var ErrHandlerDeclarationNotFound = errors.New("handler declaration not found for response analysis") + var ErrHandlerSourceUnavailable = errors.New("handlers package source unavailable for response analysis") + var ErrInsufficientPermissionsAdmin = errors.New("insufficient permissions for admin impersonation") + var ErrInsufficientPermissionsSupport = errors.New("insufficient permissions for support impersonation") + var ErrIntegrationIDRequired = errors.New("integration ID is required") + var ErrIntegrationNotFound = errors.New("integration not found") + var ErrIntegrationUserInputRequired = errors.New(...) + var ErrIntegrationsNotConfigured = errors.New("integrations runtime is not configured") + var ErrIntegrationsNotEnabled = errors.New("integrations are not enabled") + var ErrInvalidCredentials = errors.New("credentials are missing or invalid") + var ErrInvalidImpersonationType = errors.New("invalid impersonation type") + var ErrInvalidInput = errors.New("invalid input") + var ErrInvalidOrganizationContext = errors.New("invalid organization context") + var ErrInvalidProvider = errors.New("oauth2 provider not supported") + var ErrInvalidRecoveryCode = errors.New("invalid code provided") + var ErrInvalidRedirectURI = errors.New("invalid redirect URI") + var ErrInvalidRefererURL = errors.New("invalid referer URL") + var ErrInvalidSessionID = errors.New("invalid session ID") + var ErrInvalidState = errors.New("invalid OAuth state parameter") + var ErrInvalidStateFormat = errors.New("invalid state format") + var ErrInvalidUserContext = errors.New("invalid user context") + var ErrJobImpersonationAdminOnly = errors.New("job impersonation only allowed for system admins") + var ErrJobRunnerAlreadyRegistered = errors.New("this job runner node exists and cannot be registered twice") + var ErrJobRunnerRegistrationTokenExpired = errors.New("job runner registration token expired") + var ErrLoginFailed = errors.New("login failed, please check your credentials and try again") + var ErrMaxAttempts = errors.New("max attempts verifying email address") + var ErrMaxDeviceLimit = errors.New("max device limit reached") + var ErrMissingAssessmentID = errors.New("missing assessment ID") + var ErrMissingCode = errors.New("missing OAuth authorization code") + var ErrMissingEmail = errors.New("missing email") + var ErrMissingField = errors.New("missing required field") + var ErrMissingOIDCConfig = errors.New("missing OIDC configuration, please contact support") + var ErrMissingOrganizationContext = errors.New("missing organization context") + var ErrMissingQuestionnaireContext = errors.New("missing questionnaire context") + var ErrMissingQuestionnaireData = errors.New("missing questionnaire data") + var ErrMissingReferer = errors.New("referer is required") + var ErrMissingRequiredFields = errors.New("invalid request, missing username and/or password") + var ErrMissingSlugInPath = errors.New("slug is required in the path for default trust center domain") + var ErrMissingUserContext = errors.New("missing user context") + var ErrNoActiveImpersonationSession = errors.New("no active impersonation session") + var ErrNoAuthUser = errors.New("could not identify authenticated user in request internal") + var ErrNoBillingEmail = errors.New("no billing email found") + var ErrNoEmailFound = errors.New("no email found from oauth provider") + var ErrNonUniquePassword = errors.New("password was already used, please try again") + var ErrNonceMissing = errors.New("missing nonce cookie, possible CSRF attack or session expired") + var ErrNotFound = errors.New("object not found in the database") + var ErrObjectStoreUnavailable = errors.New("object store unavailable") + var ErrPassWordResetTokenInvalid = errors.New("password reset token invalid") + var ErrPasswordTooWeak = errors.New(...) + var ErrPersonalOrgsNoBilling = errors.New("personal orgs do not have billing") + var ErrProcessingRequest = errors.New("error processing request, please try again") + var ErrProviderDisabled = errors.New("provider is currently disabled") + var ErrProviderHealthCheckFailed = errors.New("provider health check failed") + var ErrProviderRequired = errors.New("provider parameter is required") + var ErrRecipientRequired = errors.New("recipient email is required") + var ErrResendWebhookDisabled = errors.New("resend webhook is not enabled") + var ErrResendWebhookMissingID = errors.New("resend webhook is missing svix-id header") + var ErrSSONoOrganizationAccess = errors.New(...) + var ErrStateMismatch = errors.New("state parameter does not match, possible CSRF attack or session expired") + var ErrSubscriberNotFound = errors.New("subscriber not found") + var ErrSubscriberUnsubscribed = errors.New("this subscription has been cancelled, please re-subscribe to receive updates") + var ErrSubscriptionTokenAlreadyUsed = errors.New("subscription verification token has already been used") + var ErrSupportAccessNotConsented = errors.New("organization has not granted Openlane support access") + var ErrSupportAccessNotEnabled = errors.New("support access is not enabled") + var ErrSupportDomainNotAllowed = errors.New("support second factor email domain not allowed") + var ErrSupportFirstFactorRequired = errors.New("support first factor authentication required") + var ErrSupportIDPNotConfigured = errors.New("support identity provider not configured") + var ErrSupportInvalidCredentials = errors.New("invalid support credentials") + var ErrSupportLoginRequiresOrgAndReason = errors.New("support login requires a target organization and a reason") + var ErrTargetUserNotFound = errors.New("target user not found") + var ErrTemplateNotFound = errors.New("template not found") + var ErrTokenManagerNotConfigured = errors.New("token manager not configured") + var ErrTrustCenterNotFound = errors.New("trust center not found") + var ErrUnableToRegisterJobRunner = errors.New("could not register your job runner at this time") + var ErrUnableToUnsubscribe = errors.New("could not unsubscribe") + var ErrUnableToVerifyEmail = errors.New("could not verify email") + var ErrUnableToVerifyToken = errors.New("unable to verify token, please try again") + var ErrUnauthorized = errors.New("not authorized") + var ErrUnsupportedAuthType = errors.New("provider does not support this authentication flow") + var ErrUnsupportedEventType = errors.New("unsupported event type") + var ErrUnverifiedUser = errors.New("user is not verified") + var ErrValidateToken = errors.New("failed to validate OAuth token") + var ExampleConfigureIntegrationRequest = openapi.ExampleConfigureIntegrationRequest + var ExampleEmailTestSendRequest = EmailTestSendRequest + var ExampleIntegrationAuthStartRequest = openapi.ExampleIntegrationAuthStartRequest + var ExampleRunIntegrationOperationRequest = openapi.ExampleRunIntegrationOperationRequest + var InvalidInputErrCode rout.ErrorCode = "INVALID_INPUT" + var PublicSecurity = &openapi3.SecurityRequirements + var UserExistsErrCode rout.ErrorCode = "USER_EXISTS" + func AuthEndpointDesc(action, resource string) string + func BindAndValidate[T any](ctx echo.Context) (*T, error) + func IsConstraintError(err error) bool + func IsForeignKeyConstraintError(err error) bool + func IsUniqueConstraintError(err error) bool + func NewErrorResponse(statusCode int) *openapi3.Response + func ProcessAuthenticatedRequest[TReq, TResp any](ctx echo.Context, h *Handler, ...) error + func RedirectResponse() *openapi3.Response + func RegisterParameters(op *openapi3.Operation, instance any, pathParams map[string]bool) + func RegisterRequestBody(op *openapi3.Operation, registry SchemaRegistry, instance any) error + func RegisterSuccessResponse(op *openapi3.Operation, registry SchemaRegistry, status int, instance any) error + type CheckFunc func(ctx context.Context) error + type Checks struct + func (c *Checks) ReadyHandler(ctx echo.Context) error + type CloudflareConfig struct + APIToken string + AccountID string + ClientID string + ClientSecret string + Enabled bool + type ConfigureIntegrationRequest = openapi.ConfigureIntegrationRequest + type ConfigureIntegrationResponse = openapi.ConfigureIntegrationResponse + type Download struct + Token string + func (d *Download) GetDownloadExpires() (time.Time, error) + func (d *Download) GetDownloadToken() string + type DownloadToken struct + Expires sql.NullString + Secret []byte + Token sql.NullString + type EmailTestSendRequest struct + Branding string + Name string + To string + type EmailTestSendResponse struct + Results []EmailTestSendResult + type EmailTestSendResult struct + Error string + Name string + Status string + type Handler struct + AdditionalMiddleware []echo.MiddlewareFunc + AuthManager *authmanager.Client + AuthMiddleware []echo.MiddlewareFunc + CloudflareConfig CloudflareConfig + ConsoleURL string + DBClient *ent.Client + DefaultTrustCenterDomain string + Entitlements *entitlements.StripeClient + IntegrationsConfig catalog.Config + IntegrationsRuntime *integrationsruntime.Runtime + IsDev bool + IsTest bool + OTPManager *totp.Client + OauthProvider OauthProviderConfig + ObjectStore *objects.Service + ReadyChecks Checks + RedisClient *redis.Client + SessionConfig *sessions.SessionConfig + ShortlinksClient *shortlinks.Client + Summarizer *summarizer.Client + SupportAccessConfig SupportAccessConfig + TokenManager *tokens.TokenManager + WebAuthn *webauthn.WebAuthn + WorkflowEngine *engine.WorkflowEngine + func (h *Handler) ACMESolverHandler(ctx echo.Context) error + func (h *Handler) AccountAccessHandler(ctx echo.Context) error + func (h *Handler) AccountFeaturesHandler(ctx echo.Context) error + func (h *Handler) AccountRolesHandler(ctx echo.Context) error + func (h *Handler) AccountRolesMeHandler(ctx echo.Context) error + func (h *Handler) AccountRolesOrganizationHandler(ctx echo.Context) error + func (h *Handler) AddReadinessCheck(name string, f CheckFunc) + func (h *Handler) AssignOrganizationRolesHandler(ctx echo.Context) error + func (h *Handler) BadRequest(ctx echo.Context, err error) error + func (h *Handler) BadRequestWithCode(ctx echo.Context, err error, code rout.ErrorCode) error + func (h *Handler) BeginWebauthnLogin(ctx echo.Context) error + func (h *Handler) BeginWebauthnRegistration(ctx echo.Context) error + func (h *Handler) CheckAndCreateUser(ctx context.Context, name, email string, provider enums.AuthProvider, ...) (*ent.User, error) + func (h *Handler) ConfigureIntegrationProvider(ctx echo.Context) error + func (h *Handler) Conflict(ctx echo.Context, err string, code rout.ErrorCode) error + func (h *Handler) CreateTrustCenterAnonymousJWT(ctx echo.Context) error + func (h *Handler) Created(ctx echo.Context, rep any) error + func (h *Handler) DeleteOrganizationRolesHandler(ctx echo.Context) error + func (h *Handler) DisconnectIntegration(ctx echo.Context) error + func (h *Handler) EmailTestSendHandler(ctx echo.Context) error + func (h *Handler) EndImpersonation(ctx echo.Context) error + func (h *Handler) ExampleCSV(ctx echo.Context) error + func (h *Handler) FileDownloadHandler(ctx echo.Context) error + func (h *Handler) FinishWebauthnLogin(ctx echo.Context) error + func (h *Handler) FinishWebauthnRegistration(ctx echo.Context) error + func (h *Handler) Forbidden(ctx echo.Context, err error) error + func (h *Handler) ForgotPassword(ctx echo.Context) error + func (h *Handler) GetGitHubLoginHandlers() (http.Handler, http.Handler) + func (h *Handler) GetGoogleLoginHandlers() (http.Handler, http.Handler) + func (h *Handler) GetQuestionnaire(ctx echo.Context) error + func (h *Handler) HandleEvent(c context.Context, e *stripe.Event) error + func (h *Handler) HandleIntegrationAuthCallback(ctx echo.Context) error + func (h *Handler) HasValidSSOSession(ctx echo.Context, userID string) bool + func (h *Handler) IntegrationStaticWebhookHandler(definitionID, webhookName string) func(echo.Context) error + func (h *Handler) IntegrationWebhookHandler(ctx echo.Context) error + func (h *Handler) InternalServerError(ctx echo.Context, err error) error + func (h *Handler) InvalidInput(ctx echo.Context, err error) error + func (h *Handler) IsAuthenticated(req *http.Request) bool + func (h *Handler) ListIntegrationProviders(ctx echo.Context) error + func (h *Handler) ListOnboardingQuestions(ctx echo.Context) error + func (h *Handler) LoginHandler(ctx echo.Context) error + func (h *Handler) LogoutHandler(ctx echo.Context) error + func (h *Handler) MSFTIdentityWellKnownHandler(ctx echo.Context) error + func (h *Handler) NotFound(ctx echo.Context, err error) error + func (h *Handler) OauthRegister(ctx echo.Context) error + func (h *Handler) OrganizationInviteAccept(ctx echo.Context) error + func (h *Handler) ProductCatalogHandler(ctx echo.Context) error + func (h *Handler) Redirect(ctx echo.Context, location string) error + func (h *Handler) RefreshHandler(ctx echo.Context) error + func (h *Handler) RegisterHandler(ctx echo.Context) error + func (h *Handler) RequireLogin(next http.Handler) http.Handler + func (h *Handler) ResendEmail(ctx echo.Context) error + func (h *Handler) ResendQuestionnaireEmail(ctx echo.Context) error + func (h *Handler) ResetPassword(ctx echo.Context) error + func (h *Handler) RolesHandler(ctx echo.Context) error + func (h *Handler) RunIntegrationOperation(ctx echo.Context) error + func (h *Handler) SCIMHandler(scimHandler http.Handler, routePrefix string) echo.HandlerFunc + func (h *Handler) SSOCallbackHandler(ctx echo.Context) error + func (h *Handler) SSOInitiateHandler(ctx echo.Context) error + func (h *Handler) SSOLoginHandler(ctx echo.Context) error + func (h *Handler) SSOTokenAuthorizeHandler(ctx echo.Context) error + func (h *Handler) SSOTokenCallbackHandler(ctx echo.Context) error + func (h *Handler) ScopesHandler(ctx echo.Context) error + func (h *Handler) SnapshotHandler(ctx echo.Context) error + func (h *Handler) StartImpersonation(ctx echo.Context) error + func (h *Handler) StartIntegrationAuth(ctx echo.Context) error + func (h *Handler) SubmitQuestionnaire(ctx echo.Context) error + func (h *Handler) Success(ctx echo.Context, rep any) error + func (h *Handler) SuccessBlob(ctx echo.Context, rep any) error + func (h *Handler) SupportCallbackHandler(ctx echo.Context) error + func (h *Handler) SwitchHandler(ctx echo.Context) error + func (h *Handler) TooManyRequests(ctx echo.Context, err error) error + func (h *Handler) Unauthorized(ctx echo.Context, err error) error + func (h *Handler) UnsubscribeHandler(ctx echo.Context) error + func (h *Handler) UserInfo(ctx echo.Context) error + func (h *Handler) ValidateTOTP(ctx echo.Context) error + func (h *Handler) VerifyEmail(ctx echo.Context) error + func (h *Handler) VerifySubscriptionHandler(ctx echo.Context) error + func (h *Handler) WebfingerHandler(ctx echo.Context) error + func (h *Handler) WebhookReceiverHandler(ctx echo.Context) error + type HandlerAnalysis struct + Request string + Responses map[int]ResponseShape + func AnalyzeHandler(handlerFn func(echo.Context) error) (*HandlerAnalysis, error) + type IntegrationAuthStartRequest = openapi.IntegrationAuthStartRequest + type IntegrationProvidersResponse struct + Providers []types.Definition + type Invite struct + DestOrgID ulid.ULID + Email string + Role enums.Role + Token string + UserID ulid.ULID + func (i *Invite) GetInviteExpires() (time.Time, error) + func (i *Invite) GetInviteToken() string + type InviteToken struct + Expires sql.NullString + Secret []byte + Token sql.NullString + type OauthProviderConfig struct + Github github.ProviderConfig + Google google.ProviderConfig + RedirectURL string + Webauthn webauthn.ProviderConfig + type ResponseShape struct + ContentType string + Type string + type RunIntegrationOperationBody = openapi.RunIntegrationOperationBody + type RunIntegrationOperationRequest = openapi.RunIntegrationOperationRequest + type RunIntegrationOperationResponse = openapi.RunIntegrationOperationResponse + type SchemaRegistry interface + GetOrRegister func(any) (*openapi3.SchemaRef, error) + type StatusResponse struct + Status map[string]string + type SupportAccessConfig struct + AllowedDomain string + ClientID string + ClientSecret string + DiscoveryEndpoint string + DisplayName string + Email string + Enabled bool + IssuerURL string + Password string + RedirectURL string + SubjectID string + type URLToken struct + Expires sql.NullString + Secret []byte + Token sql.NullString + type User struct + Email string + EmailVerificationExpires sql.NullString + EmailVerificationSecret []byte + EmailVerificationToken sql.NullString + FirstName string + ID string + LastName string + Name string + OTPSecret string + Password *string + PasswordResetExpires sql.NullString + PasswordResetSecret []byte + PasswordResetToken sql.NullString + func (u *User) CreatePasswordResetToken() error + func (u *User) CreateVerificationToken() error + func (u *User) GetPasswordResetExpires() (time.Time, error) + func (u *User) GetPasswordResetToken() string + func (u *User) GetVerificationExpires() (time.Time, error) + func (u *User) GetVerificationToken() string Other modules containing this package github.com/theopenlane/core