auth

package
v0.0.0-...-a3c7b10 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccessDenied = errors.New("access denied")
View Source
var ErrInvalidCertificate = errors.New("invalid certificate")
View Source
var ErrPeerRequired = errors.New("peer required")
View Source
var ErrTlsInformationRequired = errors.New("TLS required")

Functions

func ContextWithUser

func ContextWithUser(ctx context.Context, user *User) context.Context

func GRPCAuthenticationMiddleware

func GRPCAuthenticationMiddleware(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

TODO: deal with revoked certificates

func GRPCAuthenticationStreamMiddleware

func GRPCAuthenticationStreamMiddleware(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

Types

type User

type User struct {
	ID string
}

user auth model

func GetUserFromContext

func GetUserFromContext(ctx context.Context) *User

Jump to

Keyboard shortcuts

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