Documentation
¶
Index ¶
- Constants
- func IsSecurityEventType(value string) bool
- type AdminAuditEvent
- type AllowedEmail
- type AppleCredential
- type AppleTokenRevocation
- type AuthProvider
- type AuthenticationChallenge
- type AuthenticationMethod
- type Challenge
- type ChallengePurpose
- type EmailJob
- type EmailJobStatus
- type EmailTemplate
- type EmailTemplateDeliverySetting
- type EmailTemplateOverride
- type EmailTemplateVersion
- type EmailVerificationTransaction
- type OperatorAuditEvent
- type Organization
- type OrganizationInvitation
- type OrganizationInvitationStatus
- type OrganizationKind
- type OrganizationMember
- type OrganizationMembership
- type OrganizationRole
- type Passkey
- type PendingEmailChange
- type PendingPasswordReset
- type PendingProviderLink
- type PendingProviderLinkPurpose
- type PendingSignupAction
- type Provider
- type RefreshToken
- type SecurityEvent
- type SecurityEventActorType
- type SecurityEventOutcome
- type SecurityEventType
- type Session
- type User
- type VerificationCode
- type WebAuthnChallenge
- type WebAuthnChallengePurpose
- type WebhookEvent
- type WebhookEventStatus
Constants ¶
const ( OperatorAuditActionEmailTemplateSaved = "email_template.saved" OperatorAuditActionEmailTemplateRestoredBuiltIn = "email_template.restored_builtin" OperatorAuditActionEmailTemplateDeliveryEnabled = "email_template.delivery_enabled" OperatorAuditActionEmailTemplateDeliveryDisabled = "email_template.delivery_disabled" OperatorAuditActionRuntimeSettingSet = "runtime_setting.set" OperatorAuditActionRuntimeSettingCleared = "runtime_setting.cleared" OperatorAuditResourceEmailTemplate = "email_template" OperatorAuditResourceRuntimeSetting = "runtime_setting" )
const ( SecurityEventReasonInvalidCredentials = "invalid_credentials" SecurityEventReasonInvalidAssertion = "invalid_assertion" SecurityEventReasonAccessPolicy = "access_policy" SecurityEventReasonAccountLinkRequired = "account_link_required" SecurityEventReasonProviderDisabled = "provider_disabled" SecurityEventReasonAudienceForbidden = "audience_forbidden" SecurityEventReasonUserDisabled = "user_disabled" SecurityEventReasonRefreshTokenReuse = "refresh_token_reuse" SecurityEventReasonUserRequested = "user_requested" SecurityEventReasonSecurityContainment = "security_containment" )
Variables ¶
This section is empty.
Functions ¶
func IsSecurityEventType ¶ added in v0.22.0
Types ¶
type AdminAuditEvent ¶ added in v0.1.23
type AllowedEmail ¶ added in v0.1.13
type AppleCredential ¶ added in v0.22.0
type AppleTokenRevocation ¶ added in v0.22.0
type AuthProvider ¶
type AuthenticationChallenge ¶ added in v0.22.0
type AuthenticationChallenge struct {
ID uuid.UUID
UserID uuid.UUID
SessionID uuid.UUID
CreatedAt time.Time
ExpiresAt time.Time
ConsumedAt *time.Time
AuthenticationMethod AuthenticationMethod
}
func (AuthenticationChallenge) IsConsumed ¶ added in v0.22.0
func (c AuthenticationChallenge) IsConsumed() bool
type AuthenticationMethod ¶ added in v0.22.0
type AuthenticationMethod string
const ( AuthenticationMethodPassword AuthenticationMethod = "password" AuthenticationMethodPasskey AuthenticationMethod = "passkey" AuthenticationMethodGoogle AuthenticationMethod = "google" AuthenticationMethodApple AuthenticationMethod = "apple" AuthenticationMethodMicrosoft AuthenticationMethod = "microsoft" )
type Challenge ¶ added in v0.1.12
type Challenge struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
ExpiresAt time.Time
ConsumedAt *time.Time
Purpose ChallengePurpose
Email string
AttemptCount int
MaxAttempts int
ResendCount int
MaxResends int
LastSentAt *time.Time
MinimumResendInterval time.Duration
HasMinimumResendInterval bool
}
func (Challenge) HasAttemptsRemaining ¶ added in v0.1.12
func (Challenge) IsConsumed ¶ added in v0.1.12
type ChallengePurpose ¶ added in v0.1.12
type ChallengePurpose string
const ( ChallengePurposeSignup ChallengePurpose = "signup" ChallengePurposePasswordReset ChallengePurpose = "password_reset" ChallengePurposeEmailChange ChallengePurpose = "email_change" ChallengePurposeEmailVerification ChallengePurpose = "email_verification" )
type EmailJob ¶ added in v0.1.12
type EmailJob struct {
ID uuid.UUID
ChallengeID *uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
ToEmail string
Template EmailTemplate
TemplateData []byte
Status EmailJobStatus
AttemptCount int
ProcessingStartedAt *time.Time
LastError *string
NextAttemptAt time.Time
DeliveryDeadlineAt time.Time
TerminalReason *string
FailedAt *time.Time
SentAt *time.Time
}
type EmailJobStatus ¶ added in v0.1.12
type EmailJobStatus string
const ( EmailJobStatusPending EmailJobStatus = "pending" EmailJobStatusProcessing EmailJobStatus = "processing" EmailJobStatusSent EmailJobStatus = "sent" EmailJobStatusFailed EmailJobStatus = "failed" )
type EmailTemplate ¶ added in v0.1.12
type EmailTemplate string
const ( EmailTemplateSignupCode EmailTemplate = "signup_code" EmailTemplatePasswordResetCode EmailTemplate = "password_reset_code" EmailTemplateEmailChangeCode EmailTemplate = "email_change_code" EmailTemplateOrganizationInvite EmailTemplate = "organization_invitation" EmailTemplateAccountCreated EmailTemplate = "account_created" EmailTemplateNewSignIn EmailTemplate = "new_sign_in" EmailTemplateAuthMethodAdded EmailTemplate = "auth_method_added" EmailTemplateAuthMethodRemoved EmailTemplate = "auth_method_removed" EmailTemplateSuspiciousPasskeyActivity EmailTemplate = "suspicious_passkey_activity" EmailTemplatePasswordChanged EmailTemplate = "password_changed" EmailTemplateEmailChangedOldAddress EmailTemplate = "email_changed_old_address" EmailTemplateEmailChangedNewAddress EmailTemplate = "email_changed_new_address" EmailTemplateAccountDisabled EmailTemplate = "account_disabled" EmailTemplateAccountEnabled EmailTemplate = "account_enabled" EmailTemplateAdminAccessChanged EmailTemplate = "admin_access_changed" EmailTemplateOrganizationInvitationAccepted EmailTemplate = "organization_invitation_accepted" EmailTemplateOrganizationInvitationRevoked EmailTemplate = "organization_invitation_revoked" EmailTemplateOrganizationMembershipRemoved EmailTemplate = "organization_membership_removed" EmailTemplateOrganizationRoleChanged EmailTemplate = "organization_role_changed" EmailTemplateOrganizationOwnershipTransferred EmailTemplate = "organization_ownership_transferred" EmailTemplateOrganizationDeleted EmailTemplate = "organization_deleted" )
func SupportedEmailTemplates ¶ added in v0.20.0
func SupportedEmailTemplates() []EmailTemplate
SupportedEmailTemplates returns every email template understood by Core in its stable display order.
type EmailTemplateDeliverySetting ¶ added in v0.21.0
type EmailTemplateDeliverySetting struct {
Template EmailTemplate
Enabled bool
CreatedAt time.Time
UpdatedAt time.Time
UpdatedByUserID *uuid.UUID
}
EmailTemplateDeliverySetting is an explicit operator choice for whether new jobs of a template type may be enqueued. A missing setting means enabled.
type EmailTemplateOverride ¶ added in v0.20.0
type EmailTemplateOverride struct {
Template EmailTemplate
CreatedAt time.Time
UpdatedAt time.Time
SubjectTemplate string
TextTemplate string
HTMLTemplate string
Revision int64
UpdatedByUserID *uuid.UUID
}
EmailTemplateOverride is the persisted operator customization for one Core-owned email template. A missing override means the built-in template is effective.
type EmailTemplateVersion ¶ added in v0.20.0
type EmailTemplateVersion struct {
Template EmailTemplate
Version int64
CreatedAt time.Time
SubjectTemplate string
TextTemplate string
HTMLTemplate string
CreatedByUserID *uuid.UUID
}
EmailTemplateVersion is an immutable snapshot created whenever an operator successfully saves or restores a customized template.
type EmailVerificationTransaction ¶ added in v0.22.0
type OperatorAuditEvent ¶ added in v0.20.0
type OperatorAuditEvent struct {
ID uuid.UUID
CreatedAt time.Time
ActorUserID *uuid.UUID
ActorEmail *string
Action string
ResourceType string
ResourceID string
Metadata json.RawMessage
}
OperatorAuditEvent records a control-plane mutation. Metadata is limited to non-sensitive identifiers and change summaries rather than resource bodies.
type Organization ¶ added in v0.1.24
type OrganizationInvitation ¶ added in v0.1.24
type OrganizationInvitation struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
OrganizationID uuid.UUID
Email string
Role OrganizationRole
Metadata json.RawMessage
TokenHash string
InvitedByUserID *uuid.UUID
ExpiresAt time.Time
AcceptedAt *time.Time
AcceptedByUserID *uuid.UUID
RevokedAt *time.Time
RevokedByUserID *uuid.UUID
}
func (OrganizationInvitation) Status ¶ added in v0.1.24
func (i OrganizationInvitation) Status(now time.Time) OrganizationInvitationStatus
type OrganizationInvitationStatus ¶ added in v0.1.24
type OrganizationInvitationStatus string
const ( OrganizationInvitationStatusPending OrganizationInvitationStatus = "pending" OrganizationInvitationStatusAccepted OrganizationInvitationStatus = "accepted" OrganizationInvitationStatusRevoked OrganizationInvitationStatus = "revoked" OrganizationInvitationStatusExpired OrganizationInvitationStatus = "expired" )
type OrganizationKind ¶ added in v0.1.24
type OrganizationKind string
const ( OrganizationKindPersonal OrganizationKind = "personal" OrganizationKindTeam OrganizationKind = "team" )
type OrganizationMember ¶ added in v0.1.25
type OrganizationMember struct {
User User
Membership OrganizationMembership
}
type OrganizationMembership ¶ added in v0.1.24
type OrganizationRole ¶ added in v0.1.24
type OrganizationRole string
const ( OrganizationRoleOwner OrganizationRole = "owner" OrganizationRoleAdmin OrganizationRole = "admin" OrganizationRoleMember OrganizationRole = "member" )
type Passkey ¶ added in v0.1.21
type Passkey struct {
ID uuid.UUID
UserID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
CredentialID []byte
PublicKey []byte
AttestationType string
AttestationFormat string
Transport []string
AAGUID *uuid.UUID
SignCount uint32
CloneWarning bool
RestrictedAt *time.Time
Name string
LastUsedAt *time.Time
UserPresent bool
UserVerified bool
BackupEligible bool
BackupState bool
}
type PendingEmailChange ¶ added in v0.1.15
type PendingPasswordReset ¶ added in v0.1.14
type PendingProviderLink ¶ added in v0.1.17
type PendingProviderLinkPurpose ¶ added in v0.1.19
type PendingProviderLinkPurpose string
const ( PendingProviderLinkPurposeAuthenticatedLink PendingProviderLinkPurpose = "authenticated_link" PendingProviderLinkPurposeAccountRecovery PendingProviderLinkPurpose = "account_recovery_link" )
type PendingSignupAction ¶ added in v0.1.12
type RefreshToken ¶
type SecurityEvent ¶ added in v0.22.0
type SecurityEvent struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
Type SecurityEventType `json:"type"`
Outcome SecurityEventOutcome `json:"outcome"`
ReasonCode string `json:"reason_code,omitempty"`
ActorType SecurityEventActorType `json:"actor_type"`
ActorUserID *uuid.UUID `json:"actor_user_id,omitempty"`
UserID *uuid.UUID `json:"subject_user_id,omitempty"`
SessionID *uuid.UUID `json:"session_id,omitempty"`
OrganizationID *uuid.UUID `json:"organization_id,omitempty"`
PasskeyID *uuid.UUID `json:"passkey_id,omitempty"`
AuthenticationMethod AuthenticationMethod `json:"authentication_method,omitempty"`
Response string `json:"response,omitempty"`
}
SecurityEvent contains only allowlisted, non-secret security context. Raw identifiers, tokens, credentials, email addresses, IP addresses and user agents must never be added to this record.
type SecurityEventActorType ¶ added in v0.22.0
type SecurityEventActorType string
const ( SecurityEventActorAnonymous SecurityEventActorType = "anonymous" SecurityEventActorUser SecurityEventActorType = "user" SecurityEventActorSystem SecurityEventActorType = "system" )
type SecurityEventOutcome ¶ added in v0.22.0
type SecurityEventOutcome string
const ( SecurityEventOutcomeSuccess SecurityEventOutcome = "success" SecurityEventOutcomeDenied SecurityEventOutcome = "denied" SecurityEventOutcomeFailure SecurityEventOutcome = "failure" )
type SecurityEventType ¶ added in v0.22.0
type SecurityEventType string
const ( SecurityEventAuthenticationLogin SecurityEventType = "authentication.login" SecurityEventAuthenticationReauthenticated SecurityEventType = "authentication.reauthenticated" SecurityEventSessionRefresh SecurityEventType = "session.refresh" SecurityEventSessionRefreshTokenReuse SecurityEventType = "session.refresh_token_reuse" SecurityEventSessionLogout SecurityEventType = "session.logout" SecurityEventSessionRevoked SecurityEventType = "session.revoked" SecurityEventCredentialPasswordAdded SecurityEventType = "credential.password_added" SecurityEventCredentialPasswordChanged SecurityEventType = "credential.password_changed" SecurityEventCredentialPasswordReset SecurityEventType = "credential.password_reset" SecurityEventCredentialProviderLinked SecurityEventType = "credential.provider_linked" SecurityEventCredentialProviderChanged SecurityEventType = "credential.provider_changed" SecurityEventCredentialProviderRemoved SecurityEventType = "credential.provider_removed" SecurityEventCredentialPasskeyAdded SecurityEventType = "credential.passkey_added" SecurityEventCredentialPasskeyRemoved SecurityEventType = "credential.passkey_removed" SecurityEventAccountEmailChanged SecurityEventType = "account.email_changed" SecurityEventPasskeyCloneWarning SecurityEventType = "passkey.clone_warning" )
func SecurityEventTypes ¶ added in v0.22.0
func SecurityEventTypes() []SecurityEventType
func StandardSecurityEventTypes ¶ added in v0.22.0
func StandardSecurityEventTypes() []SecurityEventType
type VerificationCode ¶ added in v0.1.12
type WebAuthnChallenge ¶ added in v0.1.21
type WebAuthnChallengePurpose ¶ added in v0.1.21
type WebAuthnChallengePurpose string
const ( WebAuthnChallengePurposeRegistration WebAuthnChallengePurpose = "registration" WebAuthnChallengePurposeAuthentication WebAuthnChallengePurpose = "authentication" WebAuthnChallengePurposeReauthentication WebAuthnChallengePurpose = "reauthentication" )
type WebhookEvent ¶ added in v0.1.27
type WebhookEventStatus ¶ added in v0.1.27
type WebhookEventStatus string
const ( WebhookEventStatusPending WebhookEventStatus = "pending" WebhookEventStatusProcessing WebhookEventStatus = "processing" WebhookEventStatusDelivered WebhookEventStatus = "delivered" WebhookEventStatusFailed WebhookEventStatus = "failed" )