models

package
v0.32.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package models provides http request and response structs

Index

Constants

View Source
const (
	// MinImpersonationReasonLength is the minimum length for impersonation reason
	MinImpersonationReasonLength = 10
	// MaxImpersonationReasonLength is the maximum length for impersonation reason
	MaxImpersonationReasonLength = 500
)
View Source
const (
	// DefaultRevision is the default revision to be used for new records
	DefaultRevision = "v0.0.1"
)
View Source
const (
	// MaxRunsInBetween defines how much time each job must have between runs
	// Maybe make this configurable or maybe we need to take this down to like
	// 5/10 minutes
	MaxRunsInBetween = 30 * time.Minute
)

Variables

View Source
var (
	ErrUnsupportedDateTimeType = errors.New("unsupported time format")
	ErrInvalidTimeType         = errors.New("invalid date format, expected YYYY-MM-DD or full ISO8601")
)
View Source
var (
	// ErrInvalidURL defines an invalid url
	ErrInvalidURL = errors.New("invalid url provided")
	// ErrLocalHostNotAllowed defines an error where a user tries to run ssl checks on a localhost address
	ErrLocalHostNotAllowed = errors.New("cannot use localhost url")
	// ErrNoLoopbackAddressAllowed defines an error when a user tries to use loopback address
	ErrNoLoopbackAddressAllowed = errors.New("no loopback address acceptable")
	// ErrUnsupportedJobConfig defines an error for a job type we do not support at the moment
	ErrUnsupportedJobConfig = errors.New("we do not support this job type")
	// ErrHTTPSOnlyURL defines an error where a non https url is being used for a ssl check
	ErrHTTPSOnlyURL = errors.New("you can only check ssl of a domain with https")
)

AllAuditLogOrderField contains all valid AuditLogOrderField values.

View Source
var (
	// ErrComputeNextRunInvalid is used to define an error when a weekly run cannot be
	// computed
	ErrComputeNextRunInvalid = errors.New("could not compute next run time in weekly cadence")
)
View Source
var ErrUnsupportedDataType = errors.New("unsupported aaguid format")
View Source
var ExampleAccountAccessReply = AccountAccessReply{
	Reply:   rout.Reply{Success: true},
	Allowed: true,
}

ExampleAccountAccessReply is an example of a successful `/account/access` response for OpenAPI documentation

View Source
var ExampleAccountAccessRequest = AccountAccessRequest{
	Relation:   "can_view",
	ObjectType: "organization",
	ObjectID:   "01J4EXD5MM60CX4YNYN0DEE3Y1",
}

ExampleAccountAccessRequest is an example of a successful `/account/access` request for OpenAPI documentation

View Source
var ExampleAccountFeaturesReply = AccountFeaturesReply{
	Reply: rout.Reply{Success: true},
	Features: []string{
		"policy-and-procedure-module",
		"centralized-audit-documentation",
		"risk-management",
		"compliance-module",
	},
	OrganizationID: "01J4HMNDSZCCQBTY93BF9CBF5D",
}

ExampleAccountFeaturesReply is an example of a successful `/account/features` response for OpenAPI documentation

View Source
var ExampleAccountFeaturesRequest = AccountFeaturesRequest{
	ID: "01J4HMNDSZCCQBTY93BF9CBF5D",
}

ExampleAccountFeaturesRequest is an example of a successful `/account/features` request for OpenAPI documentation

View Source
var ExampleAccountRolesOrganizationReply = AccountRolesOrganizationReply{
	Reply:          rout.Reply{Success: true},
	Roles:          []string{"can_view", "can_edit", "audit_log_viewer"},
	OrganizationID: "01J4HMNDSZCCQBTY93BF9CBF5D",
}

ExampleAccountRolesOrganizationReply is an example of a successful `/account/roles/organization` response for OpenAPI documentation

View Source
var ExampleAccountRolesOrganizationRequest = AccountRolesOrganizationRequest{
	ID: "01J4HMNDSZCCQBTY93BF9CBF5D",
}

ExampleAccountRolesOrganizationRequest is an example of a successful `/account/roles/organization` request for OpenAPI documentation

View Source
var ExampleAccountRolesReply = AccountRolesReply{
	Reply: rout.Reply{Success: true},
	Roles: []string{"can_view", "can_edit", "audit_log_viewer"},
}

ExampleAccountRolesReply is an example of a successful `/account/roles` response for OpenAPI documentation

View Source
var ExampleAccountRolesRequest = AccountRolesRequest{
	ObjectType: "organization",
	ObjectID:   "01J4EXD5MM60CX4YNYN0DEE3Y1",
}

ExampleAccountRolesRequest is an example of a successful `/account/roles` request for OpenAPI documentation

View Source
var ExampleAcmeSolverRequest = AcmeSolverRequest{
	Path: "01J4HMNDSZCCQBTY93BF9CBF5D",
}

ExampleAcmeSolverRequest is an example ACME solver request for OpenAPI documentation

View Source
var ExampleAvailableAuthTypeRequest = LoginRequest{
	Username: "sfunky@theopenlane.io",
}

ExampleAvailableAuthTypeRequest is an example of a successful available auth type check for OpenAPI documentation

View Source
var ExampleAvailableAuthTypeSuccessResponse = AvailableAuthTypeReply{
	Reply: rout.Reply{
		Success: true,
	},
	Methods: []enums.AuthProvider{
		enums.AuthProviderCredentials,
		enums.AuthProviderWebauthn,
	},
}

ExampleAvailableAuthTypeSuccessResponse is an example of a successful available auth methods check response for OpenAPI documentation

View Source
var ExampleCreateTrustCenterAnonymousJWTResponse = CreateTrustCenterAnonymousJWTResponse{
	AuthData: AuthData{
		AccessToken:  "access_token_here",
		RefreshToken: "refresh_token_here",
	},
}

ExampleCreateTrustCenterAnonymousJWTResponse is an example trust center anonymous JWT response for OpenAPI documentation

View Source
var ExampleEndImpersonationReply = EndImpersonationReply{
	Reply:   rout.Reply{Success: true},
	Message: "Impersonation session ended successfully",
}

ExampleEndImpersonationReply is an example response for OpenAPI documentation

View Source
var ExampleEndImpersonationRequest = EndImpersonationRequest{
	SessionID: ulids.New().String(),
	Reason:    "Support task completed",
}

ExampleEndImpersonationRequest is an example request for OpenAPI documentation

View Source
var ExampleExampleCSVRequest = ExampleCSVRequest{
	Filename: "actionplan",
}

ExampleLoginSuccessRequest is an example of a successful tfa validation request for OpenAPI documentation

View Source
var ExampleForgotPasswordSuccessRequest = ForgotPasswordRequest{
	Email: "example@theopenlane.io",
}

ExampleForgotPasswordSuccessRequest is an example of a successful forgot password request for OpenAPI documentation

View Source
var ExampleForgotPasswordSuccessResponse = ForgotPasswordReply{
	Reply: rout.Reply{
		Success: true,
	},
	Message: "We've received your request to have the password associated with this email reset. Please check your email.",
}

ExampleForgotPasswordSuccessResponse is an example of a successful forgot password response for OpenAPI documentation

View Source
var ExampleInviteRequest = InviteRequest{
	Token: "token",
}

ExampleInviteRequest is an example of a successful invite request for OpenAPI documentation

View Source
var ExampleInviteResponse = InviteReply{
	Reply:       rout.Reply{Success: true},
	ID:          "1234",
	Email:       "",
	JoinedOrgID: "1234",
	Role:        "admin",
	Message:     "Welcome to your new organization!",
	AuthData: AuthData{
		AccessToken:  "access_token",
		RefreshToken: "refresh_token",
		Session:      "session",
		TokenType:    "bearer",
	},
}

ExampleInviteResponse is an example of a successful invite response for OpenAPI documentation

View Source
var ExampleJobRunnerRegistrationRequest = JobRunnerRegistrationRequest{
	IPAddress: "192.168.0.1",
	Name:      "ubuntu-eu-west-2",
	Token:     "registration_tokenhere",
	Tags:      []string{"self-hosted", "eu-west-2", "gcp", "kubernetes"},
}

ExampleJobRunnerRegistrationRequest is an example of a successful job runner registration request

View Source
var ExampleJobRunnerRegistrationResponse = JobRunnerRegistrationReply{
	Reply:   rout.Reply{Success: true},
	Message: "Job runner node registered",
}

ExampleJobRunnerRegistrationResponse is an example of a successful job runner registration response

View Source
var ExampleLoginSuccessRequest = LoginRequest{
	Username: "sfunky@theopenlane.io",
	Password: "mitb!",
}

ExampleLoginSuccessRequest is an example of a successful login request for OpenAPI documentation

View Source
var ExampleLoginSuccessResponse = LoginReply{
	Reply: rout.Reply{
		Success: true,
	},
	TFAEnabled: true,
	AuthData: AuthData{
		AccessToken:  "access_token",
		RefreshToken: "refresh_token",
		Session:      "session",
		TokenType:    "bearer",
	},
}

ExampleLoginSuccessResponse is an example of a successful login response for OpenAPI documentation

View Source
var ExampleOAuthCallbackRequest = OAuthCallbackRequest{
	Provider: "github",
	Code:     "4/0AQlEz8xY...",
	State:    "eyJvcmdJRCI6IjAxSE...",
}

ExampleOAuthCallbackRequest is an example OAuth callback request for OpenAPI documentation

View Source
var ExampleOAuthCallbackResponse = OAuthCallbackResponse{
	Reply:   rout.Reply{Success: true},
	Success: true,
	Message: "Successfully connected GitHub integration",
}

ExampleOAuthCallbackResponse is an example OAuth callback response for OpenAPI documentation

View Source
var ExampleOAuthFlowRequest = OAuthFlowRequest{
	Provider:    "github",
	RedirectURI: "https://app.example.com/integrations",
	Scopes:      []string{"repo", "gist"},
}

ExampleOAuthFlowRequest is an example OAuth flow request for OpenAPI documentation

View Source
var ExampleOAuthFlowResponse = OAuthFlowResponse{
	Reply:         rout.Reply{Success: true},
	AuthURL:       "https://github.com/login/oauth/authorize?client_id=...&state=eyJvcmdJRCI6IjAxSE...",
	State:         "eyJvcmdJRCI6IjAxSE...",
	Message:       "",
	RequiresLogin: false,
}

ExampleOAuthFlowResponse is an example OAuth flow response for OpenAPI documentation

View Source
var ExampleOauthTokenRequest = OauthTokenRequest{
	Name:             "Jon Snow",
	Email:            "jsnow@example.com",
	AuthProvider:     "google",
	ExternalUserID:   "1234567890",
	ExternalUserName: "jsnow",
	ClientToken:      "example-client-token-12345",
	Image:            "https://example.com/avatar.jpg",
}

