grpc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetadataByKey

func MetadataByKey(md metadata.MD, key string) (string, error)

MetadataByKey returns the value of the first metadata with the provided key

Types

type AuthInterceptor

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

AuthInterceptor is a grpc interceptor for authentication and authorization

func NewAuthInterceptor

func NewAuthInterceptor(
	jwtManager *manager.JWT,
	accessibleRoles map[string]map[string]bool,
	guestRole string,
) *AuthInterceptor

NewAuthInterceptor returns a new auth interceptor

func (*AuthInterceptor) Stream

func (interceptor *AuthInterceptor) Stream() grpc.StreamServerInterceptor

Stream returns a server interceptor function to authenticate and authorize stream RPC

func (*AuthInterceptor) Unary

func (interceptor *AuthInterceptor) Unary() grpc.UnaryServerInterceptor

Unary returns a server interceptor function to authenticate and authorize unary RPC

Jump to

Keyboard shortcuts

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