auth

package
v0.0.0-...-0940e79 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func (*Auth) Init

func (s *Auth) Init(ctx context.Context) (*gobs.ServiceLifeCycle, error)

func (*Auth) Logout

func (s *Auth) Logout(ctx context.Context) (any, error)

func (*Auth) RefreshToken

func (a *Auth) RefreshToken(ctx context.Context, tokenStr string) (*dto.RespToken, error)

func (*Auth) Register

func (s *Auth) Register(ctx context.Context, creds dto.Credentials) (*schema.User, error)

func (*Auth) Setup

func (s *Auth) Setup(ctx context.Context, deps ...gobs.IService) error

func (*Auth) SignIn

func (s *Auth) SignIn(ctx context.Context, creds dto.Credentials) (*dto.RespToken, error)

type JWTSecret

type JWTSecret struct {
	Secret  string `env:"JWT_SECRET" envDefault:"mysecretjwt"`
	Timeout int    `env:"JWT_TIMEOUT" envDefault:"86400"`
}

type JwtToken

type JwtToken struct {
	// contains filtered or unexported fields
}

func (*JwtToken) ComposeToken

func (a *JwtToken) ComposeToken(userID string) (string, time.Time, error)

func (*JwtToken) Init

Init implements gobs.IService.

func (*JwtToken) RefreshToken

func (a *JwtToken) RefreshToken(tokenStr string) (string, time.Time, error)

func (*JwtToken) Setup

func (a *JwtToken) Setup(ctx context.Context, deps ...gobs.IService) error

func (*JwtToken) VerifyToken

func (a *JwtToken) VerifyToken(tokenStr string) (claims jwt.RegisteredClaims, err error)

type UserRepository

type UserRepository struct {
	// contains filtered or unexported fields
}

func (*UserRepository) AddUser

func (u *UserRepository) AddUser(ctx context.Context, user schema.UserCreateParams) (res *schema.User, err error)

func (*UserRepository) GetUserForSignIn

func (u *UserRepository) GetUserForSignIn(ctx context.Context, email string) (*schema.User, error)

func (*UserRepository) Init

Init implements gobs.IServiceInit.

func (*UserRepository) Setup

func (u *UserRepository) Setup(ctx context.Context, deps ...gobs.IService) error

Setup implements gobs.IServiceSetup.

Jump to

Keyboard shortcuts

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