persistence

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMetadataLimitExceededError

func IsMetadataLimitExceededError(err error) bool

IsMetadataLimitExceededError checks if the error is a MetadataLimitExceededError

Types

type AuditLogPersister

type AuditLogPersister interface {
	Create(auditLog models.AuditLog) error
	Get(id uuid.UUID) (*models.AuditLog, error)
	List(page int, perPage int, startTime *time.Time, endTime *time.Time, types []string, userId string, email string, ip string, searchString string) ([]models.AuditLog, error)
	Count(startTime *time.Time, endTime *time.Time, types []string, userId string, email string, ip string, searchString string) (int, error)
	Cleanup[models.AuditLog]
}

func NewAuditLogPersister

func NewAuditLogPersister(db *pop.Connection) AuditLogPersister

type Cleanup

type Cleanup[T any] interface {
	FindExpired(cutoffTime time.Time, page, perPage int) ([]T, error)
	Delete(item T) error
}

type EmailPersister

type EmailPersister interface {
	Get(emailId uuid.UUID) (*models.Email, error)
	CountByUserId(uuid.UUID) (int, error)
	FindByUserId(uuid.UUID) (models.Emails, error)
	FindByAddress(string) (*models.Email, error)
	Create(models.Email) error
	Update(models.Email) error
	Delete(models.Email) error
}

func NewEmailPersister

func NewEmailPersister(db *pop.Connection) EmailPersister

type FlowPersister

type FlowPersister interface {
	flowpilot.FlowDB
	Cleanup[models.Flow]
}

func NewFlowPersister

func NewFlowPersister(tx *pop.Connection) FlowPersister

type IdentityPersister

type IdentityPersister interface {
	Get(providerUserID string, providerID string) (*models.Identity, error)
	GetByID(identityID uuid.UUID) (*models.Identity, error)
	Create(identity models.Identity) error
	Update(identity models.Identity) error
	Delete(identity models.Identity) error
}

func NewIdentityPersister

func NewIdentityPersister(db *pop.Connection) IdentityPersister

type JwkPersister

type JwkPersister interface {
	Get(int) (*models.Jwk, error)
	GetAll() ([]models.Jwk, error)
	GetLast() (*models.Jwk, error)
	Create(models.Jwk) error
}

func NewJwkPersister

func NewJwkPersister(db *pop.Connection) JwkPersister

type MetadataLimitExceededError

type MetadataLimitExceededError struct {
	ValidationErrors *validate.Errors
}

MetadataLimitExceededError is returned when metadata fields exceed their length limits

func (*MetadataLimitExceededError) Error

func (*MetadataLimitExceededError) Unwrap

func (e *MetadataLimitExceededError) Unwrap() error

type Migrator

type Migrator interface {
	MigrateUp() error
	MigrateDown(int) error
}

type OTPSecretPersister

type OTPSecretPersister interface {
	Create(models.OTPSecret) error
	Update(*models.OTPSecret) error
	Delete(*models.OTPSecret) error
}

func NewOTPSecretPersister

func NewOTPSecretPersister(db *pop.Connection) OTPSecretPersister

type PasscodePersister

type PasscodePersister interface {
	Get(uuid.UUID) (*models.Passcode, error)
	Create(models.Passcode) error
	Update(models.Passcode) error
	Delete(models.Passcode) error
}

func NewPasscodePersister

func NewPasscodePersister(db *pop.Connection) PasscodePersister

type PasswordCredentialPersister

type PasswordCredentialPersister interface {
	Create(password models.PasswordCredential) error
	GetByUserID(userId uuid.UUID) (*models.PasswordCredential, error)
	Update(password models.PasswordCredential) error
	Delete(password models.PasswordCredential) error
}

func NewPasswordCredentialPersister

func NewPasswordCredentialPersister(db *pop.Connection) PasswordCredentialPersister

type Persister

type Persister interface {
	GetAuditLogPersister() AuditLogPersister
	GetAuditLogPersisterWithConnection(tx *pop.Connection) AuditLogPersister
	GetConnection() *pop.Connection
	GetFlowPersister() FlowPersister
	GetFlowPersisterWithConnection(tx *pop.Connection) FlowPersister
	GetEmailPersister() EmailPersister
	GetEmailPersisterWithConnection(tx *pop.Connection) EmailPersister
	GetIdentityPersister() IdentityPersister
	GetIdentityPersisterWithConnection(tx *pop.Connection) IdentityPersister
	GetJwkPersister() JwkPersister
	GetJwkPersisterWithConnection(tx *pop.Connection) JwkPersister
	GetPasscodePersister() PasscodePersister
	GetPasscodePersisterWithConnection(tx *pop.Connection) PasscodePersister
	GetPasswordCredentialPersister() PasswordCredentialPersister
	GetPasswordCredentialPersisterWithConnection(tx *pop.Connection) PasswordCredentialPersister
	GetPrimaryEmailPersister() PrimaryEmailPersister
	GetPrimaryEmailPersisterWithConnection(tx *pop.Connection) PrimaryEmailPersister
	GetSamlCertificatePersister() SamlCertificatePersister
	GetSamlCertificatePersisterWithConnection(tx *pop.Connection) SamlCertificatePersister
	GetSamlStatePersister() SamlStatePersister
	GetSamlStatePersisterWithConnection(tx *pop.Connection) SamlStatePersister
	GetSamlIdentityPersister() SamlIdentityPersister
	GetSamlIdentityPersisterWithConnection(tx *pop.Connection) SamlIdentityPersister
	GetSamlIDPInitiatedRequestPersister() SamlIDPInitiatedRequestPersister
	GetSamlIDPInitiatedRequestPersisterWithConnection(tx *pop.Connection) SamlIDPInitiatedRequestPersister
	GetTokenPersister() TokenPersister
	GetTokenPersisterWithConnection(tx *pop.Connection) TokenPersister
	GetUserPersister() UserPersister
	GetUserPersisterWithConnection(tx *pop.Connection) UserPersister
	GetUserMetadataPersister() UserMetadataPersister
	GetUserMetadataPersisterWithConnection(tx *pop.Connection) UserMetadataPersister
	GetWebauthnCredentialPersister() WebauthnCredentialPersister
	GetWebauthnCredentialPersisterWithConnection(tx *pop.Connection) WebauthnCredentialPersister
	GetWebauthnSessionDataPersister() WebauthnSessionDataPersister
	GetWebauthnSessionDataPersisterWithConnection(tx *pop.Connection) WebauthnSessionDataPersister
	GetWebhookPersister(tx *pop.Connection) WebhookPersister
	GetTrustedDevicePersister() TrustedDevicePersister
	GetTrustedDevicePersisterWithConnection(tx *pop.Connection) TrustedDevicePersister
	GetUsernamePersister() UsernamePersister
	GetUsernamePersisterWithConnection(tx *pop.Connection) UsernamePersister
	GetSessionPersister() SessionPersister
	GetSessionPersisterWithConnection(tx *pop.Connection) SessionPersister
	GetOTPSecretPersister() OTPSecretPersister
	GetOTPSecretPersisterWithConnection(tx *pop.Connection) OTPSecretPersister
	GetWebauthnCredentialUserHandlePersister() WebauthnCredentialUserHandlePersister
	GetWebauthnCredentialUserHandlePersisterWithConnection(tx *pop.Connection) WebauthnCredentialUserHandlePersister
	Transaction(func(tx *pop.Connection) error) error
}

type PrimaryEmailPersister

type PrimaryEmailPersister interface {
	Create(models.PrimaryEmail) error
	Update(models.PrimaryEmail) error
	Delete(models.PrimaryEmail) error
}

func NewPrimaryEmailPersister

func NewPrimaryEmailPersister(db *pop.Connection) PrimaryEmailPersister

type SamlCertificatePersister

type SamlCertificatePersister interface {
	Create(cert *models.SamlCertificate) error
	GetFirst() (*models.SamlCertificate, error)
	Renew(cert *models.SamlCertificate, serviceName string) error
	Delete(cert *models.SamlCertificate) error
}

func NewSamlCertificatePersister

func NewSamlCertificatePersister(db *pop.Connection) SamlCertificatePersister

type SamlIDPInitiatedRequestPersister

type SamlIDPInitiatedRequestPersister interface {
	Create(samlIDPInitiatedRequest models.SamlIDPInitiatedRequest) error
	GetByResponseIDAndIssuer(responseID, entityID string) (*models.SamlIDPInitiatedRequest, error)
}

func NewSamlIDPInitiatedRequestPersister

func NewSamlIDPInitiatedRequestPersister(db *pop.Connection) SamlIDPInitiatedRequestPersister

type SamlIdentityPersister

