apikeys

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAPIKeysProvided = errors.New("no API keys provided")
)

Functions

This section is empty.

Types

type Interceptor

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

Interceptor is the interceptor for API key authentication

func NewInterceptor

func NewInterceptor(
	apiKeyService goapikey.BasicService,
	methodsToIntercept []string,
) (
	*Interceptor,
	error,
)

NewInterceptor creates a new API key authentication interceptor

Parameters:

  • apiKeyService: the API key basic service to validate the API keys
  • methodsToIntercept: a slice of method names to intercept

Returns:

  • *Interceptor: the interceptor
  • error: if no API keys are provided

func (Interceptor) Authenticate

func (i Interceptor) Authenticate() grpc.UnaryServerInterceptor

Authenticate returns the API key authentication interceptor

Returns:

  • grpc.UnaryServerInterceptor: the interceptor

Jump to

Keyboard shortcuts

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