interceptors

package
v2.47.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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