jwt

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: GPL-3.0 Imports: 9 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 struct {
	// contains filtered or unexported fields
}

Interceptor is the interceptor for the authentication

func NewInterceptor

func NewInterceptor(
	interceptions map[string]*gojwttoken.Token,
	options *Options,
	logger *slog.Logger,
) (*Interceptor, error)

NewInterceptor creates a new authentication interceptor

Parameters:

  • interceptions: the gRPC interceptions to determine which methods require authentication
  • options: the options for the interceptor
  • logger: the logger to use for logging

Returns:

  • *Interceptor: the interceptor
  • error: an error if the token source or the gRPC interceptions is nil or any other error occurs

func (Interceptor) Verify

Verify returns a new unary client interceptor that verifies the authentication metadata from the context is set if needed

Returns:

  • grpc.UnaryClientInterceptor: the interceptor

type Options

type Options struct {
	GCloudTokenSource *oauth.TokenSource
}

Options is the options for the interceptor

func NewOptions

func NewOptions(
	gCloudTokenSource *oauth.TokenSource,
) *Options

NewOptions creates a new options for the interceptor

Parameters:

  • gCloudTokenSource: the OAuth token source to get the access token for Google Cloud services

Returns:

  • *Options: the options

Jump to

Keyboard shortcuts

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