middleware

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor

type Interceptor[T authorization.Ctx] struct {
	// contains filtered or unexported fields
}

func New

func New[T authorization.Ctx](authorizer *authorization.Authorizer[T], checks map[string][]authorization.CheckOption) *Interceptor[T]

func (*Interceptor[T]) Context

func (i *Interceptor[T]) Context(ctx context.Context) T

Context wraps the authorization.Context function to directly return the typed authorization.Ctx of the Interceptor.

func (*Interceptor[T]) Stream

func (i *Interceptor[T]) Stream() grpc.StreamServerInterceptor

Stream creates a grpc.StreamServerInterceptor. Ensure to configure the Interceptor with the required checks. If no checks are provided the interceptor will allow public access to the API.

func (*Interceptor[T]) Unary

func (i *Interceptor[T]) Unary() grpc.UnaryServerInterceptor

Unary creates a grpc.UnaryServerInterceptor. Ensure to configure the Interceptor with the required checks. If no checks are provided the interceptor will allow public access to the API.

Jump to

Keyboard shortcuts

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