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, 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
Returns:
- *Interceptor: the interceptor
- error: an error if the gRPC interceptions is nil or any other error occurs
func (Interceptor) Verify ¶
func (i Interceptor) Verify() grpc.UnaryClientInterceptor
Verify returns a new unary client interceptor that verifies the authentication metadata from the context is set if needed
Returns:
- grpc.UnaryClientInterceptor: the interceptor
Click to show internal directories.
Click to hide internal directories.