jwt

package
v1.0.602 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opt *interfaces.AuthOption, tfa *twofa.TwoFa, models interfaces.Models, modelStorage interfaces.Storage) interfaces.Services

Types

type Expired

type Expired struct {
	Refresh time.Duration
	Access  time.Duration
}

type Jwt

type Jwt struct {
	Option *interfaces.AuthOption
	// contains filtered or unexported fields
}

func (*Jwt) GenerateToken

func (c *Jwt) GenerateToken(enableTracing bool, ctx context.Context, req *auth.TokenRequestData) (signedToken *auth.UserLoginResponse, err error)

func (*Jwt) GetToken

func (c *Jwt) GetToken(enableTracing bool, ctx context.Context, req *auth.GetTokenRequest) (res *auth.GetTokenResponse, err error)

func (*Jwt) Login

func (c *Jwt) Login(enableTracing bool, ctx context.Context, req *auth.UserLoginRequest) (res *auth.UserLoginResponse, err error)

func (*Jwt) RefreshToken

func (c *Jwt) RefreshToken(enableTracing bool, ctx context.Context, req *auth.RefreshTokenRequest) (res *auth.UserLoginResponse, err error)

func (*Jwt) Session

func (c *Jwt) Session(enableTracing bool, ctx context.Context, req *auth.SessionRequest) (res *auth.SessionResponse, err error)

func (*Jwt) TerminatedSession

func (c *Jwt) TerminatedSession(enableTracing bool, ctx context.Context, req *auth.SessionTerminatedRequest) (res *emptypb.Empty, err error)

func (*Jwt) ValidateToken

func (c *Jwt) ValidateToken(enableTracing bool, tpp auth.TokenType, ctx context.Context, req *auth.SessionRequest) (cl *UserClaims, res *auth.SessionResponse, err error)

type UserClaims

type UserClaims struct {
	jwt.RegisteredClaims
	auth.UserClaims
}

Jump to

Keyboard shortcuts

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