Documentation ¶
Index ¶
- Constants
- type FailedOtpAttempt
- type ParticipantUserDBService
- func (dbService *ParticipantUserDBService) AddFailedOtpAttempt(instanceID string, userID string) error
- func (dbService *ParticipantUserDBService) AddUser(instanceID string, user umTypes.User) (id string, err error)
- func (dbService *ParticipantUserDBService) CountFailedOtpAttempts(instanceID string, userID string) (int64, error)
- func (dbService *ParticipantUserDBService) CountOTP(instanceID string, userID string) (int64, error)
- func (dbService *ParticipantUserDBService) CountRecentlyCreatedUsers(instanceID string, interval int64) (count int64, err error)
- func (dbService *ParticipantUserDBService) CreateIndexForFailedOtpAttempts(instanceID string) error
- func (dbService *ParticipantUserDBService) CreateIndexForOTPs(instanceID string) error
- func (dbService *ParticipantUserDBService) CreateIndexForParticipantUsers(instanceID string) error
- func (dbService *ParticipantUserDBService) CreateIndexForRenewTokens(instanceID string) error
- func (dbService *ParticipantUserDBService) CreateOTP(instanceID string, userID string, code string, t userTypes.OTPType, ...) error
- func (dbService *ParticipantUserDBService) CreateRenewToken(instanceID string, userID string, token string, lifeTimeInSec int) error
- func (dbService *ParticipantUserDBService) DeleteOTP(instanceID string, userID string, code string) error
- func (dbService *ParticipantUserDBService) DeleteOTPs(instanceID string, userID string) error
- func (dbService *ParticipantUserDBService) DeleteRenewTokenByToken(instanceID string, token string) error
- func (dbService *ParticipantUserDBService) DeleteRenewTokensForUser(instanceID string, userID string) (int64, error)
- func (dbService *ParticipantUserDBService) DeleteUser(instanceID, userID string) error
- func (dbService *ParticipantUserDBService) FindAndExecuteOnUsers(ctx context.Context, instanceID string, filter bson.M, sort bson.M, ...) error
- func (dbService *ParticipantUserDBService) FindAndUpdateRenewToken(instanceID string, userID string, renewToken string, nextToken string) (rtObj userTypes.RenewToken, err error)
- func (dbService *ParticipantUserDBService) FindOTP(instanceID string, userID string, code string) (userTypes.OTP, error)
- func (dbService *ParticipantUserDBService) FixFieldNameForContactInfos(instanceID string) error
- func (dbService *ParticipantUserDBService) GetLastOTP(instanceID string, userID string, otpType string) (userTypes.OTP, error)
- func (dbService *ParticipantUserDBService) GetUser(instanceID, objectID string) (umTypes.User, error)
- func (dbService *ParticipantUserDBService) GetUserByAccountID(instanceID, accountID string) (umTypes.User, error)
- func (dbService *ParticipantUserDBService) GetUserByProfileID(instanceID, profileID string) (umTypes.User, error)
- func (dbService *ParticipantUserDBService) ReplaceUser(instanceID string, updatedUser umTypes.User) (umTypes.User, error)
- func (dbService *ParticipantUserDBService) SaveFailedLoginAttempt(instanceID string, userID string) error
- func (dbService *ParticipantUserDBService) SavePasswordResetTrigger(instanceID string, userID string) error
- func (dbService *ParticipantUserDBService) UpdateUser(instanceID string, userID string, update bson.M) error
Constants ¶
View Source
const ( COLLECTION_NAME_PARTICIPANT_USERS = "users" COLLECTION_NAME_RENEW_TOKENS = "renewTokens" COLLECTION_NAME_OTPS = "otps" COLLECTION_NAME_FAILED_OTP_ATTEMPTS = "failedOtpAttempts" )
collection names
View Source
const ( RENEW_TOKEN_GRACE_PERIOD = 30 // seconds RENEW_TOKEN_DEFAULT_LIFETIME = 60 * 60 * 24 * 90 )
View Source
const (
FAILED_OTP_ATTEMP_WINDOW = 60 * 5
)
View Source
const (
OTP_TTL = 60 * 15
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailedOtpAttempt ¶
type ParticipantUserDBService ¶
type ParticipantUserDBService struct { DBClient *mongo.Client DBNamePrefix string InstanceIDs []string // contains filtered or unexported fields }
func NewParticipantUserDBService ¶
func NewParticipantUserDBService(configs db.DBConfig) (*ParticipantUserDBService, error)
func (*ParticipantUserDBService) AddFailedOtpAttempt ¶
func (dbService *ParticipantUserDBService) AddFailedOtpAttempt(instanceID string, userID string) error
func (*ParticipantUserDBService) CountFailedOtpAttempts ¶
func (dbService *ParticipantUserDBService) CountFailedOtpAttempts(instanceID string, userID string) (int64, error)
func (*ParticipantUserDBService) CountOTP ¶
func (dbService *ParticipantUserDBService) CountOTP(instanceID string, userID string) (int64, error)
func (*ParticipantUserDBService) CountRecentlyCreatedUsers ¶
func (dbService *ParticipantUserDBService) CountRecentlyCreatedUsers(instanceID string, interval int64) (count int64, err error)
func (*ParticipantUserDBService) CreateIndexForFailedOtpAttempts ¶
func (dbService *ParticipantUserDBService) CreateIndexForFailedOtpAttempts(instanceID string) error
func (*ParticipantUserDBService) CreateIndexForOTPs ¶
func (dbService *ParticipantUserDBService) CreateIndexForOTPs(instanceID string) error
func (*ParticipantUserDBService) CreateIndexForParticipantUsers ¶
func (dbService *ParticipantUserDBService) CreateIndexForParticipantUsers(instanceID string) error
func (*ParticipantUserDBService) CreateIndexForRenewTokens ¶
func (dbService *ParticipantUserDBService) CreateIndexForRenewTokens(instanceID string) error
func (*ParticipantUserDBService) CreateRenewToken ¶
func (*ParticipantUserDBService) DeleteOTP ¶
func (dbService *ParticipantUserDBService) DeleteOTP(instanceID string, userID string, code string) error
func (*ParticipantUserDBService) DeleteOTPs ¶
func (dbService *ParticipantUserDBService) DeleteOTPs(instanceID string, userID string) error
func (*ParticipantUserDBService) DeleteRenewTokenByToken ¶
func (dbService *ParticipantUserDBService) DeleteRenewTokenByToken(instanceID string, token string) error
func (*ParticipantUserDBService) DeleteRenewTokensForUser ¶
func (dbService *ParticipantUserDBService) DeleteRenewTokensForUser(instanceID string, userID string) (int64, error)
func (*ParticipantUserDBService) DeleteUser ¶
func (dbService *ParticipantUserDBService) DeleteUser(instanceID, userID string) error
func (*ParticipantUserDBService) FindAndExecuteOnUsers ¶
func (*ParticipantUserDBService) FindAndUpdateRenewToken ¶
func (dbService *ParticipantUserDBService) FindAndUpdateRenewToken(instanceID string, userID string, renewToken string, nextToken string) (rtObj userTypes.RenewToken, err error)
func (*ParticipantUserDBService) FixFieldNameForContactInfos ¶
func (dbService *ParticipantUserDBService) FixFieldNameForContactInfos(instanceID string) error
func (*ParticipantUserDBService) GetLastOTP ¶
func (*ParticipantUserDBService) GetUser ¶
func (dbService *ParticipantUserDBService) GetUser(instanceID, objectID string) (umTypes.User, error)
func (*ParticipantUserDBService) GetUserByAccountID ¶
func (dbService *ParticipantUserDBService) GetUserByAccountID(instanceID, accountID string) (umTypes.User, error)
func (*ParticipantUserDBService) GetUserByProfileID ¶
func (dbService *ParticipantUserDBService) GetUserByProfileID(instanceID, profileID string) (umTypes.User, error)
func (*ParticipantUserDBService) ReplaceUser ¶
func (*ParticipantUserDBService) SaveFailedLoginAttempt ¶
func (dbService *ParticipantUserDBService) SaveFailedLoginAttempt(instanceID string, userID string) error
func (*ParticipantUserDBService) SavePasswordResetTrigger ¶
func (dbService *ParticipantUserDBService) SavePasswordResetTrigger(instanceID string, userID string) error
func (*ParticipantUserDBService) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.