2019-04-25 04:52:08 +07:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/clems4ever/authelia/models"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Provider is an interface providing storage capabilities for
|
|
|
|
// persisting any kind of data related to Authelia.
|
|
|
|
type Provider interface {
|
|
|
|
LoadPrefered2FAMethod(username string) (string, error)
|
|
|
|
SavePrefered2FAMethod(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)
|
|
|
|
|
2019-11-17 08:05:46 +07:00
|
|
|
SaveU2FDeviceHandle(username string, keyHandle []byte, publicKey []byte) error
|
|
|
|
LoadU2FDeviceHandle(username string) ([]byte, []byte, error)
|
2019-04-25 04:52:08 +07:00
|
|
|
|
|
|
|
AppendAuthenticationLog(attempt models.AuthenticationAttempt) error
|
|
|
|
LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)
|
|
|
|
}
|