ExampleOauthTokenRequest is an example OAuth token request for OpenAPI documentation

View Source
var ExampleRefreshIntegrationTokenRequest = RefreshIntegrationTokenRequest{
	Provider: "github",
}

ExampleRefreshIntegrationTokenRequest is an example refresh integration token request for OpenAPI documentation

View Source
var ExampleRefreshRequest = RefreshRequest{
	RefreshToken: "token",
}

ExampleRefreshRequest is an example of a successful refresh request for OpenAPI documentation

View Source
var ExampleRefreshSuccessResponse = RefreshReply{
	Reply:   rout.Reply{Success: true},
	Message: "success",
	AuthData: AuthData{
		AccessToken:  "access_token",
		RefreshToken: "refresh_token",
		Session:      "session",
		TokenType:    "bearer",
	},
}

ExampleRefreshSuccessResponse is an example of a successful refresh response for OpenAPI documentation

View Source
var ExampleRegisterSuccessRequest = RegisterRequest{
	FirstName: "Sarah",
	LastName:  "Funk",
	Email:     "sfunky@theopenlane.io",
	Password:  "mitb!",
}

ExampleRegisterSuccessRequest is an example of a successful register request for OpenAPI documentation

View Source
var ExampleRegisterSuccessResponse = RegisterReply{
	Reply:   rout.Reply{Success: true},
	ID:      "1234",
	Email:   "",
	Message: "Welcome to Openlane!",
}

ExampleRegisterSuccessResponse is an example of a successful register response for OpenAPI documentation

View Source
var ExampleResendEmailSuccessRequest = ResendRequest{
	Email: "cercei.lannister@theopenlane.io",
}

ExampleResendEmailSuccessRequest is an example of a successful resend email request for OpenAPI documentation

View Source
var ExampleResendEmailSuccessResponse = ResendReply{
	Reply: rout.Reply{
		Success: true,
	},
	Message: "Email has been resent",
}

ExampleResendEmailSuccessResponse is an example of a successful resend email response for OpenAPI documentation

View Source
var ExampleResetPasswordSuccessRequest = ResetPasswordRequest{
	Password: "mitb!",
	Token:    "token",
}

ExampleResetPasswordSuccessRequest is an example of a successful reset password request for OpenAPI documentation

View Source
var ExampleResetPasswordSuccessResponse = ResetPasswordReply{
	Reply: rout.Reply{
		Success: true,
	},
	Message: "Password has been reset",
}

ExampleResetPasswordSuccessResponse is an example of a successful reset password response for OpenAPI documentation

View Source
var ExampleSSOCallbackRequest = SSOCallbackRequest{
	Code:           "code",
	State:          "state",
	OrganizationID: ulids.New().String(),
}

ExampleSSOCallbackRequest is an example request for OpenAPI documentation

View Source
var ExampleSSOLoginRequest = SSOLoginRequest{
	OrganizationID: ulids.New().String(),
	ReturnURL:      "https://app.sitb.com",
}

ExampleSSOLoginRequest is an example request for OpenAPI documentation

View Source
var ExampleSSOStatusReply = SSOStatusReply{
	Reply:          rout.Reply{Success: true},
	Enforced:       true,
	Provider:       enums.SSOProviderOkta,
	DiscoveryURL:   "https://id.example.com/.well-known/openid-configuration",
	OrganizationID: ulids.New().String(),
}

ExampleSSOStatusReply is an example response for OpenAPI documentation

View Source
var ExampleSSOStatusRequest = SSOStatusRequest{
	Resource: "acct:mitb@theopenlane.io",
}

ExampleSSOStatusRequest is an example request for OpenAPI documentation

View Source
var ExampleSSOTokenAuthorizeReply = SSOTokenAuthorizeReply{
	Reply:          rout.Reply{Success: true},
	OrganizationID: ulids.New().String(),
	TokenID:        ulids.New().String(),
	Message:        "success",
}

ExampleSSOTokenAuthorizeReply is an example response for OpenAPI documentation

View Source
var ExampleSSOTokenAuthorizeRequest = SSOTokenAuthorizeRequest{
	OrganizationID: ulids.New().String(),
	TokenID:        ulids.New().String(),
	TokenType:      "api",
}

ExampleSSOTokenAuthorizeRequest is an example request for OpenAPI documentation

View Source
var ExampleSSOTokenCallbackRequest = SSOTokenCallbackRequest{
	Code:  "code",
	State: "state",
}

ExampleSSOTokenCallbackRequest is an example request for OpenAPI documentation

View Source
var ExampleStartImpersonationReply = StartImpersonationReply{
	Reply:     rout.Reply{Success: true},
	Token:     "imp_" + ulids.New().String(),
	ExpiresAt: time.Now().Add(time.Hour),
	SessionID: ulids.New().String(),
	Message:   "Impersonation session started successfully",
}

ExampleStartImpersonationReply is an example response for OpenAPI documentation

View Source
var ExampleStartImpersonationRequest = StartImpersonationRequest{
	TargetUserID: ulids.New().String(),
	Type:         "support",
	Reason:       "Customer support assistance for account recovery",
	Duration:     nil,
}

ExampleStartImpersonationRequest is an example request for OpenAPI documentation

View Source
var ExampleSwitchSuccessReply = SwitchOrganizationReply{
	Reply: rout.Reply{
		Success: true,
	},
	AuthData: AuthData{
		AccessToken:  "access_token",
		RefreshToken: "refresh_token",
		Session:      "session",
		TokenType:    "bearer",
	},
}

ExampleSwitchSuccessReply is an example of a successful switch organization response for OpenAPI documentation

View Source
var ExampleSwitchSuccessRequest = SwitchOrganizationRequest{
	TargetOrganizationID: ulids.New().String(),
}

ExampleSwitchSuccessRequest is an example of a successful switch organization request for OpenAPI documentation

View Source
var ExampleTFASSuccessResponse = TFAReply{
	Reply: rout.Reply{
		Success: true,
	},
}

ExampleLoginSuccessResponse is an example of a successful tfa validation response for OpenAPI documentation

View Source
var ExampleTFASuccessRequest = TFARequest{
	TOTPCode: "113371",
}

ExampleLoginSuccessRequest is an example of a successful tfa validation request for OpenAPI documentation

View Source
var ExampleUploadFileRequest = UploadFilesRequest{
	UploadFile: multipart.FileHeader{
		Filename: "file.txt",
		Size:     1024,
		Header: textproto.MIMEHeader{
			"Content-Type": []string{"text/plain"},
		},
	},
}

ExampleUploadFileRequest is an example of a successful upload request for OpenAPI documentation

View Source
var ExampleUploadFilesSuccessResponse = UploadFilesReply{
	Reply: rout.Reply{
		Success: true,
	},
	Message:   "file(s) uploaded successfully",
	FileCount: 1,
	Files: []File{
		{
			ID:           "1234",
			Name:         "file.txt",
			Size:         1024,
			MimeType:     "text/plain",
			ContentType:  "text/plain",
			PresignedURL: "https://example.com/file.txt",
			MD5:          []byte("1234"),
			CreatedAt:    time.Now(),
			UpdatedAt:    time.Now(),
		},
	},
}

ExampleUploadFilesSuccessResponse is an example of a successful upload response for OpenAPI documentation

View Source
var ExampleUserInfoSuccessResponse = UserInfoReply{
	Reply:           rout.Reply{Success: true},
	ID:              "01J4EXD5MM60CX4YNYN0DEE3Y1",
	Email:           "jsnow@example.com",
	FirstName:       "Jon",
	LastName:        "Snow",
	DisplayName:     "Jon Snow",
	AvatarRemoteURL: stringPtr("https://example.com/avatar.jpg"),
	LastSeen:        stringPtr("2023-01-01T00:00:00Z"),
	Role:            "ADMIN",
	Sub:             "user123",
}

ExampleUserInfoSuccessResponse is an example of a successful userinfo response for OpenAPI documentation

View Source
var ExampleVerifySubscriptionResponse = VerifySubscribeReply{
	Reply:   rout.Reply{Success: true},
	Message: "Subscription confirmed, looking forward to sending you updates!",
}

ExampleVerifySubscriptionResponse is an example of a successful verify subscription response for OpenAPI documentation

View Source
var ExampleVerifySubscriptionSuccessRequest = VerifySubscribeRequest{
	Token: "token",
}

ExampleVerifySubscriptionSuccessRequest is an example of a successful verify subscription request for OpenAPI documentation

View Source
var ExampleVerifySuccessRequest = VerifyRequest{
	Token: "token",
}

ExampleVerifySuccessRequest is an example of a successful verify request for OpenAPI documentation

View Source
var ExampleVerifySuccessResponse = VerifyReply{
	Reply: rout.Reply{
		Success: true,
	},
	ID:      ulids.New().String(),
	Email:   "gregor.clegane@theopenlane.io",
	Message: "Email has been verified",
	AuthData: AuthData{
		AccessToken:  "access_token",
		RefreshToken: "refresh_token",
		Session:      "session",
		TokenType:    "bearer",
	},
}

ExampleVerifySuccessResponse is an example of a successful verify response for OpenAPI documentation

View Source
var ExampleWebauthnBeginLoginResponse = WebauthnBeginLoginResponse{
	Reply:   rout.Reply{Success: true},
	Session: "session123",
}

ExampleWebauthnBeginLoginResponse is an example WebAuthn begin login response for OpenAPI documentation

