Documentation
¶
Index ¶
- Variables
- func AntiBruteForceAuthenticateBucket(userID string, authType model.AuthenticatorType) ratelimit.Bucket
- type OOBOTPAuthenticatorProvider
- type OTPCodeService
- type PasskeyAuthenticatorProvider
- type PasswordAuthenticatorProvider
- type RateLimiter
- type Service
- func (s *Service) Count(userID string) (uint64, error)
- func (s *Service) Create(info *authenticator.Info) error
- func (s *Service) Delete(info *authenticator.Info) error
- func (s *Service) Get(id string) (*authenticator.Info, error)
- func (s *Service) GetMany(ids []string) ([]*authenticator.Info, error)
- func (s *Service) List(userID string, filters ...authenticator.Filter) ([]*authenticator.Info, error)
- func (s *Service) ListRefsByUsers(userIDs []string, authenticatorType *model.AuthenticatorType, ...) ([]*authenticator.Ref, error)
- func (s *Service) New(spec *authenticator.Spec) (*authenticator.Info, error)
- func (s *Service) NewWithAuthenticatorID(authenticatorID string, spec *authenticator.Spec) (*authenticator.Info, error)
- func (s *Service) RemoveOrphans(identities []*identity.Info) error
- func (s *Service) Update(info *authenticator.Info) error
- func (s *Service) VerifyWithSpec(info *authenticator.Info, spec *authenticator.Spec) (requireUpdate bool, err error)
- func (s *Service) WithSpec(ai *authenticator.Info, spec *authenticator.Spec) (bool, *authenticator.Info, error)
- type Store
- func (s *Store) Count(userID string) (uint64, error)
- func (s *Store) GetRefByID(id string) (*authenticator.Ref, error)
- func (s *Store) ListRefsByIDs(ids []string) ([]*authenticator.Ref, error)
- func (s *Store) ListRefsByUsers(userIDs []string, authenticatorType *model.AuthenticatorType, ...) ([]*authenticator.Ref, error)
- type TOTPAuthenticatorProvider
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AntiBruteForceAuthenticateBucket ¶
func AntiBruteForceAuthenticateBucket(userID string, authType model.AuthenticatorType) ratelimit.Bucket
Types ¶
type OOBOTPAuthenticatorProvider ¶
type OOBOTPAuthenticatorProvider interface { Get(userID, id string) (*authenticator.OOBOTP, error) GetMany(ids []string) ([]*authenticator.OOBOTP, error) List(userID string) ([]*authenticator.OOBOTP, error) New(id string, userID string, oobAuthenticatorType model.AuthenticatorType, target string, isDefault bool, kind string) *authenticator.OOBOTP Create(*authenticator.OOBOTP) error Delete(*authenticator.OOBOTP) error }
type OTPCodeService ¶
type PasskeyAuthenticatorProvider ¶
type PasskeyAuthenticatorProvider interface { Get(userID, id string) (*authenticator.Passkey, error) GetMany(ids []string) ([]*authenticator.Passkey, error) List(userID string) ([]*authenticator.Passkey, error) New( id string, userID string, attestationResponse []byte, isDefault bool, kind string, ) (*authenticator.Passkey, error) Create(*authenticator.Passkey) error Update(*authenticator.Passkey) error Delete(*authenticator.Passkey) error Authenticate(a *authenticator.Passkey, assertionResponse []byte) (requireUpdate bool, err error) }
type PasswordAuthenticatorProvider ¶
type PasswordAuthenticatorProvider interface { Get(userID, id string) (*authenticator.Password, error) GetMany(ids []string) ([]*authenticator.Password, error) List(userID string) ([]*authenticator.Password, error) New(id string, userID string, password string, isDefault bool, kind string) (*authenticator.Password, error) // WithPassword returns new authenticator pointer if password is changed // Otherwise original authenticator will be returned WithPassword(a *authenticator.Password, password string) (*authenticator.Password, error) Create(*authenticator.Password) error UpdatePassword(*authenticator.Password) error Delete(*authenticator.Password) error Authenticate(a *authenticator.Password, password string) (requireUpdate bool, err error) }
type RateLimiter ¶
type Service ¶
type Service struct { Store *Store Password PasswordAuthenticatorProvider Passkey PasskeyAuthenticatorProvider TOTP TOTPAuthenticatorProvider OOBOTP OOBOTPAuthenticatorProvider OTPCodeService OTPCodeService RateLimiter RateLimiter }
func (*Service) List ¶
func (s *Service) List(userID string, filters ...authenticator.Filter) ([]*authenticator.Info, error)
func (*Service) ListRefsByUsers ¶
func (s *Service) ListRefsByUsers(userIDs []string, authenticatorType *model.AuthenticatorType, authenticatorKind *authenticator.Kind) ([]*authenticator.Ref, error)
func (*Service) New ¶
func (s *Service) New(spec *authenticator.Spec) (*authenticator.Info, error)
func (*Service) NewWithAuthenticatorID ¶
func (s *Service) NewWithAuthenticatorID(authenticatorID string, spec *authenticator.Spec) (*authenticator.Info, error)
func (*Service) VerifyWithSpec ¶
func (s *Service) VerifyWithSpec(info *authenticator.Info, spec *authenticator.Spec) (requireUpdate bool, err error)
func (*Service) WithSpec ¶
func (s *Service) WithSpec(ai *authenticator.Info, spec *authenticator.Spec) (bool, *authenticator.Info, error)
type Store ¶
type Store struct { SQLBuilder *appdb.SQLBuilderApp SQLExecutor *appdb.SQLExecutor }
func (*Store) GetRefByID ¶
func (s *Store) GetRefByID(id string) (*authenticator.Ref, error)
func (*Store) ListRefsByIDs ¶
func (s *Store) ListRefsByIDs(ids []string) ([]*authenticator.Ref, error)
func (*Store) ListRefsByUsers ¶
func (s *Store) ListRefsByUsers(userIDs []string, authenticatorType *model.AuthenticatorType, authenticatorKind *authenticator.Kind) ([]*authenticator.Ref, error)
type TOTPAuthenticatorProvider ¶
type TOTPAuthenticatorProvider interface { Get(userID, id string) (*authenticator.TOTP, error) GetMany(ids []string) ([]*authenticator.TOTP, error) List(userID string) ([]*authenticator.TOTP, error) New(id string, userID string, displayName string, isDefault bool, kind string) *authenticator.TOTP Create(*authenticator.TOTP) error Delete(*authenticator.TOTP) error Authenticate(a *authenticator.TOTP, code string) error }
Click to show internal directories.
Click to hide internal directories.