type SamlIdentityPersister interface {
	Create(samlIdentity models.SamlIdentity) error
	Update(samlIdentity models.SamlIdentity) error
}

func NewSamlIdentityPersister

func NewSamlIdentityPersister(db *pop.Connection) SamlIdentityPersister

type SamlStatePersister

type SamlStatePersister interface {
	Create(state models.SamlState) error
	GetByNonce(nonce string) (*models.SamlState, error)
	Delete(state models.SamlState) error
}

func NewSamlStatePersister

func NewSamlStatePersister(db *pop.Connection) SamlStatePersister

type SessionPersister

type SessionPersister interface {
	Create(session models.Session) error
	Get(id uuid.UUID) (*models.Session, error)
	Update(session models.Session) error
	List(userID uuid.UUID) ([]models.Session, error)
	ListActive(userID uuid.UUID) ([]models.Session, error)
	Delete(session models.Session) error
}

func NewSessionPersister

func NewSessionPersister(db *pop.Connection) SessionPersister

type Storage

type Storage interface {
	Migrator
	Persister
}

func New

func New(config config.Database) (Storage, error)

New return a new Persister Object with given configuration

type TokenPersister

type TokenPersister interface {
	Create(token models.Token) error
	GetByValue(value string) (*models.Token, error)
	Delete(token models.Token) error
}

func NewTokenPersister

func NewTokenPersister(db *pop.Connection) TokenPersister

type TrustedDevicePersister

type TrustedDevicePersister interface {
	Create(models.TrustedDevice) error
	FindByDeviceToken(string) (*models.TrustedDevice, error)
}

func NewTrustedDevicePersister

func NewTrustedDevicePersister(db *pop.Connection) TrustedDevicePersister

type UserMetadataPersister

type UserMetadataPersister interface {
	Get(userID uuid.UUID) (*models.UserMetadata, error)
	Update(metadata *models.UserMetadata) error
	Delete(metadata *models.UserMetadata) error
}

func NewUserMetadataPersister

func NewUserMetadataPersister(db *pop.Connection) UserMetadataPersister

type UserPersister

type UserPersister interface {
	Get(uuid.UUID) (*models.User, error)
	GetByEmailAddress(string) (*models.User, error)
	Create(models.User) error
	Update(models.User) error
	Delete(models.User) error
	List(page int, perPage int, userIDs []uuid.UUID, email string, username string, sortDirection string) ([]models.User, error)
	All() ([]models.User, error)
	Count(userIDs []uuid.UUID, email string, username string) (int, error)
	GetByUsername(username string) (*models.User, error)
}

func NewUserPersister

func NewUserPersister(db *pop.Connection) UserPersister

type UsernamePersister

type UsernamePersister interface {
	Create(username models.Username) error
	GetByName(name string) (*models.Username, error)
	Update(username *models.Username) error
	Delete(username *models.Username) error
}

func NewUsernamePersister

func NewUsernamePersister(db *pop.Connection) UsernamePersister

type WebauthnCredentialUserHandlePersister

type WebauthnCredentialUserHandlePersister interface {
	GetByHandle(string) (*models.WebauthnCredentialUserHandle, error)
}

func NewWebauthnCredentialUserHandlePersister

func NewWebauthnCredentialUserHandlePersister(db *pop.Connection) WebauthnCredentialUserHandlePersister

type WebauthnSessionDataPersister

type WebauthnSessionDataPersister interface {
	Get(id uuid.UUID) (*models.WebauthnSessionData, error)
	GetByChallenge(challenge string) (*models.WebauthnSessionData, error)
	Create(sessionData models.WebauthnSessionData) error
	Update(sessionData models.WebauthnSessionData) error
	Delete(sessionData models.WebauthnSessionData) error
	Cleanup[models.WebauthnSessionData]
}

func NewWebauthnSessionDataPersister

func NewWebauthnSessionDataPersister(db *pop.Connection) WebauthnSessionDataPersister

type WebhookPersister

type WebhookPersister interface {
	Create(webhook models.Webhook, events models.WebhookEvents) error
	Update(webhook models.Webhook) error
	Delete(webhook models.Webhook) error
	AddEvent(event models.WebhookEvent) error
	RemoveEvent(event models.WebhookEvent) error
	List(includeDisabled bool) (models.Webhooks, error)
	Get(webhookId uuid.UUID) (*models.Webhook, error)
}

func NewWebhookPersister

func NewWebhookPersister(db *pop.Connection) WebhookPersister

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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