View Source
var ExampleWebauthnBeginRegistrationRequest = WebauthnRegistrationRequest{
	Email: "sarahisthebest@sarahsthebest.com",
	Name:  "Sarah Funk",
}
View Source
var ExampleWebauthnBeginRegistrationResponse = WebauthnBeginRegistrationResponse{
	Reply: rout.Reply{Success: true},
	CredentialCreation: &protocol.CredentialCreation{
		Response: protocol.PublicKeyCredentialCreationOptions{
			RelyingParty: protocol.RelyingPartyEntity{
				CredentialEntity: protocol.CredentialEntity{
					Name: "Openlane",
				},
				ID: "theopenlane.io",
			},
			User: protocol.UserEntity{
				CredentialEntity: protocol.CredentialEntity{
					Name: "Sarah Funk",
				},
				DisplayName: "sarahfunk",
				ID:          []byte("user-id-12345"),
			},
			Challenge: protocol.URLEncodedBase64("cmFuZG9tLWNoYWxsZW5nZS1zdHJpbmc="),
			Timeout:   60000,
		}},
	Session: "example-session-id",
}
View Source
var ExampleWebauthnLoginFinishRequest = WebauthnLoginFinishRequest{
	ID:                      "JBqvfKoo_U-McTi9NxkpDTncmL2Lg6fczz6PD7WesCHQPg",
	RawID:                   "JBqvfKoo_U-McTi9NxkpDTncmL2Lg6fczz6PD7WesCHQPg",
	Type:                    "public-key",
	AuthenticatorAttachment: "platform",
	ClientExtensionResults:  map[string]interface{}{},
	Response: struct {
		AuthenticatorData string `json:"authenticatorData" description:"The authenticator data"`
		ClientDataJSON    string `json:"clientDataJSON" description:"The client data JSON"`
		Signature         string `json:"signature" description:"The assertion signature"`
		UserHandle        string `json:"userHandle,omitempty" description:"The user handle"`
	}{
		AuthenticatorData: "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NdAAAAALraVWanqkAfvZZFYZpVEg0AIiQar3yqKP1PjHE4vTcZKQ053Ji9i4On3M8-jw-1nrAh0D6lAQIDJiABIVggldWfMY_HYjHCZuSgBcDj-Zqcnipy1SJVNlhvmZBxvpciWCDh1UJNz9Uyr6jqeQhApJ3krQCvDNoeXaH0ffa9KapYdw",
		ClientDataJSON:    "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiTWZlN1l6aS0zUU9rMDM4VHh3dVVvaTBaaURIZEdaOGlGNVhXc09UTTVnbyIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMSIsImNyb3NzT3JpZ2luIjpmYWxzZX0",
		Signature:         "MEUCIQDKIueQAhZmGtPTmzp7QQRjZU_XLUqHdGj3QKRMOxRNbwIgF1hkJJ5y7cA3RGZe9x4n9vXq_L9x8eR1r9cE4w1uJ_A",
		UserHandle:        "dXNlci1pZC0xMjM0NQ",
	},
}

ExampleWebauthnLoginFinishRequest is an example WebAuthn login finish request for OpenAPI documentation

View Source
var ExampleWebauthnLoginRequest = WebauthnLoginRequest{
	Email: "",
}

ExampleWebauthnLoginRequest is an example WebAuthn login request for OpenAPI documentation

View Source
var ExampleWebauthnLoginResponse = WebauthnLoginResponse{
	Reply:   rout.Reply{Success: true},
	Message: "Authentication successful",
	AuthData: AuthData{
		AccessToken:  "access_token_here",
		RefreshToken: "refresh_token_here",
	},
}

ExampleWebauthnLoginResponse is an example WebAuthn login response for OpenAPI documentation

View Source
var ExampleWebauthnRegistrationFinishRequest = WebauthnRegistrationFinishRequest{
	ID:                      "JBqvfKoo_U-McTi9NxkpDTncmL2Lg6fczz6PD7WesCHQPg",
	RawID:                   "JBqvfKoo_U-McTi9NxkpDTncmL2Lg6fczz6PD7WesCHQPg",
	Type:                    "public-key",
	AuthenticatorAttachment: "platform",
	ClientExtensionResults:  map[string]interface{}{},
	Response: struct {
		AttestationObject  string   `json:"attestationObject" description:"The attestation object"`
		ClientDataJSON     string   `json:"clientDataJSON" description:"The client data JSON"`
		PublicKey          string   `json:"publicKey,omitempty" description:"The public key"`
		PublicKeyAlgorithm int      `json:"publicKeyAlgorithm,omitempty" description:"The public key algorithm"`
		Transports         []string `json:"transports,omitempty" description:"Available transports"`
		AuthenticatorData  string   `json:"authenticatorData,omitempty" description:"The authenticator data"`
	}{
		AttestationObject:  "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVimSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NdAAAAALraVWanqkAfvZZFYZpVEg0AIiQar3yqKP1PjHE4vTcZKQ053Ji9i4On3M8-jw-1nrAh0D6lAQIDJiABIVggldWfMY_HYjHCZuSgBcDj-Zqcnipy1SJVNlhvmZBxvpciWCDh1UJNz9Uyr6jqeQhApJ3krQCvDNoeXaH0ffa9KapYdw",
		ClientDataJSON:     "eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiTWZlN1l6aS0zUU9rMDM4VHh3dVVvaTBaaURIZEdaOGlGNVhXc09UTTVnbyIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMSIsImNyb3NzT3JpZ2luIjpmYWxzZX0",
		PublicKey:          "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEldWfMY_HYjHCZuSgBcDj-Zqcnipy1SJVNlhvmZBxvpfh1UJNz9Uyr6jqeQhApJ3krQCvDNoeXaH0ffa9KapYdw",
		PublicKeyAlgorithm: -7,
		Transports:         []string{"internal", "hybrid"},
		AuthenticatorData:  "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NdAAAAALraVWanqkAfvZZFYZpVEg0AIiQar3yqKP1PjHE4vTcZKQ053Ji9i4On3M8-jw-1nrAh0D6lAQIDJiABIVggldWfMY_HYjHCZuSgBcDj-Zqcnipy1SJVNlhvmZBxvpciWCDh1UJNz9Uyr6jqeQhApJ3krQCvDNoeXaH0ffa9KapYdw",
	},
}

ExampleWebauthnRegistrationFinishRequest is an example WebAuthn registration finish request for OpenAPI documentation

View Source
var ExampleWebauthnRegistrationResponse = WebauthnRegistrationResponse{
	Reply:   rout.Reply{Success: true},
	Message: "Registration successful",
	AuthData: AuthData{
		AccessToken:  "access_token_here",
		RefreshToken: "refresh_token_here",
	},
}

ExampleWebauthnRegistrationResponse is an example WebAuthn registration response for OpenAPI documentation

View Source
var ExampleWebfingerRequest = WebfingerRequest{
	Resource: "acct:sarah@funkyhous.info",
}

ExampleWebfingerRequest is an example request for OpenAPI documentation

Functions

func BumpMajor added in v0.7.5

func BumpMajor(v string) (string, error)

BumpMajor increments the major version by 1 It resets the minor and patch versions to 0 For example if the version is v1.7.1 the new version will be v2.0.0 It resets the pre-release version to empty

func BumpMinor added in v0.7.5

func BumpMinor(v string) (string, error)

BumpMinor increments the minor version by 1 It resets the patch version to 0 For example if the version is v1.7.1 the new version will be v1.8.0 It resets the pre-release version to empty

func BumpPatch added in v0.7.5

func BumpPatch(v string) (string, error)

BumpPatch increments the patch version by 1 For example if the version is v1.7.1 the new version will be v1.7.2 If the version has a pre-release version, it clears the pre-release version

func SetPreRelease added in v0.7.5

func SetPreRelease(v string) (string, error)

SetPreRelease sets the pre-release version to "draft" For example if the version is v1.7.1 the new version will be v1.7.2-draft

func ValidateIP added in v0.14.1

func ValidateIP(s string) error

ValidateIP takes in an ip address and checks if it is usable for a job runner node

func ValidateURL added in v0.15.0

func ValidateURL(s string) (string, error)

ValidateURL takes in url and makes sure it is a valid url - it must be https - it must not be localhost - it must not be a loopback address to our machine

func WithSSOAuthorizations added in v0.22.0

func WithSSOAuthorizations(ctx context.Context, auth *SSOAuthorizationMap) context.Context

WithSSOAuthorizations stores the SSOAuthorizations in the context

func WithVersionBumpContext added in v0.7.5

func WithVersionBumpContext(ctx context.Context, v *VersionBump) context.Context

WithVersionBumpContext adds the VersionBump to the context

func WithVersionBumpRequestContext added in v0.7.5

func WithVersionBumpRequestContext(ctx context.Context, v *VersionBump)

WithVersionBumpContext adds the VersionBump to the context

Types

type AAGUID added in v0.10.9

type AAGUID []byte

AAGUID is a custom type representing an authenticator attestation uuid.

func ToAAGUID added in v0.10.9

func ToAAGUID(b []byte) *AAGUID

func (AAGUID) MarshalGQL added in v0.10.9

func (a AAGUID) MarshalGQL(w io.Writer)

func (*AAGUID) Scan added in v0.10.9

func (a *AAGUID) Scan(value interface{}) error

func (AAGUID) String added in v0.10.9

func (a AAGUID) String() string

func (*AAGUID) UnmarshalGQL added in v0.10.9

func (a *AAGUID) UnmarshalGQL(v any) error

func (AAGUID) Value added in v0.10.9

func (a AAGUID) Value() (driver.Value, error)

type AccountAccessReply

type AccountAccessReply struct {
	rout.Reply
	Allowed bool `json:"allowed"`
}

AccountAccessReply holds the fields that are sent on a response to the `/account/access` endpoint

func (*AccountAccessReply) ExampleResponse added in v0.26.9

func (r *AccountAccessReply) ExampleResponse() any

ExampleResponse returns an example AccountAccessReply for OpenAPI documentation

type AccountAccessRequest

type AccountAccessRequest struct {
	ObjectID    string `json:"object_id" description:"The ID of the object to check access for" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	ObjectType  string `` /* 138-byte string literal not displayed */
	Relation    string `json:"relation" description:"The relation to check access for, e.g. can_view, can_edit" example:"can_view"`
	SubjectType string `json:"subject_type,omitempty" description:"The type of subject to check access for, e.g. service, user" example:"user"`
}

AccountAccessRequest contains organization ID for checking access permissions

func (*AccountAccessRequest) Validate

func (r *AccountAccessRequest) Validate() error

Validate ensures the required fields are set on the AccountAccessRequest

type AccountFeaturesReply added in v0.12.0

type AccountFeaturesReply struct {
	rout.Reply
	Features       []string `` /* 138-byte string literal not displayed */
	OrganizationID string   `json:"organization_id" description:"The ID of the organization the user has features in" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}

AccountFeaturesReply holds the fields that are sent on a response to the `/account/features` endpoint

func (*AccountFeaturesReply) ExampleResponse added in v0.26.9

func (r *AccountFeaturesReply) ExampleResponse() any

ExampleResponse returns an example AccountFeaturesReply for OpenAPI documentation

type AccountFeaturesRequest added in v0.12.0

type AccountFeaturesRequest struct {
	ID string `param:"id" description:"The ID of the organization to check roles for" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}

AccountFeaturesRequest contains organization ID for retrieving available features

func (*AccountFeaturesRequest) Validate added in v0.12.0

func (r *AccountFeaturesRequest) Validate() error

Validate ensures the required fields are set on the AccountFeaturesRequest

type AccountRolesOrganizationReply

type AccountRolesOrganizationReply struct {
	rout.Reply
	Roles          []string `json:"roles" description:"The roles the user has in the organization, e.g. can_view, can_edit"`
	OrganizationID string   `json:"organization_id" description:"The ID of the organization the user has roles in" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}

AccountRolesOrganizationReply holds the fields that are sent on a response to the `/account/roles/organization` endpoint

