auth

package
v0.0.0-...-0d233d1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddByPassValidateToken

func AddByPassValidateToken(srv, method string)

func HandleHttpAuth

func HandleHttpAuth(fn authenticateFunc) func(http.ResponseWriter, *http.Request)

func ValidateTokenInterceptor

func ValidateTokenInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

func ValidateTokenMiddleware

func ValidateTokenMiddleware(next http.Handler) http.Handler

Types

type Authenticated

type Authenticated interface {
	GetID() int64
	GetName() string
}

type Claims

type Claims struct {
	UserID   int64  `json:"user_id"`
	UserName string `json:"user_name"`
	jwt.RegisteredClaims
}

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type ServiceGRPC

type ServiceGRPC struct {
	authpb.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

func HandleGrpcAuth

func HandleGrpcAuth(fn authenticateFunc) *ServiceGRPC

func (*ServiceGRPC) Login

type ServiceHTTP

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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