2019-04-24 21:52:08 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2019-12-24 02:14:52 +00:00
|
|
|
"github.com/authelia/authelia/internal/models"
|
2019-04-24 21:52:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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-12-07 17:14:26 +00:00
|
|
|
DeleteTOTPSecret(username string) error
|
2019-04-24 21:52:08 +00:00
|
|
|
|
2019-11-17 01:05:46 +00:00
|
|
|
SaveU2FDeviceHandle(username string, keyHandle []byte, publicKey []byte) error
|
2019-12-07 11:18:22 +00:00
|
|
|
LoadU2FDeviceHandle(username string) (keyHandle []byte, publicKey []byte, err error)
|
2019-04-24 21:52:08 +00:00
|
|
|
|
|
|
|
AppendAuthenticationLog(attempt models.AuthenticationAttempt) error
|
|
|
|
LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)
|
|
|
|
}
|