Documentation
¶
Index ¶
- func ValidateProfileChangePassworRequest(dirtyData *ProfileChangePasswordRequestIDO) error
- type GatewayController
- type GatewayControllerImpl
- func (impl *GatewayControllerImpl) DisableOTP(ctx context.Context) (*u_d.User, error)
- func (impl *GatewayControllerImpl) ForgotPassword(ctx context.Context, email string) error
- func (impl *GatewayControllerImpl) GenerateOTP(ctx context.Context) (*OTPGenerateResponseIDO, error)
- func (impl *GatewayControllerImpl) GenerateOTPAndQRCodePNGImage(ctx context.Context) ([]byte, error)
- func (impl *GatewayControllerImpl) GetUserBySessionID(ctx context.Context, sessionID string) (*user_s.User, error)
- func (impl *GatewayControllerImpl) Login(ctx context.Context, email, password string) (*gateway_s.LoginResponseIDO, error)
- func (impl *GatewayControllerImpl) Logout(ctx context.Context) error
- func (impl *GatewayControllerImpl) PasswordReset(ctx context.Context, code string, password string) error
- func (impl *GatewayControllerImpl) Profile(ctx context.Context) (*user_s.User, error)
- func (impl *GatewayControllerImpl) ProfileChangePassword(ctx context.Context, req *ProfileChangePasswordRequestIDO) error
- func (impl *GatewayControllerImpl) ProfileUpdate(ctx context.Context, nu *user_s.User) error
- func (impl *GatewayControllerImpl) RecoveryOTP(ctx context.Context, req *RecoveryRequestIDO) (*gateway_s.LoginResponseIDO, error)
- func (impl *GatewayControllerImpl) RefreshToken(ctx context.Context, value string) (*user_s.User, string, time.Time, string, time.Time, error)
- func (impl *GatewayControllerImpl) RegisterBusiness(ctx context.Context, req *gateway_s.RegisterBusinessRequestIDO) error
- func (impl *GatewayControllerImpl) RegisterCustomer(ctx context.Context, req *gateway_s.RegisterCustomerRequestIDO) error
- func (impl *GatewayControllerImpl) ValidateOTP(ctx context.Context, req *ValidateTokenRequestIDO) (*ValidateTokenResponseIDO, error)
- func (impl *GatewayControllerImpl) Verify(ctx context.Context, code string) (*gateway_s.VerifyResponseIDO, error)
- func (impl *GatewayControllerImpl) VerifyOTP(ctx context.Context, req *VerificationTokenRequestIDO) (*VerificationTokenResponseIDO, error)
- type OTPGenerateResponseIDO
- type ProfileChangePasswordRequestIDO
- type RecoveryRequestIDO
- type ValidateTokenRequestIDO
- type ValidateTokenResponseIDO
- type VerificationTokenRequestIDO
- type VerificationTokenResponseIDO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateProfileChangePassworRequest ¶
func ValidateProfileChangePassworRequest(dirtyData *ProfileChangePasswordRequestIDO) error
Types ¶
type GatewayController ¶
type GatewayController interface { RegisterBusiness(ctx context.Context, req *gateway_s.RegisterBusinessRequestIDO) error RegisterCustomer(ctx context.Context, req *gateway_s.RegisterCustomerRequestIDO) error Login(ctx context.Context, email, password string) (*gateway_s.LoginResponseIDO, error) GetUserBySessionID(ctx context.Context, sessionID string) (*user_s.User, error) RefreshToken(ctx context.Context, value string) (*user_s.User, string, time.Time, string, time.Time, error) Verify(ctx context.Context, code string) (*gateway_s.VerifyResponseIDO, error) Logout(ctx context.Context) error ForgotPassword(ctx context.Context, email string) error PasswordReset(ctx context.Context, code string, password string) error Profile(ctx context.Context) (*user_s.User, error) ProfileUpdate(ctx context.Context, nu *user_s.User) error ProfileChangePassword(ctx context.Context, req *ProfileChangePasswordRequestIDO) error GenerateOTP(ctx context.Context) (*OTPGenerateResponseIDO, error) GenerateOTPAndQRCodePNGImage(ctx context.Context) ([]byte, error) VerifyOTP(ctx context.Context, req *VerificationTokenRequestIDO) (*VerificationTokenResponseIDO, error) ValidateOTP(ctx context.Context, req *ValidateTokenRequestIDO) (*ValidateTokenResponseIDO, error) DisableOTP(ctx context.Context) (*u_d.User, error) RecoveryOTP(ctx context.Context, req *RecoveryRequestIDO) (*gateway_s.LoginResponseIDO, error) }
func NewController ¶
func NewController( appCfg *config.Conf, loggerp *slog.Logger, uuidp uuid.Provider, jwtp jwt.Provider, kmx kmutex.Provider, passwordp password.Provider, cache mongodbcache.Cacher, client *mongo.Client, te templatedemailer.TemplatedEmailer, paymentProcessor pm.PaymentProcessor, usr_storer user_s.UserStorer, org_storer store_s.StoreStorer, ) GatewayController
type GatewayControllerImpl ¶
type GatewayControllerImpl struct { Config *config.Conf Logger *slog.Logger UUID uuid.Provider JWT jwt.Provider Kmutex kmutex.Provider Password password.Provider Cache mongodbcache.Cacher DbClient *mongo.Client TemplatedEmailer templatedemailer.TemplatedEmailer PaymentProcessor pm.PaymentProcessor UserStorer user_s.UserStorer StoreStorer store_s.StoreStorer }
func (*GatewayControllerImpl) DisableOTP ¶
DisableOTP function disables 2FA.
func (*GatewayControllerImpl) ForgotPassword ¶
func (impl *GatewayControllerImpl) ForgotPassword(ctx context.Context, email string) error
func (*GatewayControllerImpl) GenerateOTP ¶
func (impl *GatewayControllerImpl) GenerateOTP(ctx context.Context) (*OTPGenerateResponseIDO, error)
GenerateOTP function generates the time-based one-time password (TOTP) secret for the user. The user must use these values to generate a QR to present to the user.
func (*GatewayControllerImpl) GenerateOTPAndQRCodePNGImage ¶
func (impl *GatewayControllerImpl) GenerateOTPAndQRCodePNGImage(ctx context.Context) ([]byte, error)
func (*GatewayControllerImpl) GetUserBySessionID ¶
func (*GatewayControllerImpl) Login ¶
func (impl *GatewayControllerImpl) Login(ctx context.Context, email, password string) (*gateway_s.LoginResponseIDO, error)
func (*GatewayControllerImpl) Logout ¶
func (impl *GatewayControllerImpl) Logout(ctx context.Context) error
func (*GatewayControllerImpl) PasswordReset ¶
func (*GatewayControllerImpl) ProfileChangePassword ¶
func (impl *GatewayControllerImpl) ProfileChangePassword(ctx context.Context, req *ProfileChangePasswordRequestIDO) error
func (*GatewayControllerImpl) ProfileUpdate ¶
func (*GatewayControllerImpl) RecoveryOTP ¶
func (impl *GatewayControllerImpl) RecoveryOTP(ctx context.Context, req *RecoveryRequestIDO) (*gateway_s.LoginResponseIDO, error)
RecoveryOTP function verifies provided `backup code` for the logged in user and disable 2FA plus log user in if successfully verified.
func (*GatewayControllerImpl) RefreshToken ¶
func (*GatewayControllerImpl) RegisterBusiness ¶
func (impl *GatewayControllerImpl) RegisterBusiness(ctx context.Context, req *gateway_s.RegisterBusinessRequestIDO) error
func (*GatewayControllerImpl) RegisterCustomer ¶
func (impl *GatewayControllerImpl) RegisterCustomer(ctx context.Context, req *gateway_s.RegisterCustomerRequestIDO) error
func (*GatewayControllerImpl) ValidateOTP ¶
func (impl *GatewayControllerImpl) ValidateOTP(ctx context.Context, req *ValidateTokenRequestIDO) (*ValidateTokenResponseIDO, error)
ValidateOTP function verifies provided token from the third-party authenticator app. The purpose of this function is enable the loggin for 2FA.
func (*GatewayControllerImpl) Verify ¶
func (impl *GatewayControllerImpl) Verify(ctx context.Context, code string) (*gateway_s.VerifyResponseIDO, error)
func (*GatewayControllerImpl) VerifyOTP ¶
func (impl *GatewayControllerImpl) VerifyOTP(ctx context.Context, req *VerificationTokenRequestIDO) (*VerificationTokenResponseIDO, error)
VerifyOTP function verifies provided token from the third-party authenticator app. The purpose of this function is to finish the otp setup.
type OTPGenerateResponseIDO ¶
type RecoveryRequestIDO ¶
type RecoveryRequestIDO struct {
BackupCode string `json:"backup_code"`
}
type ValidateTokenRequestIDO ¶
type ValidateTokenRequestIDO struct {
Token string `json:"token"`
}
type VerificationTokenRequestIDO ¶
type VerificationTokenRequestIDO struct {
VerificationToken string `json:"verification_token"`
}
Click to show internal directories.
Click to hide internal directories.