func (*AccountRolesOrganizationReply) ExampleResponse added in v0.26.9

func (r *AccountRolesOrganizationReply) ExampleResponse() any

ExampleResponse returns an example AccountRolesOrganizationReply for OpenAPI documentation

type AccountRolesOrganizationRequest

type AccountRolesOrganizationRequest struct {
	ID string `param:"id" description:"The ID of the organization to check roles for" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}

AccountRolesOrganizationRequest contains organization ID for retrieving organization-specific roles

func (*AccountRolesOrganizationRequest) Validate

func (r *AccountRolesOrganizationRequest) Validate() error

Validate ensures the required fields are set on the AccountRolesOrganizationRequest

type AccountRolesReply

type AccountRolesReply struct {
	rout.Reply
	Roles []string `json:"roles"`
}

AccountRolesReply holds the fields that are sent on a response to the `/account/roles` endpoint

func (*AccountRolesReply) ExampleResponse added in v0.26.9

func (r *AccountRolesReply) ExampleResponse() any

ExampleResponse returns an example AccountRolesReply for OpenAPI documentation

type AccountRolesRequest

type AccountRolesRequest struct {
	ObjectID    string   `json:"object_id" description:"The ID of the object to check roles for" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	ObjectType  string   `` /* 137-byte string literal not displayed */
	SubjectType string   `json:"subject_type,omitempty" description:"The type of subject to check roles for, e.g. service, user" example:"user"`
	Relations   []string `json:"relations,omitempty" description:"The relations to check roles for, e.g. can_view, can_edit"`
}

AccountRolesRequest contains organization ID for retrieving user roles

func (*AccountRolesRequest) Validate

func (r *AccountRolesRequest) Validate() error

Validate ensures the required fields are set on the AccountAccessRequest

type AcmeSolverRequest added in v0.15.2

type AcmeSolverRequest struct {
	Path string `param:"path" description:"The path to the acme challenge" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}

AcmeSolverRequest is the request to solve an acme challenge

type Address added in v0.6.6

type Address struct {
	// Line1 is the first line of the address
	Line1 string `json:"line1"`
	// Line2 is the second line of the address
	Line2 string `json:"line2"`
	// City is the city of the address
	City string `json:"city"`
	// State is the state of the address
	State string `json:"state"`
	// PostalCode is the postal code of the address
	PostalCode string `json:"postalCode"`
	// Country is the country of the address
	Country string `json:"country"`
}

Address is a custom type for Address

func (Address) MarshalGQL added in v0.6.6

func (a Address) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Address) String added in v0.6.6

func (a Address) String() string

String returns a string representation of the address

func (*Address) UnmarshalGQL added in v0.6.6

func (a *Address) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type AssessmentMethod added in v0.7.3

type AssessmentMethod struct {
	// ID is the unique identifier for the assessment method
	ID string `json:"id,omitempty"`
	// Type is the type of assessment being performed, e.g. Interview, Test, etc.
	Type string `json:"type,omitempty"`
	// Method is the associated language describing the assessment method
	Method string `json:"method,omitempty"`
}

AssessmentMethod are methods that can be used during the audit to assess the control implementation

func (AssessmentMethod) MarshalGQL added in v0.7.3

func (a AssessmentMethod) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*AssessmentMethod) UnmarshalGQL added in v0.7.3

func (a *AssessmentMethod) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type AssessmentObjective added in v0.7.3

type AssessmentObjective struct {
	// Class is the class of the assessment objective which is typically what framework it origins from
	Class string `json:"class,omitempty"`
	// ID is the unique identifier for the assessment objective
	ID string `json:"id,omitempty"`
	// Objective is the associated language describing the assessment objective
	Objective string `json:"objective,omitempty" `
}

AssessmentObjective are objectives that are validated during the audit to ensure the control is implemented

func (AssessmentObjective) MarshalGQL added in v0.7.3

func (a AssessmentObjective) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*AssessmentObjective) UnmarshalGQL added in v0.7.3

func (a *AssessmentObjective) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type AuditLogOrderField added in v0.17.0

type AuditLogOrderField string

Properties by which AuditLog connections can be ordered.

const (
	AuditLogOrderFieldHistoryTime AuditLogOrderField = "history_time"
)

func (AuditLogOrderField) IsValid added in v0.17.0

func (e AuditLogOrderField) IsValid() bool

IsValid checks if the AuditLogOrderField is valid.

func (AuditLogOrderField) MarshalGQL added in v0.17.0

func (e AuditLogOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (AuditLogOrderField) MarshalJSON added in v0.17.0

func (e AuditLogOrderField) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for AuditLogOrderField.

func (AuditLogOrderField) String added in v0.17.0

func (e AuditLogOrderField) String() string

String returns the string representation of the AuditLogOrderField.

func (*AuditLogOrderField) UnmarshalGQL added in v0.17.0

func (e *AuditLogOrderField) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

func (*AuditLogOrderField) UnmarshalJSON added in v0.17.0

func (e *AuditLogOrderField) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AuditLogOrderField.

type AuthData

type AuthData struct {
	AccessToken  string `json:"access_token" description:"The access token to be used for authentication"`
	RefreshToken string `json:"refresh_token,omitempty" description:"The refresh token to be used to refresh the access token after it expires"`
	Session      string `json:"session,omitempty" description:"The short-lived session token required for authentication"`
	TokenType    string `json:"token_type,omitempty" description:"The type of token being returned" example:"bearer"`
}

type AvailableAuthTypeLoginRequest added in v0.10.1

type AvailableAuthTypeLoginRequest struct {
	Username string `json:"username" description:"The email address associated with the existing account" example:"jsnow@example.com"`
}

AvailableAuthTypeLoginRequest holds the payload for checking the auth types available to a user passkeys? or both passkeys and credentials or just credentials

func (*AvailableAuthTypeLoginRequest) Validate added in v0.10.1

func (r *AvailableAuthTypeLoginRequest) Validate() error

Validate ensures the required fields are set on the AvailableAuthTypeLoginRequest request

type AvailableAuthTypeReply added in v0.10.1

type AvailableAuthTypeReply struct {
	rout.Reply
	Methods []enums.AuthProvider `json:"methods,omitempty"`
}

AvailableAuthTypeReply holds the response to AvailableAuthTypeLoginRequest

func (*AvailableAuthTypeReply) ExampleResponse added in v0.26.9

func (r *AvailableAuthTypeReply) ExampleResponse() any

ExampleResponse returns an example AvailableAuthTypeReply for OpenAPI documentation

type Change added in v0.17.0

type Change struct {
	// FieldName is the name of the field that changed.
	FieldName string
	// Old is the old value of the field.
	Old any
	// New is the new value of the field.
	New any
}

Change represents a change in an entity's field.

func (Change) MarshalGQL added in v0.17.0

func (c Change) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (*Change) UnmarshalGQL added in v0.17.0

func (c *Change) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type CreateTrustCenterAnonymousJWTResponse added in v0.20.5

type CreateTrustCenterAnonymousJWTResponse struct {
	AuthData
}

CreateTrustCenterAnonymousJWTResponse is the response to a request to create a trust center anonymous JWT

func (*CreateTrustCenterAnonymousJWTResponse) ExampleResponse added in v0.26.9

func (r *CreateTrustCenterAnonymousJWTResponse) ExampleResponse() any

ExampleResponse returns an example CreateTrustCenterAnonymousJWTResponse for OpenAPI documentation

type Cron added in v0.15.0

type Cron string

Cron defines the syntax for the job execution

func (Cron) MarshalGQL added in v0.15.0

func (c Cron) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Cron) Next added in v0.15.0

func (c Cron) Next(from time.Time) (time.Time, error)

Next returns the next scheduled time after `from` based on the cron expression.

func (*Cron) Scan added in v0.15.0

func (c *Cron) Scan(value interface{}) error

func (Cron) String added in v0.15.0

func (c Cron) String() string

String returns a string representation of the cron

func (*Cron) UnmarshalGQL added in v0.15.0

func (c *Cron) UnmarshalGQL(v any) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (Cron) Validate added in v0.15.0

func (c Cron) Validate() error

Validate checks a cron to make sure it is valid . It also limits concurrent runs to 30 minutes interval of the last run so it parses the cron - look at next few executions and check the elapsed time

func (Cron) Value added in v0.15.0

func (c Cron) Value() (driver.Value, error)

Value returns human readable cron from the database

type DateTime added in v0.10.2

type DateTime time.Time

DateTime is a custom GraphQL scalar that converts to/from time.Time

func ToDateTime added in v0.10.2

func ToDateTime(s string) (*DateTime, error)

ToDateTime converts a string to a DateTime pointer. It accepts both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ" formats. Returns an error if the string is empty or in an invalid format.

func (DateTime) IsZero added in v0.15.1

func (d DateTime) IsZero() bool

IsZero checks if the DateTime is zero (equivalent to time.Time.IsZero)

func (DateTime) MarshalGQL added in v0.10.2

func (d DateTime) MarshalGQL(w io.Writer)

MarshalGQL writes the datetime as "YYYY-MM-DD"

func (DateTime) MarshalJSON added in v0.15.1

func (d DateTime) MarshalJSON() ([]byte, error)

MarshalJSON formats the DateTime as a JSON string

func (DateTime) MarshalText added in v0.15.1

func (d DateTime) MarshalText() ([]byte, error)

MarshalText formats the DateTime as "YYYY-MM-DD" for text representation this function is used by the cursor pagination to correctly format the date into the cursor string

func (*DateTime) Scan added in v0.10.2

func (d *DateTime) Scan(value interface{}) error

Scan implements the sql.Scanner interface for DateTime

func (DateTime) String added in v0.10.2

func (d DateTime) String() string

String formats the given datetime into a human readable version

func (*DateTime) UnmarshalCSV added in v0.10.2

func (d *DateTime) UnmarshalCSV(s string) error

UnmarshalCSV allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"

func (*DateTime) UnmarshalGQL added in v0.10.2

func (d *DateTime) UnmarshalGQL(v any) error

UnmarshalGQL allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"

func (*DateTime) UnmarshalJSON added in v0.15.1

func (d *DateTime) UnmarshalJSON(b []byte) error

UnmarshalJSON parses the DateTime from a JSON string it accepts both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ" formats and returns an error if the format is invalid

func (*DateTime) UnmarshalText added in v0.15.1

func (d *DateTime) UnmarshalText(b []byte) error

UnmarshalText parses the DateTime from a byte slice this function is used by the cursor pagination to correctly parse the date from the cursor string

func (DateTime) Value added in v0.10.2

func (d DateTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface for DateTime

type Days added in v0.15.0

type Days []enums.JobWeekday

Days is used to provide a human readable version of weekdays

type DeleteIntegrationRequest added in v0.24.1

type DeleteIntegrationRequest struct {
	ID string `param:"id" description:"Integration ID" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
}

