authelia/internal/storage/provider.go
James Elliott b4e570358e
fix: include major in go.mod module directive (#2278)
* build: include major in go.mod module directive

* fix: xflags

* revert: cobra changes

* fix: mock doc
2021-08-11 11:16:46 +10:00

29 lines
1004 B
Go

package storage
import (
"time"
"github.com/authelia/authelia/v4/internal/models"
)
// Provider is an interface providing storage capabilities for
// persisting any kind of data related to Authelia.
type Provider interface {
LoadPreferred2FAMethod(username string) (string, error)
SavePreferred2FAMethod(username string, method string) error
FindIdentityVerificationToken(token string) (bool, error)
SaveIdentityVerificationToken(token string) error
RemoveIdentityVerificationToken(token string) error
SaveTOTPSecret(username string, secret string) error
LoadTOTPSecret(username string) (string, error)
DeleteTOTPSecret(username string) error
SaveU2FDeviceHandle(username string, keyHandle []byte, publicKey []byte) error
LoadU2FDeviceHandle(username string) (keyHandle []byte, publicKey []byte, err error)
AppendAuthenticationLog(attempt models.AuthenticationAttempt) error
LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)
}