interceptors

package
v2.33.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// TokenHeader in outbound metadata for an authorization token
	TokenHeader = "authorization"
	// IDHeader in an outbound metadata for a client ID
	IDHeader = "uuid"
	// BearerHeader in an outbound metadata for a bearer token (typically a JWT)
	BearerHeader = "bearer"
)

Variables

This section is empty.

Functions

func NewClientAuth

func NewClientAuth(uuid, token string, opts ...Option) *clientInterceptor

NewClientAuth for outbound authenticated connections

Types

type Authenticator

type Authenticator interface {
	Auth(ctx context.Context) error
	ValidateClientToken(ctx context.Context) (Claims, error)
}

Authenticator Auth-s the initial connection then allows validation at any point of the stream

type Claims

type Claims map[string]interface{}

Claims contain information about the VerifiedClientToken

type ClientInterceptor

type ClientInterceptor interface {
	credentials.PerRPCCredentials
	Interceptor
}

type Interceptor

type Interceptor interface {
	Stream() grpc.StreamClientInterceptor
	Unary() grpc.UnaryClientInterceptor
}

type Option

type Option func(opt *option)

func WithBearerToken

func WithBearerToken(bearer string) Option

WithBearerToken to skip the API Token auth

Jump to

Keyboard shortcuts

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