DeleteIntegrationRequest is the request for deleting an integration

func (*DeleteIntegrationRequest) Validate added in v0.24.1

func (r *DeleteIntegrationRequest) Validate() error

Validate validates the DeleteIntegrationRequest

type DeleteIntegrationResponse added in v0.24.1

type DeleteIntegrationResponse struct {
	rout.Reply
	Message string `json:"message"`
}

DeleteIntegrationResponse is the response for deleting an integration

type EndImpersonationReply added in v0.24.1

type EndImpersonationReply struct {
	rout.Reply
	Message string `json:"message" description:"Success message"`
}

EndImpersonationReply represents the response when ending impersonation

func (*EndImpersonationReply) ExampleResponse added in v0.26.9

func (r *EndImpersonationReply) ExampleResponse() any

ExampleResponse returns an example EndImpersonationReply for OpenAPI documentation

type EndImpersonationRequest added in v0.24.1

type EndImpersonationRequest struct {
	SessionID string `json:"session_id" validate:"required" description:"The session ID to end"`
	Reason    string `json:"reason,omitempty" description:"Optional reason for ending the session"`
}

EndImpersonationRequest represents a request to end an impersonation session

func (*EndImpersonationRequest) Validate added in v0.24.1

func (r *EndImpersonationRequest) Validate() error

Validate ensures the required fields are set on the EndImpersonationRequest

type ExampleCSVRequest added in v0.7.5

type ExampleCSVRequest struct {
	Filename string `json:"filename" description:"the file name to check for" example:"actionplan"`
}

ExampleCSVRequest holds the payload for serving example CSV files

func (*ExampleCSVRequest) Validate added in v0.7.5

func (r *ExampleCSVRequest) Validate() error

Validate ensures the required fields are set on the ExampleCSVRequest request

type ExampleEvidence added in v0.7.3

type ExampleEvidence struct {
	// DocumentationType is the documentation artifact type for the example evidence
	DocumentationType string `json:"documentationType,omitempty"`
	// Description is the description of the example documentation artifact for the evidence
	Description string `json:"description,omitempty"`
}

ExampleEvidence is example evidence that can be used to satisfy the control

func (ExampleEvidence) MarshalGQL added in v0.7.3

func (e ExampleEvidence) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*ExampleEvidence) UnmarshalGQL added in v0.7.3

func (e *ExampleEvidence) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type ExampleProvider added in v0.26.9

type ExampleProvider interface {
	ExampleResponse() any
}

ExampleProvider interface allows response models to provide their own examples This eliminates the need for separate Example* variables and static switch statements

type File added in v0.3.0

type File struct {
	ID           string    `json:"id,omitempty" description:"The ID of the uploaded file"`
	Name         string    `json:"name,omitempty" description:"The name of the uploaded file"`
	Size         int64     `json:"size,omitempty" description:"The size of the uploaded file in bytes"`
	MimeType     string    `json:"mime_type,omitempty" description:"The mime type of the uploaded file"`
	ContentType  string    `json:"content_type,omitempty" description:"The content type of the uploaded file"`
	PresignedURL string    `json:"presigned_url,omitempty" description:"The presigned URL to download the file"`
	MD5          []byte    `json:"md5,omitempty" description:"The MD5 hash of the uploaded file"`
	CreatedAt    time.Time `json:"created_at,omitempty" description:"The time the file was uploaded"`
	UpdatedAt    time.Time `json:"updated_at,omitempty" description:"The time the file was last updated"`
}

File holds the fields that are sent on a response to the `/upload` endpoint

type ForgotPasswordReply

type ForgotPasswordReply struct {
	rout.Reply
	Message string `json:"message,omitempty"`
}

ForgotPasswordReply contains fields for a forgot password response

func (*ForgotPasswordReply) ExampleResponse added in v0.26.9

func (r *ForgotPasswordReply) ExampleResponse() any

ExampleResponse returns an example ForgotPasswordReply for OpenAPI documentation

type ForgotPasswordRequest

type ForgotPasswordRequest struct {
	Email string `` /* 136-byte string literal not displayed */
}

ForgotPasswordRequest contains fields for a forgot password request

func (*ForgotPasswordRequest) Validate

func (r *ForgotPasswordRequest) Validate() error

Validate ensures the required fields are set on the ForgotPasswordRequest request

type GetIntegrationStatusRequest added in v0.24.1

type GetIntegrationStatusRequest struct {
	Provider string `param:"provider" description:"OAuth provider (github, slack, etc.)" example:"github"`
}

GetIntegrationStatusRequest is the request for checking integration status

func (*GetIntegrationStatusRequest) Validate added in v0.24.1

func (r *GetIntegrationStatusRequest) Validate() error

Validate validates the GetIntegrationStatusRequest

type GetIntegrationTokenRequest added in v0.24.1

type GetIntegrationTokenRequest struct {
	Provider string `param:"provider" description:"OAuth provider (github, slack, etc.)" example:"github"`
}

GetIntegrationTokenRequest is the request for getting integration tokens

func (*GetIntegrationTokenRequest) Validate added in v0.24.1

func (r *GetIntegrationTokenRequest) Validate() error

Validate validates the GetIntegrationTokenRequest

type ImplementationGuidance added in v0.7.3

type ImplementationGuidance struct {
	// ReferenceID is the unique identifier for where the guidance was sourced from
	ReferenceID string `json:"referenceId,omitempty"`
	// Guidance are the steps to take to implement the control
	Guidance []string `json:"guidance,omitempty"`
}

ImplementationGuidance is the steps to take to implement the control they can come directly from the control source or pulled from external sources if the reference id matches the control ref code, the guidance is directly from the control if the reference id is different, the guidance is from an external source

func (ImplementationGuidance) MarshalGQL added in v0.7.3

func (i ImplementationGuidance) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*ImplementationGuidance) UnmarshalGQL added in v0.7.3

func (i *ImplementationGuidance) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type IntegrationStatusResponse added in v0.24.1

type IntegrationStatusResponse struct {
	rout.Reply
	Provider     string `json:"provider"`
	Connected    bool   `json:"connected"`
	Status       string `json:"status,omitempty"` // "connected", "expired", "invalid"
	TokenValid   bool   `json:"tokenValid,omitempty"`
	TokenExpired bool   `json:"tokenExpired,omitempty"`
	Message      string `json:"message"`
	Integration  any    `json:"integration,omitempty"` // Will be *ent.Integration
}

IntegrationStatusResponse is the response for checking integration status

func (*IntegrationStatusResponse) ExampleResponse added in v0.26.9

func (r *IntegrationStatusResponse) ExampleResponse() any

ExampleResponse returns an example IntegrationStatusResponse for OpenAPI documentation

type IntegrationToken added in v0.24.1

type IntegrationToken struct {
	Provider         string     `json:"provider" description:"OAuth provider (github, slack, etc.)"`
	AccessToken      string     `json:"accessToken" description:"OAuth access token"`
	RefreshToken     string     `json:"refreshToken,omitempty" description:"OAuth refresh token"`
	ExpiresAt        *time.Time `json:"expiresAt,omitempty" description:"Token expiration time"`
	ProviderUserID   string     `json:"providerUserId,omitempty" description:"User ID from the OAuth provider"`
	ProviderUsername string     `json:"providerUsername,omitempty" description:"Username from the OAuth provider"`
	ProviderEmail    string     `json:"providerEmail,omitempty" description:"Email from the OAuth provider"`
}

IntegrationToken represents stored OAuth tokens for an integration

func (*IntegrationToken) HasValidToken added in v0.24.1

func (t *IntegrationToken) HasValidToken() bool

HasValidToken returns true if the token is valid and not expired

func (*IntegrationToken) IsExpired added in v0.24.1

func (t *IntegrationToken) IsExpired() bool

IsExpired returns true if the token has expired

type IntegrationTokenResponse added in v0.24.1

type IntegrationTokenResponse struct {
	rout.Reply
	Provider  string            `json:"provider"`
	Token     *IntegrationToken `json:"token"`
	ExpiresAt *time.Time        `json:"expiresAt,omitempty"`
}

IntegrationTokenResponse is the response for getting integration tokens

func (*IntegrationTokenResponse) ExampleResponse added in v0.26.9

func (r *IntegrationTokenResponse) ExampleResponse() any

ExampleResponse returns an example IntegrationTokenResponse for OpenAPI documentation

type InviteReply

type InviteReply struct {
	rout.Reply
	ID          string `json:"user_id" description:"The ID of the user that was created" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	Email       string `json:"email" description:"The email address of the user" example:"jsnow@example.com"`
	Message     string `json:"message"`
	JoinedOrgID string `json:"joined_org_id" description:"The ID of the organization the user joined" example:"01JJFVMGENQS9ZG3GVA50QVX5E"`
	Role        string `json:"role" description:"The role the user has in the organization" example:"admin"`
	AuthData
}

InviteReply holds the fields that are sent on a response to an accepted invitation

func (*InviteReply) ExampleResponse added in v0.26.9

func (r *InviteReply) ExampleResponse() any

ExampleResponse returns an example InviteReply for OpenAPI documentation

type InviteRequest

type InviteRequest struct {
	Token string `query:"token" description:"The token to be used to accept the invitation, token is sent via email"`
}

InviteRequest contains invitation token for organization membership

func (*InviteRequest) Validate

func (r *InviteRequest) Validate() error

Validate ensures the required fields are set on the InviteRequest request

type JobCadence added in v0.15.0

type JobCadence struct {
	Days      Days                      `json:"days,omitempty"`
	Time      string                    `json:"time,omitempty"`
	Frequency enums.JobCadenceFrequency `json:"frequency,omitempty"`
}

JobCadence defines the logic for the execution of a job

func (JobCadence) IsZero added in v0.15.0

func (c JobCadence) IsZero() bool

IsZero checks if the cadence is not set yet

func (JobCadence) MarshalGQL added in v0.15.0

func (c JobCadence) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (JobCadence) Next added in v0.15.0

func (c JobCadence) Next(from time.Time) (time.Time, error)

Next calculates the next execution time for a JobCadence

func (JobCadence) String added in v0.15.0

func (c JobCadence) String() string

String marshals the cadence into a human readable version

func (*JobCadence) UnmarshalGQL added in v0.15.0

func (c *JobCadence) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (*JobCadence) Validate added in v0.15.0

func (c *JobCadence) Validate() error

Validate makes sure we have a usable job cadence setting

type JobConfiguration added in v0.15.0

type JobConfiguration json.RawMessage

JobConfiguration allows users configure the parameters that will be templated into their scripts that runs in the automated jobs

func (JobConfiguration) MarshalGQL added in v0.15.0

func (job JobConfiguration) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (JobConfiguration) MarshalJSON added in v0.23.4

func (job JobConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*JobConfiguration) UnmarshalGQL added in v0.15.0

func (job *JobConfiguration) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (*JobConfiguration) UnmarshalJSON added in v0.23.4

func (job *JobConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type JobRunnerRegistrationReply added in v0.16.2

type JobRunnerRegistrationReply struct {
	Reply   rout.Reply
	Message string `json:"message"`
}

JobRunnerRegistrationReply is the response to begin a job runner registration this includes the credential creation options and the session token

func (*JobRunnerRegistrationReply) ExampleResponse added in v0.26.9

func (r *JobRunnerRegistrationReply) ExampleResponse() any

ExampleResponse returns an example JobRunnerRegistrationReply for OpenAPI documentation

type JobRunnerRegistrationRequest added in v0.14.1

type JobRunnerRegistrationRequest struct {
	IPAddress string   `json:"ip_address" description:"The IP address of the node being registered"`
	Token     string   `json:"token" description:"Your agent registration token"`
	Name      string   `json:"name" description:"the name of your job runner node"`
	Tags      []string `json:"tags" description:"The tags for your runner node"`
}

JobRunnerRegistrationRequest is the request to register a new node

func (*JobRunnerRegistrationRequest) Validate added in v0.14.1

func (r *JobRunnerRegistrationRequest) Validate() error

Validate ensures the required fields are set on the AgentNodeRegistrationRequest

type ListIntegrationsResponse added in v0.24.1

type ListIntegrationsResponse struct {
	rout.Reply
	Integrations any `json:"integrations"` // Will be []*ent.Integration
}

ListIntegrationsResponse is the response for listing integrations

type LoginReply

type LoginReply struct {
	rout.Reply
	AuthData
	TFAEnabled bool   `json:"tfa_enabled,omitempty"`
	Message    string `json:"message"`
}

LoginReply contains authentication tokens and user information after successful login

func (*LoginReply) ExampleResponse added in v0.26.9

func (r *LoginReply) ExampleResponse() any

ExampleResponse returns an example LoginReply for OpenAPI documentation

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" description:"The email address associated with the existing account" example:"jsnow@example.com"`
	Password string `json:"password" description:"The password associated with the account" example:"Wint3rIsC0ming123!"`
}

