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
Click to show internal directories.
Click to hide internal directories.