auth

package
v0.0.0-...-b80b294 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToUserDetailsResponse

func ConvertToUserDetailsResponse(userResponse *protos.LoginResponse) *protos.User

func GenerateEncryptedKey

func GenerateEncryptedKey(password string, email string, salt []byte) *big.Int

Takes password and email, salt and returns encrypted key

func GenerateSalt

func GenerateSalt() ([]byte, error)

func NewSRPClient

func NewSRPClient(email string, password string, salt []byte) *srp.SRP

Types

type AuthClient

type AuthClient interface {
	//Sign up methods
	SignUp(email string, password string) ([]byte, error)
	SignupEmailResendCode(ctx context.Context, data *protos.SignupEmailResendRequest) (bool, error)
	SignupEmailConfirmation(ctx context.Context, data *protos.ConfirmSignupRequest) (bool, error)
	//Login methods
	GetSalt(ctx context.Context, email string) (*protos.GetSaltResponse, error)
	LoginPrepare(ctx context.Context, loginData *protos.PrepareRequest) (*protos.PrepareResponse, error)
	Login(email string, password string, deviceId string) (*protos.LoginResponse, []byte, error)
	// Recovery methods
	StartRecoveryByEmail(ctx context.Context, loginData *protos.StartRecoveryByEmailRequest) (bool, error)
	CompleteRecoveryByEmail(ctx context.Context, loginData *protos.CompleteRecoveryByEmailRequest) (bool, error)
	ValidateEmailRecoveryCode(ctx context.Context, loginData *protos.ValidateRecoveryCodeRequest) (*protos.ValidateRecoveryCodeResponse, error)
	// Change email methods
	ChangeEmail(ctx context.Context, loginData *protos.ChangeEmailRequest) (bool, error)
	// Complete change email methods
	CompleteChangeEmail(ctx context.Context, loginData *protos.CompleteChangeEmailRequest) (bool, error)
	DeleteAccount(ctc context.Context, loginData *protos.DeleteUserRequest) (bool, error)
	//Logout
	SignOut(ctx context.Context, logoutData *protos.LogoutRequest) (bool, error)

	Healthz(ctx context.Context) (bool, error)
}

func NewClient

func NewClient(baseURL string, userConfig func() common.UserConfig) AuthClient

NewClient creates a new instance of AuthClient

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL