authelia/internal/storage/provider.go
Clement Michaud df33bef478 Test user does see the not registered message.
When a user use Authelia for the first time no device is enrolled in DB.
Now we test that the user does see the "not registered" message when
no device is enrolled and see the standard 2FA method when a device is
already enrolled.
2019-12-08 14:31:48 +01:00

29 lines
1001 B
Go

package storage
import (
"time"
"github.com/clems4ever/authelia/internal/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)
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)
}