Documentation
¶
Index ¶
- Variables
- type AuthenticatorStatus
- type Claim
- type ClaimStatus
- type ClaimStore
- type Service
- func (s *Service) AreUsersVerified(ctx context.Context, identitiesByUserIDs map[string][]*identity.Info) (map[string]bool, error)
- func (s *Service) DeleteClaim(ctx context.Context, claim *Claim) error
- func (s *Service) GetAuthenticatorVerificationStatus(ctx context.Context, a *authenticator.Info) (AuthenticatorStatus, error)
- func (s *Service) GetClaimStatus(ctx context.Context, userID string, claimName model.ClaimName, ...) (*ClaimStatus, error)
- func (s *Service) GetClaims(ctx context.Context, userID string) ([]*Claim, error)
- func (s *Service) GetIdentityVerificationStatus(ctx context.Context, i *identity.Info) ([]ClaimStatus, error)
- func (s *Service) GetVerificationStatuses(ctx context.Context, is []*identity.Info) (map[string][]ClaimStatus, error)
- func (s *Service) IsUserVerified(ctx context.Context, identities []*identity.Info) (bool, error)
- func (s *Service) MarkClaimVerified(ctx context.Context, claim *Claim) error
- func (s *Service) NewVerifiedClaim(ctx context.Context, userID string, claimName string, claimValue string) *Claim
- func (s *Service) RemoveOrphanedClaims(ctx context.Context, userID string, identities []*identity.Info, ...) error
- func (s *Service) ResetVerificationStatus(ctx context.Context, userID string) error
- type StorePQ
- func (s *StorePQ) Create(ctx context.Context, claim *Claim) (err error)
- func (s *StorePQ) Delete(ctx context.Context, id string) error
- func (s *StorePQ) DeleteAll(ctx context.Context, userID string) error
- func (s *StorePQ) Get(ctx context.Context, userID string, claimName string, claimValue string) (*Claim, error)
- func (s *StorePQ) ListByClaimName(ctx context.Context, userID string, claimName string) ([]*Claim, error)
- func (s *StorePQ) ListByUser(ctx context.Context, userID string) ([]*Claim, error)
- func (s *StorePQ) ListByUserIDs(ctx context.Context, userIDs []string) ([]*Claim, error)
- func (s *StorePQ) ListByUserIDsAndClaimNames(ctx context.Context, userIDs []string, claimNames []string) ([]*Claim, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( wire.Struct(new(StorePQ), "*"), wire.Bind(new(ClaimStore), new(*StorePQ)), wire.Struct(new(Service), "*"), )
View Source
var ErrClaimUnverified = errors.New("claim is unverified")
View Source
var ErrCodeNotFound = InvalidVerificationCode.NewWithCause("verification code is expired or invalid", apierrors.StringCause("CodeNotFound"))
View Source
var ErrInvalidVerificationCode = InvalidVerificationCode.NewWithCause("invalid verification code", apierrors.StringCause("InvalidVerificationCode"))
View Source
var ErrUnsupportedClaim = errors.New("unsupported claim")
View Source
var InvalidVerificationCode = apierrors.Forbidden.WithReason("InvalidVerificationCode")
Functions ¶
This section is empty.
Types ¶
type AuthenticatorStatus ¶
type AuthenticatorStatus string
const ( AuthenticatorStatusUnverified AuthenticatorStatus = "unverified" AuthenticatorStatusVerified AuthenticatorStatus = "verified" )
type Claim ¶
type Claim struct {
ID string
UserID string
Name string
Value string
CreatedAt time.Time
Metadata map[string]interface{}
}
func (*Claim) SetVerifiedByChannel ¶
func (c *Claim) SetVerifiedByChannel(verifiedByChannel model.AuthenticatorOOBChannel)
func (*Claim) VerifiedByChannel ¶
func (c *Claim) VerifiedByChannel() model.AuthenticatorOOBChannel
type ClaimStatus ¶
type ClaimStatus struct {
Name string
Value string
Verified bool
RequiredToVerifyOnCreation bool
EndUserTriggerable bool
VerifiedByChannel model.AuthenticatorOOBChannel
}
func (ClaimStatus) IsVerifiable ¶
func (s ClaimStatus) IsVerifiable() bool
type ClaimStore ¶
type ClaimStore interface {
ListByUser(ctx context.Context, userID string) ([]*Claim, error)
ListByUserIDs(ctx context.Context, userIDs []string) ([]*Claim, error)
ListByClaimName(ctx context.Context, userID string, claimName string) ([]*Claim, error)
Get(ctx context.Context, userID string, claimName string, claimValue string) (*Claim, error)
Create(ctx context.Context, claim *Claim) error
Delete(ctx context.Context, id string) error
DeleteAll(ctx context.Context, userID string) error
}
type Service ¶
type Service struct {
Config *config.VerificationConfig
UserProfileConfig *config.UserProfileConfig
Clock clock.Clock
ClaimStore ClaimStore
}
func (*Service) AreUsersVerified ¶
func (*Service) DeleteClaim ¶
func (*Service) GetAuthenticatorVerificationStatus ¶
func (s *Service) GetAuthenticatorVerificationStatus(ctx context.Context, a *authenticator.Info) (AuthenticatorStatus, error)
func (*Service) GetClaimStatus ¶
func (*Service) GetIdentityVerificationStatus ¶
func (*Service) GetVerificationStatuses ¶
func (*Service) IsUserVerified ¶
func (*Service) MarkClaimVerified ¶
func (*Service) NewVerifiedClaim ¶
func (*Service) RemoveOrphanedClaims ¶
type StorePQ ¶
type StorePQ struct {
SQLBuilder *appdb.SQLBuilderApp
SQLExecutor *appdb.SQLExecutor
}
func (*StorePQ) ListByClaimName ¶
func (*StorePQ) ListByUser ¶
func (*StorePQ) ListByUserIDs ¶
Click to show internal directories.
Click to hide internal directories.