auth

package
v0.0.0-...-9bfccdf Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(middlewares []Middleware) grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor(middlewares []Middleware) grpc.UnaryServerInterceptor

Types

type AuthenticatedUser

type AuthenticatedUser string

func AuthenticatedUserFromContext

func AuthenticatedUserFromContext(ctx context.Context) AuthenticatedUser

Returns the authorized user name from the context. Must only be called from within a server handler, where the server is configured with the authz interceptors.

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context) (AuthenticatedUser, error)
}

func NewMTLSAuthenticator

func NewMTLSAuthenticator() Authenticator

type Middleware

type Middleware interface {
	Eval(ctx context.Context) (context.Context, error)
}

func NewMiddleware

func NewMiddleware(authenticator Authenticator) Middleware

Jump to

Keyboard shortcuts

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