protocauth

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnaryServerInterceptor

func UnaryServerInterceptor(authFunc AuthFunc) grpc.UnaryServerInterceptor

Types

type AuthFunc

type AuthFunc func(ctx context.Context) (context.Context, error)

type Authenticator

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

Authenticator is a simple token matching authenticator for grpc/protoc services

func New

func New(token []byte) *Authenticator

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(ctx context.Context) (context.Context, error)

type Auther

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

type ServiceAuthFuncOverride

type ServiceAuthFuncOverride interface {
	AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error)
}

type UserMetadata

type UserMetadata struct {
	ID string
}

UserMetadata contains metadata about a user.

func GetUserMetadata

func GetUserMetadata(ctx context.Context) (*UserMetadata, bool)

GetUserMetadata can be used to extract user metadata stored in a context.

Jump to

Keyboard shortcuts

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