auth

package
v4.20.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(ctx context.Context) (*contracts.UserInfo, error)

func MustGetUser

func MustGetUser(ctx context.Context) *contracts.UserInfo

func NewJwtAuth

func NewJwtAuth(priKey *rsa.PrivateKey, pubKey *rsa.PublicKey) contracts.AuthInterface

func SetUser

func SetUser(ctx context.Context, info *contracts.UserInfo) context.Context

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

Types

type Authn

type Authn struct {
	Authns []contracts.Authenticator
	// contains filtered or unexported fields
}

func NewAuthn

func NewAuthn(signFunc func(info contracts.UserInfo) (*contracts.SignData, error), authns ...contracts.Authenticator) *Authn

func (*Authn) Sign

func (a *Authn) Sign(info contracts.UserInfo) (*contracts.SignData, error)

func (*Authn) VerifyToken

func (a *Authn) VerifyToken(s string) (*contracts.JwtClaims, bool)

Jump to

Keyboard shortcuts

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