LoginRequest contains credentials for user authentication

func (*LoginRequest) Validate

func (r *LoginRequest) Validate() error

Validate ensures the required fields are set on the LoginRequest request

type OAuthCallbackRequest added in v0.24.1

type OAuthCallbackRequest struct {
	Provider string `json:"provider,omitempty" query:"provider" description:"OAuth provider (extracted from state)"`
	Code     string `json:"code" query:"code" description:"OAuth authorization code"`
	State    string `json:"state" query:"state" description:"OAuth state parameter"`
}

OAuthCallbackRequest represents the OAuth callback data

func (*OAuthCallbackRequest) Validate added in v0.24.1

func (r *OAuthCallbackRequest) Validate() error

Validate ensures the required fields are set on the OAuthCallbackRequest

type OAuthCallbackResponse added in v0.24.1

type OAuthCallbackResponse struct {
	rout.Reply
	Success     bool   `json:"success" description:"Whether the OAuth callback was processed successfully"`
	Integration any    `json:"integration,omitempty" description:"The created/updated integration object"`
	Message     string `json:"message" description:"Success or error message" example:"Successfully connected GitHub integration"`
}

OAuthCallbackResponse contains the result of OAuth callback processing

func (*OAuthCallbackResponse) ExampleResponse added in v0.26.9

func (r *OAuthCallbackResponse) ExampleResponse() any

ExampleResponse returns an example OAuthCallbackResponse for OpenAPI documentation

type OAuthFlowRequest added in v0.24.1

type OAuthFlowRequest struct {
	Provider    string   `json:"provider" description:"OAuth provider (github, slack, etc.)" example:"github"`
	RedirectURI string   ``                                                                         /* 126-byte string literal not displayed */
	Scopes      []string `json:"scopes,omitempty" description:"Additional OAuth scopes to request"` // example: ["repo", "gist"]
}

OAuthFlowRequest represents the initial OAuth flow request

func (*OAuthFlowRequest) Validate added in v0.24.1

func (r *OAuthFlowRequest) Validate() error

Validate ensures the required fields are set on the OAuthFlowRequest

type OAuthFlowResponse added in v0.24.1

type OAuthFlowResponse struct {
	rout.Reply
	AuthURL       string `` /* 141-byte string literal not displayed */
	State         string `json:"state,omitempty" description:"OAuth state parameter for security" example:"eyJvcmdJRCI6IjAxSE..."`
	Message       string `` /* 146-byte string literal not displayed */
	RequiresLogin bool   `json:"requiresLogin,omitempty" description:"Whether user needs to login before OAuth flow"`
}

OAuthFlowResponse contains the OAuth authorization URL

func (*OAuthFlowResponse) ExampleResponse added in v0.26.9

func (r *OAuthFlowResponse) ExampleResponse() any

ExampleResponse returns an example OAuthFlowResponse for OpenAPI documentation

type OauthTokenRequest

type OauthTokenRequest struct {
	Name             string `json:"name" description:"The name of the user" example:"Jon Snow"`
	Email            string `json:"email" description:"The email address of the user" example:"jsnow@example.com"`
	AuthProvider     string `json:"authProvider" description:"The provider used to authenticate the user, e.g. google, github, etc." example:"google"`
	ExternalUserID   string `json:"externalUserId" description:"The ID of the user from the external provider" example:"1234567890"`
	ExternalUserName string `json:"externalUserName" description:"The username of the user from the external provider" example:"jsnow"`
	ClientToken      string `json:"clientToken" description:"The token provided by the external provider"`
	Image            string `json:"image,omitempty" description:"The image URL of the user from the external provider"`
}

OauthTokenRequest to authenticate an oauth user with the Server

type OrgModule added in v0.23.0

type OrgModule string

OrgModule identifies a purchasable module

const (
	CatalogBaseModule                    OrgModule = "base_module"
	CatalogComplianceModule              OrgModule = "compliance_module"
	CatalogDomainScanningAddon           OrgModule = "domain_scanning_addon"
	CatalogEntityManagementModule        OrgModule = "entity_management_module"
	CatalogExtraEvidenceStorageAddon     OrgModule = "extra_evidence_storage_addon"
	CatalogPolicyManagementAddon         OrgModule = "policy_management_addon"
	CatalogRiskManagementAddon           OrgModule = "risk_management_addon"
	CatalogTrustCenterModule             OrgModule = "trust_center_module"
	CatalogVulnerabilityManagementModule OrgModule = "vulnerability_management_module"
)

func (OrgModule) IsValid added in v0.23.0

func (m OrgModule) IsValid() bool

IsValid reports whether m is a known module constant

func (OrgModule) MarshalGQL added in v0.23.0

func (m OrgModule) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (OrgModule) MarshalText added in v0.23.0

func (m OrgModule) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (OrgModule) String added in v0.23.0

func (m OrgModule) String() string

String returns the string representation of the OrgModule

func (*OrgModule) UnmarshalGQL added in v0.23.0

func (m *OrgModule) UnmarshalGQL(v any) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*OrgModule) UnmarshalText added in v0.23.0

func (m *OrgModule) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type Price added in v0.6.7

type Price struct {
	// Amount is the dollar amount of the price (e.g 100)
	Amount float64 `json:"amount"`
	// Interval is the interval of the price (e.g monthly, yearly)
	Interval string `json:"interval"`
	// Currency is the currency of the price that is being charged (e.g USD)
	Currency string `json:"currency"`
}

Price is a custom type for pricing data

func (Price) MarshalGQL added in v0.6.7

func (p Price) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Price) String added in v0.6.7

func (p Price) String() string

String returns a string representation of the price

func (*Price) UnmarshalGQL added in v0.6.7

func (p *Price) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type Reference added in v0.7.3

type Reference struct {
	// Name is the name of the reference
	Name string `json:"name,omitempty"`
	// URL is the link to the reference
	URL string `json:"url,omitempty"`
}

Reference are links to external sources that can be used to gain more information about the control

func (Reference) MarshalGQL added in v0.7.3

func (r Reference) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*Reference) UnmarshalGQL added in v0.7.3

func (r *Reference) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type RefreshIntegrationTokenRequest added in v0.24.1

type RefreshIntegrationTokenRequest struct {
	Provider string `param:"provider" description:"OAuth provider (github, slack, etc.)" example:"github"`
}

RefreshIntegrationTokenRequest is the request for refreshing integration tokens

func (*RefreshIntegrationTokenRequest) Validate added in v0.24.1

func (r *RefreshIntegrationTokenRequest) Validate() error

Validate validates the RefreshIntegrationTokenRequest

type RefreshReply

type RefreshReply struct {
	rout.Reply
	Message string `json:"message,omitempty"`
	AuthData
}

RefreshReply contains new authentication tokens after successful refresh

func (*RefreshReply) ExampleResponse added in v0.26.9

func (r *RefreshReply) ExampleResponse() any

ExampleResponse returns an example RefreshReply for OpenAPI documentation

type RefreshRequest

type RefreshRequest struct {
	RefreshToken string `json:"refresh_token" description:"The token to be used to refresh the access token after expiration"`
}

RefreshRequest contains the refresh token used to obtain new access tokens

func (*RefreshRequest) Validate

func (r *RefreshRequest) Validate() error

Validate ensures the required fields are set on the RefreshRequest request

type RegisterReply

