authelia/storage/provider.go
Clement Michaud 828f565290 Bootstrap Go implementation of Authelia.
This is going to be the v4.

Expected improvements:
- More reliable due to static typing.
- Bump of performance.
- Improvement of logging.
- Authelia can be shipped as a single binary.
- Will likely work on ARM architecture.
2019-10-28 23:28:59 +01:00

28 lines
898 B
Go

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)
SaveU2FDeviceHandle(username string, device []byte) error
LoadU2FDeviceHandle(username string) ([]byte, error)
AppendAuthenticationLog(attempt models.AuthenticationAttempt) error
LoadLatestAuthenticationLogs(username string, fromDate time.Time) ([]models.AuthenticationAttempt, error)
}