auth

package
v0.0.0-...-03b02e1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 5 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 interface {
	GenerateToken(ctx context.Context, mapClaim map[string]any) (string, error)
	ValidateToken(ctx context.Context, token string) (bool, error)
	ValidateExtractToken(ctx context.Context, token string) (map[string]any, bool, error)
}

func NewAuthMock

func NewAuthMock(token string, mapClaim map[string]any) Auth

func NewJwtAuth

func NewJwtAuth(config configs.Config) Auth

func ProviderSet

func ProviderSet(
	config configs.Config,
) Auth

type AuthMock

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

func (AuthMock) GenerateToken

func (a AuthMock) GenerateToken(ctx context.Context, mapClaim map[string]any) (string, error)

func (AuthMock) ValidateExtractToken

func (a AuthMock) ValidateExtractToken(ctx context.Context, token string) (map[string]any, bool, error)

func (AuthMock) ValidateToken

func (a AuthMock) ValidateToken(ctx context.Context, token string) (bool, error)

type JwtAuth

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

func (JwtAuth) GenerateToken

func (a JwtAuth) GenerateToken(ctx context.Context, mapClaim map[string]any) (string, error)

func (JwtAuth) ValidateExtractToken

func (a JwtAuth) ValidateExtractToken(ctx context.Context, token string) (map[string]any, bool, error)

func (JwtAuth) ValidateToken

func (a JwtAuth) ValidateToken(ctx context.Context, token string) (bool, error)

Jump to

Keyboard shortcuts

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