type RegisterReply struct {
	rout.Reply
	ID      string `json:"user_id" description:"The ID of the user that was created" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	Email   string `json:"email" description:"The email address of the user" example:"jsnow@example.com"`
	Message string `json:"message"`
	Token   string `json:"token,omitempty" exclude:"true"` // only used for requests against local development, excluded from OpenAPI documentation
}

RegisterReply contains authentication tokens and user information after successful registration

func (*RegisterReply) ExampleResponse added in v0.26.9

func (r *RegisterReply) ExampleResponse() any

ExampleResponse returns an example RegisterReply for OpenAPI documentation

type RegisterRequest

type RegisterRequest struct {
	FirstName string  `json:"first_name,omitempty" description:"The first name of the user" example:"Jon"`
	LastName  string  `json:"last_name,omitempty" description:"The last name of the user" example:"Snow"`
	Email     string  `json:"email,omitempty" description:"The email address of the user" example:"jsnow@example.com"`
	Password  string  `` /* 130-byte string literal not displayed */
	Token     *string `` /* 126-byte string literal not displayed */
}

RegisterRequest contains user registration information for creating new accounts

func (*RegisterRequest) Validate

func (r *RegisterRequest) Validate() error

Validate ensures the required fields are set on the RegisterRequest request

type ResendReply

type ResendReply struct {
	rout.Reply
	Message string `json:"message"`
}

ResendReply holds the fields that are sent on a response to the `/resend` endpoint

func (*ResendReply) ExampleResponse added in v0.26.9

func (r *ResendReply) ExampleResponse() any

ExampleResponse returns an example ResendReply for OpenAPI documentation

type ResendRequest

type ResendRequest struct {
	Email string `` /* 134-byte string literal not displayed */
}

ResendRequest contains fields for a resend email verification request to the `/resend` endpoint

func (*ResendRequest) Validate

func (r *ResendRequest) Validate() error

Validate ensures the required fields are set on the ResendRequest request

type ResetPasswordReply

type ResetPasswordReply struct {
	rout.Reply
	Message string `json:"message"`
}

ResetPasswordReply is the response returned from a non-successful password reset request on success, no content is returned (204)

func (*ResetPasswordReply) ExampleResponse added in v0.26.9

func (r *ResetPasswordReply) ExampleResponse() any

ExampleResponse returns an example ResetPasswordReply for OpenAPI documentation

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Password string `json:"password" description:"The new password to be used for authentication"`
	Token    string `json:"token" description:"The token to be used to reset the password, token is sent via email"`
}

ResetPasswordRequest contains user input required to reset a user's password using /password-reset endpoint

func (*ResetPasswordRequest) Validate

func (r *ResetPasswordRequest) Validate() error

Validate ensures the required fields are set on the ResetPasswordRequest request

type SSOAuthorizationMap added in v0.22.0

type SSOAuthorizationMap map[string]time.Time

SSOAuthorizationMap tracks SSO verification timestamps per organization ID.

func SSOAuthorizationsFromContext added in v0.22.0

func SSOAuthorizationsFromContext(ctx context.Context) (*SSOAuthorizationMap, bool)

SSOAuthorizationsFromContext retrieves SSOAuthorizations from the context

func (SSOAuthorizationMap) MarshalGQL added in v0.22.0

func (m SSOAuthorizationMap) MarshalGQL(w io.Writer)

MarshalGQL implements the gqlgen Marshaler interface.

func (*SSOAuthorizationMap) UnmarshalGQL added in v0.22.0

func (m *SSOAuthorizationMap) UnmarshalGQL(v any) error

UnmarshalGQL implements the gqlgen Unmarshaler interface.

type SSOCallbackRequest added in v0.22.0

type SSOCallbackRequest struct {
	Code           string `json:"code" query:"code" description:"authorization code" example:"abc"`
	State          string `json:"state" query:"state" description:"state value" example:"state123"`
	OrganizationID string `json:"organization_id" query:"organization_id" description:"organization id" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
}

SSOCallbackRequest holds the query parameters for completing the SSO login flow

func (*SSOCallbackRequest) Validate added in v0.22.0

func (r *SSOCallbackRequest) Validate() error

Validate ensures the required fields are set on the SSOCallbackRequest

type SSOLoginRequest added in v0.22.0

type SSOLoginRequest struct {
	OrganizationID string `json:"organization_id" query:"organization_id" description:"organization id" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	ReturnURL      string `json:"return" query:"return" description:"return url after authentication" example:"https://app.mitb.com"`
}

SSOLoginRequest holds the query parameters for initiating an SSO login flow

func (*SSOLoginRequest) Validate added in v0.22.0

func (r *SSOLoginRequest) Validate() error

Validate ensures the required fields are set on the SSOLoginRequest

type SSOStatusReply added in v0.22.0

type SSOStatusReply struct {
	rout.Reply
	Enforced       bool              `json:"enforced"`
	Provider       enums.SSOProvider `json:"provider,omitempty"`
	DiscoveryURL   string            `json:"discovery_url,omitempty"`
	OrganizationID string            `json:"organization_id,omitempty"`
}

SSOStatusReply is the response for SSOStatusRequest

func (*SSOStatusReply) ExampleResponse added in v0.26.9

func (r *SSOStatusReply) ExampleResponse() any

ExampleResponse returns an example SSOStatusReply for OpenAPI documentation

type SSOStatusRequest added in v0.22.0

type SSOStatusRequest struct {
	Resource string `query:"resource" description:"organization or user email to check" example:"org:01J4EXD5MM60CX4YNYN0DEE3Y1"`
}

SSOStatusRequest is the request to check if SSO login is enforced for an organization

func (*SSOStatusRequest) Validate added in v0.22.0

func (r *SSOStatusRequest) Validate() error

Validate ensures the required fields are set on the SSOStatusRequest request

type SSOTokenAuthorizeReply added in v0.22.0

type SSOTokenAuthorizeReply struct {
	rout.Reply
	OrganizationID string `json:"organization_id"`
	TokenID        string `json:"token_id"`
	Message        string `json:"message,omitempty"`
}

SSOTokenAuthorizeReply is returned when a token has been successfully authorized for SSO

func (*SSOTokenAuthorizeReply) ExampleResponse added in v0.26.9

func (r *SSOTokenAuthorizeReply) ExampleResponse() any

ExampleResponse returns an example SSOTokenAuthorizeReply for OpenAPI documentation

type SSOTokenAuthorizeRequest added in v0.22.0

type SSOTokenAuthorizeRequest struct {
	OrganizationID string `json:"organization_id" query:"organization_id" description:"organization id" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	TokenID        string `json:"token_id" query:"token_id" description:"token id to authorize" example:"01JJFVMGENQS9ZG3GVA50QVX5E"`
	TokenType      string `json:"token_type" query:"token_type" description:"token type: api or personal" example:"api"`
}

SSOTokenAuthorizeRequest is the request for authorizing a token for SSO use with an organization

func (*SSOTokenAuthorizeRequest) Validate added in v0.22.0

func (r *SSOTokenAuthorizeRequest) Validate() error

Validate ensures required fields are set on the SSOTokenAuthorizeRequest

type SSOTokenCallbackRequest added in v0.22.0

type SSOTokenCallbackRequest struct {
	Code  string `json:"code" query:"code" description:"authorization code" example:"abc"`
	State string `json:"state" query:"state" description:"state value" example:"state123"`
}

SSOTokenCallbackRequest holds the query parameters for completing token SSO authorization

func (*SSOTokenCallbackRequest) Validate added in v0.22.0

func (r *SSOTokenCallbackRequest) Validate() error

Validate ensures required fields are set on the SSOTokenCallbackRequest

type SemverVersion added in v0.7.5

type SemverVersion struct {
	// Major is the major version
	Major int `json:"major,omitempty"`
	// Minor is the minor version
	Minor int `json:"minor,omitempty"`
	// Patch is the patch version
	Patch int `json:"patch,omitempty"`
	// PreRelease is the pre-release version (used for draft versions)
	PreRelease string `json:"preRelease,omitempty"`
}

SemverVersion is a custom type for semantic versioning It is used to represent the version of objects stored in the database

func ToSemverVersion added in v0.7.5

func ToSemverVersion(version *string) (*SemverVersion, error)

ToSemverVersion converts a string to a SemverVersion It parses the string and returns a SemverVersion object It supports the following formats: - v1.0.0 - 1.0.0 - v1.0.0-alpha - 1.0.0-alpha anything after the first "-" is considered a pre-release version

func (*SemverVersion) BumpPatchSemver added in v0.7.5

func (s *SemverVersion) BumpPatchSemver()

BumpPatch increments the patch version by 1 For example if the version is v1.7.1 the new version will be v1.7.2 It resets the pre-release version to empty

func (SemverVersion) String added in v0.7.5

func (s SemverVersion) String() string

String returns a string representation of the version

type StartImpersonationReply added in v0.24.1

type StartImpersonationReply struct {
	rout.Reply
	Token     string    `json:"token" description:"The impersonation token"`
	ExpiresAt time.Time `json:"expires_at" description:"When the impersonation token expires"`
	SessionID string    `json:"session_id" description:"The impersonation session ID"`
	Message   string    `json:"message" description:"Success message"`
}

StartImpersonationReply represents the response when starting impersonation

func (*StartImpersonationReply) ExampleResponse added in v0.26.9

func (r *StartImpersonationReply) ExampleResponse() any

ExampleResponse returns an example StartImpersonationReply for OpenAPI documentation

type StartImpersonationRequest added in v0.24.1

type StartImpersonationRequest struct {
	TargetUserID   string   `json:"target_user_id" validate:"required" description:"The ID of the user to impersonate"`
	Type           string   `json:"type" validate:"required,oneof=support job admin" description:"The type of impersonation (support, job, admin)"`
	Reason         string   `json:"reason" validate:"required,min=10,max=500" description:"Reason for the impersonation"`
	Duration       *int     `json:"duration_hours,omitempty" description:"Duration in hours (optional, defaults to 1 hour)"`
	Scopes         []string `json:"scopes,omitempty" description:"Specific scopes for the impersonation session"`
	OrganizationID string   `json:"organization_id,omitempty" description:"Organization context for impersonation"`
}

StartImpersonationRequest represents a request to start impersonating a user

func (*StartImpersonationRequest) Validate added in v0.24.1

func (r *StartImpersonationRequest) Validate() error

Validate ensures the required fields are set on the StartImpersonationRequest

type SwitchOrganizationReply

type SwitchOrganizationReply struct {
	rout.Reply
	AuthData
}

SwitchOrganizationReply holds the new authentication and session information for the user for the new organization

func (*SwitchOrganizationReply) ExampleResponse added in v0.26.9

func (r *SwitchOrganizationReply) ExampleResponse() any

ExampleResponse returns an example SwitchOrganizationReply for OpenAPI documentation

type SwitchOrganizationRequest

