authelia/internal/storage/provider.go

29 lines
1001 B
Go
Raw Normal View History

package storage
import (
"time"
"github.com/authelia/authelia/internal/models"
)
// Provider is an interface providing storage capabilities for
// persisting any kind of data related to Authelia.
type Provider interface {
2020-01-06 06:03:16 +07:00
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)
}