Documentation
¶
Index ¶
- func APIKeyAuthStreamInterceptor(provider APIKeyAuthProvider) grpc.StreamServerInterceptor
- func APIKeyAuthUnaryInterceptor(provider APIKeyAuthProvider) grpc.UnaryServerInterceptor
- func BasicAuthStreamInterceptor(provider BasicAuthProvider) grpc.StreamServerInterceptor
- func BasicAuthUnaryInterceptor(provider BasicAuthProvider) grpc.UnaryServerInterceptor
- func NewAuthStreamInterceptor(validator AuthValidator, method any) grpc.StreamServerInterceptor
- func NewAuthUnaryInterceptor(validator AuthValidator, method any) grpc.UnaryServerInterceptor
- func OAuthStreamInterceptor(key auth.PublicKeyProvider, options ...jwt.ParserOption) grpc.StreamServerInterceptor
- func OAuthUnaryInterceptor(key auth.PublicKeyProvider, options ...jwt.ParserOption) grpc.UnaryServerInterceptor
- type APIKeyAuthProvider
- type AuthValidator
- type BasicAuthProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIKeyAuthStreamInterceptor ¶
func APIKeyAuthStreamInterceptor(provider APIKeyAuthProvider) grpc.StreamServerInterceptor
APIKeyAuthStreamInterceptor returns a gRPC stream server interceptor that validates the API key.
func APIKeyAuthUnaryInterceptor ¶
func APIKeyAuthUnaryInterceptor(provider APIKeyAuthProvider) grpc.UnaryServerInterceptor
APIKeyAuthUnaryInterceptor returns a gRPC unary server interceptor that validates the API key.
func BasicAuthStreamInterceptor ¶
func BasicAuthStreamInterceptor(provider BasicAuthProvider) grpc.StreamServerInterceptor
BasicAuthStreamInterceptor returns a gRPC stream server interceptor that validates the Basic Auth credentials.
func BasicAuthUnaryInterceptor ¶
func BasicAuthUnaryInterceptor(provider BasicAuthProvider) grpc.UnaryServerInterceptor
BasicAuthUnaryInterceptor returns a gRPC unary server interceptor that validates the Basic Auth credentials.
func NewAuthStreamInterceptor ¶
func NewAuthStreamInterceptor(validator AuthValidator, method any) grpc.StreamServerInterceptor
NewAuthStreamInterceptor creates a stream interceptor using the provided validator and auth method.
func NewAuthUnaryInterceptor ¶
func NewAuthUnaryInterceptor(validator AuthValidator, method any) grpc.UnaryServerInterceptor
NewAuthUnaryInterceptor creates a unary interceptor using the provided validator and auth method.
func OAuthStreamInterceptor ¶
func OAuthStreamInterceptor(key auth.PublicKeyProvider, options ...jwt.ParserOption) grpc.StreamServerInterceptor
OAuthStreamInterceptor returns a gRPC stream server interceptor that validates the OAuth token.
func OAuthUnaryInterceptor ¶
func OAuthUnaryInterceptor(key auth.PublicKeyProvider, options ...jwt.ParserOption) grpc.UnaryServerInterceptor
OAuthUnaryInterceptor returns a gRPC unary server interceptor that validates the OAuth token.
Types ¶
type APIKeyAuthProvider ¶
type APIKeyAuthProvider struct {
APIKeys []string
ValidateFunc func(apiKey string) bool
ValidateFuncWithDatasources func(c *infra.Container, apiKey string) bool
Container *infra.Container
}
APIKeyAuthProvider holds the configuration for API key authentication.
type AuthValidator ¶
AuthValidator defines a function that validates credentials from context and returns the identity and auth method.
type BasicAuthProvider ¶
type BasicAuthProvider struct {
Users map[string]string
ValidateFunc func(username, password string) bool
ValidateFuncWithDatasources func(c *infra.Container, username, password string) bool
Container *infra.Container
}
BasicAuthProvider holds the configuration for basic authentication.