type SwitchOrganizationRequest struct {
	TargetOrganizationID string `json:"target_organization_id" description:"The ID of the organization to switch to" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
}

SwitchOrganizationRequest contains the target organization ID being switched to for the /switch endpoint

func (*SwitchOrganizationRequest) Validate

func (r *SwitchOrganizationRequest) Validate() error

Validate ensures the required fields are set on the SwitchOrganizationRequest request

type TFAReply added in v0.6.11

type TFAReply struct {
	rout.Reply
	Message string `json:"message"`
}

TFAReply holds the response to TFARequest

func (*TFAReply) ExampleResponse added in v0.26.9

func (r *TFAReply) ExampleResponse() any

ExampleResponse returns an example TFAReply for OpenAPI documentation

type TFARequest added in v0.6.11

type TFARequest struct {
	TOTPCode     string `` /* 127-byte string literal not displayed */
	RecoveryCode string `` /* 133-byte string literal not displayed */
}

TFARequest holds the payload for verifying the 2fa code (/2fa/validate)

func (*TFARequest) Validate added in v0.6.11

func (r *TFARequest) Validate() error

Validate ensures the required fields are set on the TFARequest request

type UploadFilesReply added in v0.3.0

type UploadFilesReply struct {
	rout.Reply
	Message   string `json:"message,omitempty"`
	FileCount int64  `json:"file_count,omitempty" description:"The number of files uploaded"`
	Files     []File `json:"files,omitempty" description:"The files that were uploaded"`
}

UploadFilesReply holds the fields that are sent on a response to the `/upload` endpoint

func (*UploadFilesReply) ExampleResponse added in v0.26.9

func (r *UploadFilesReply) ExampleResponse() any

ExampleResponse returns an example UploadFilesReply for OpenAPI documentation

type UploadFilesRequest added in v0.3.0

type UploadFilesRequest struct {
	UploadFile multipart.FileHeader `form:"uploadFile" description:"The file to be uploaded"`
}

UploadFilesRequest contains file upload data and metadata

type UserInfoReply added in v0.26.9

type UserInfoReply struct {
	rout.Reply
	ID              string  `json:"id" description:"The ID of the user" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	Email           string  `json:"email" description:"The email address of the user" example:"jsnow@example.com"`
	FirstName       string  `json:"first_name,omitempty" description:"The first name of the user" example:"Jon"`
	LastName        string  `json:"last_name,omitempty" description:"The last name of the user" example:"Snow"`
	DisplayName     string  `json:"display_name,omitempty" description:"The display name of the user" example:"Jon Snow"`
	AvatarRemoteURL *string `json:"avatar_remote_url,omitempty" description:"URL of the user's remote avatar" example:"https://example.com/avatar.jpg"`
	LastSeen        *string `json:"last_seen,omitempty" description:"The time the user was last seen" example:"2023-01-01T00:00:00Z"`
	Role            string  `json:"role,omitempty" description:"The user's role" example:"ADMIN"`
	Sub             string  `json:"sub" description:"The subject of the user JWT" example:"user123"`
}

UserInfoReply contains user information for authenticated requests

type VerifyReply

type VerifyReply struct {
	rout.Reply
	ID      string `json:"user_id" description:"The ID of the user that was created" example:"01J4EXD5MM60CX4YNYN0DEE3Y1"`
	Email   string `json:"email" description:"The email address of the user" example:"jsnow@example.com"`
	Message string `json:"message,omitempty"`
	AuthData
}

VerifyReply holds the fields that are sent on a response to the `/verify` endpoint

func (*VerifyReply) ExampleResponse added in v0.26.9

func (r *VerifyReply) ExampleResponse() any

ExampleResponse returns an example VerifyReply for OpenAPI documentation

type VerifyRequest

type VerifyRequest struct {
	Token string `query:"token" description:"The token to be used to verify the email address, token is sent via email"`
}

VerifyRequest contains email verification token

func (*VerifyRequest) Validate

func (r *VerifyRequest) Validate() error

Validate ensures the required fields are set on the VerifyRequest request

type VerifySubscribeReply

type VerifySubscribeReply struct {
	rout.Reply
	Message string `json:"message,omitempty"`
}

VerifySubscribeReply holds the fields that are sent on a response to the `/subscribe/verify` endpoint

type VerifySubscribeRequest

type VerifySubscribeRequest struct {
	Token string `query:"token" description:"The token to be used to verify the subscription, token is sent via email"`
}

VerifySubscribeRequest contains subscription verification information

func (*VerifySubscribeRequest) Validate

func (r *VerifySubscribeRequest) Validate() error

Validate ensures the required fields are set on the VerifySubscribeRequest request

type VersionBump added in v0.7.5

type VersionBump string

VersionBump is a custom type for version bumping It is used to represent the type of version bumping

var (
	// Major is the major version
	Major VersionBump = "MAJOR"
	// Minor is the minor version
	Minor VersionBump = "MINOR"
	// Patch is the patch version
	Patch VersionBump = "PATCH"
	// PreRelease is the pre-release version
	PreRelease VersionBump = "DRAFT"
)

func ToVersionBump added in v0.8.3

func ToVersionBump(r string) *VersionBump

ToVersionBump returns the version bump enum based on string input

func VersionBumpFromContext added in v0.7.5

func VersionBumpFromContext(ctx context.Context) (*VersionBump, bool)

VersionBumpFromContext returns the VersionBump from the context

func VersionBumpFromRequestContext added in v0.7.5

func VersionBumpFromRequestContext(ctx context.Context) (*VersionBump, bool)

VersionBumpFromContext returns the VersionBump from the context

func (VersionBump) MarshalGQL added in v0.7.5

func (v VersionBump) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (VersionBump) String added in v0.7.5

func (v VersionBump) String() string

String returns the role as a string

func (*VersionBump) UnmarshalGQL added in v0.7.5

func (v *VersionBump) UnmarshalGQL(a any) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (VersionBump) Values added in v0.7.5

func (VersionBump) Values() (kinds []string)

Values returns a slice of strings that represents all the possible values of the VersionBump enum. Possible default values are "MAJOR", "MINOR", "PATCH", "DRAFT"

type WebauthnBeginLoginResponse

type WebauthnBeginLoginResponse struct {
	Reply rout.Reply
	*protocol.CredentialAssertion
	Session string `json:"session,omitempty"`
}

WebauthnBeginLoginResponse is the response to begin a webauthn login this includes the credential assertion options and the session token

func (*WebauthnBeginLoginResponse) ExampleResponse added in v0.26.9

func (r *WebauthnBeginLoginResponse) ExampleResponse() any

ExampleResponse returns an example WebauthnBeginLoginResponse for OpenAPI documentation

type WebauthnBeginRegistrationResponse

type WebauthnBeginRegistrationResponse struct {
	Reply rout.Reply
	*protocol.CredentialCreation
	Session string `json:"session,omitempty"`
}

WebauthnBeginRegistrationResponse is the response to begin a webauthn login this includes the credential creation options and the session token

func (*WebauthnBeginRegistrationResponse) ExampleResponse added in v0.26.9

func (r *WebauthnBeginRegistrationResponse) ExampleResponse() any

ExampleResponse returns an example WebauthnBeginRegistrationResponse for OpenAPI documentation

type WebauthnLoginFinishRequest added in v0.26.9

type WebauthnLoginFinishRequest struct {
	ID                      string                 `json:"id" description:"The credential ID"`
	RawID                   string                 `json:"rawId" description:"The raw credential ID"`
	Type                    string                 `json:"type" description:"The credential type, should be 'public-key'"`
	AuthenticatorAttachment string                 `json:"authenticatorAttachment,omitempty" description:"How the authenticator is attached"`
	ClientExtensionResults  map[string]interface{} `json:"clientExtensionResults,omitempty" description:"Extension results"`
	Response                struct {
		AuthenticatorData string `json:"authenticatorData" description:"The authenticator data"`
		ClientDataJSON    string `json:"clientDataJSON" description:"The client data JSON"`
		Signature         string `json:"signature" description:"The assertion signature"`
		UserHandle        string `json:"userHandle,omitempty" description:"The user handle"`
	} `json:"response" description:"The authenticator response"`
}

WebauthnLoginFinishRequest is the request to finish webauthn login This represents the credential assertion response from the browser's WebAuthn API

type WebauthnLoginRequest added in v0.10.1

type WebauthnLoginRequest struct {
	Email string `json:"email,omitempty" description:"The email address associated with the account" example:"jsnow@example.com"`
}

WebauthnLoginRequest is the request to begin a webauthn login

func (*WebauthnLoginRequest) Validate added in v0.10.1

func (r *WebauthnLoginRequest) Validate() error

Validate ensures the required fields are set on the WebauthnLoginRequest request

type WebauthnLoginResponse

type WebauthnLoginResponse struct {
	rout.Reply
	Message string `json:"message,omitempty"`
	AuthData
}

WebauthnLoginResponse is the response after a successful webauthn login

func (*WebauthnLoginResponse) ExampleResponse added in v0.26.9

func (r *WebauthnLoginResponse) ExampleResponse() any

ExampleResponse returns an example WebauthnLoginResponse for OpenAPI documentation

type WebauthnRegistrationFinishRequest added in v0.26.9

type WebauthnRegistrationFinishRequest struct {
	ID                      string                 `json:"id" description:"The credential ID"`
	RawID                   string                 `json:"rawId" description:"The raw credential ID"`
	Type                    string                 `json:"type" description:"The credential type, should be 'public-key'"`
	AuthenticatorAttachment string                 `json:"authenticatorAttachment,omitempty" description:"How the authenticator is attached"`
	ClientExtensionResults  map[string]interface{} `json:"clientExtensionResults,omitempty" description:"Extension results"`
	Response                struct {
		AttestationObject  string   `json:"attestationObject" description:"The attestation object"`
		ClientDataJSON     string   `json:"clientDataJSON" description:"The client data JSON"`
		PublicKey          string   `json:"publicKey,omitempty" description:"The public key"`
		PublicKeyAlgorithm int      `json:"publicKeyAlgorithm,omitempty" description:"The public key algorithm"`
		Transports         []string `json:"transports,omitempty" description:"Available transports"`
		AuthenticatorData  string   `json:"authenticatorData,omitempty" description:"The authenticator data"`
	} `json:"response" description:"The authenticator response"`
}

WebauthnRegistrationFinishRequest is the request to finish webauthn registration This represents the credential creation response from the browser's WebAuthn API

type WebauthnRegistrationRequest

type WebauthnRegistrationRequest struct {
	Email string `json:"email" description:"The email address associated with the account" example:"jsnow@example.com"`
	Name  string `json:"name,omitempty" description:"The name of the user" example:"Jon Snow"`
}

WebauthnRegistrationRequest is the request to begin a webauthn login

func (*WebauthnRegistrationRequest) Validate added in v0.6.12

func (r *WebauthnRegistrationRequest) Validate() error

type WebauthnRegistrationResponse

type WebauthnRegistrationResponse struct {
	rout.Reply
	Message string `json:"message,omitempty"`
	AuthData
}

WebauthnRegistrationResponse is the response after a successful webauthn registration

func (*WebauthnRegistrationResponse) ExampleResponse added in v0.26.9

func (r *WebauthnRegistrationResponse) ExampleResponse() any

ExampleResponse returns an example WebauthnRegistrationResponse for OpenAPI documentation

type WebfingerRequest added in v0.22.0

type WebfingerRequest struct {
	Resource string `query:"resource" description:"resource identifier prefixed with org: or acct:" example:"acct:meowmeow@kitties.com"`
}

WebfingerRequest represents the query parameters accepted by the `/.well-known/webfinger` endpoint

The `resource` field must be provided and should be prefixed with `org:` for organization lookups or `acct:` for user lookups

func (*WebfingerRequest) Validate added in v0.22.0

func (r *WebfingerRequest) Validate() error

Validate ensures a valid resource was provided on the WebfingerRequest

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL