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