Documentation
¶
Index ¶
- Constants
- func AuthInfoMiddleware(key any) func(http.Handler) http.Handler
- func AuthMiddleware(providers []JWTProvider, key any, optional bool) (func(http.Handler) http.Handler, error)
- func ContextMiddleware(key, value any) func(http.Handler) http.Handler
- func ContextMiddlewareBy(c func(http.ResponseWriter, *http.Request) context.Context) func(http.Handler) http.Handler
- func GetRequestIDFromContext(ctx context.Context) string
- func GraphQLHandler(c GraphQLHandlerConfig) http.Handler
- func InitTracer(ctx context.Context, conf *TracerConfig) io.Closer
- func RequestIDMiddleware() func(http.Handler) http.Handler
- type AuthInfo
- type GraphQLHandlerConfig
- type JWTMultipleValidator
- type JWTProvider
- type JWTValidator
- type JWTValidatorWithError
- type NamedURI
- type Tracer
- type TracerConfig
Constants ¶
View Source
const TRACER_GCP = Tracer("gcp")
View Source
const TRACER_JAEGER = Tracer("jaeger")
Variables ¶
This section is empty.
Functions ¶
func AuthInfoMiddleware ¶
AuthInfoMiddleware loads claim from context and attach the user info.
func AuthMiddleware ¶
func ContextMiddlewareBy ¶
func GetRequestIDFromContext ¶
func GraphQLHandler ¶
func GraphQLHandler(c GraphQLHandlerConfig) http.Handler
func InitTracer ¶
func InitTracer(ctx context.Context, conf *TracerConfig) io.Closer
Types ¶
type GraphQLHandlerConfig ¶
type JWTMultipleValidator ¶
type JWTMultipleValidator []JWTValidator
func NewJWTMultipleValidator ¶
func NewJWTMultipleValidator(providers []JWTProvider) (JWTMultipleValidator, error)
func (JWTMultipleValidator) ValidateToken ¶
func (mv JWTMultipleValidator) ValidateToken(ctx context.Context, tokenString string) (interface{}, error)
ValidateToken tries to validate the token with each validator concurrently NOTE: the last validation error only is returned
type JWTProvider ¶
type JWTValidator ¶
type JWTValidatorWithError ¶
type JWTValidatorWithError struct {
// contains filtered or unexported fields
}
JWTValidatorWithError wraps "validator.Validator and attach iss and aud to the error message to make it easy to track errors.
func (*JWTValidatorWithError) ValidateToken ¶
func (v *JWTValidatorWithError) ValidateToken(ctx context.Context, token string) (interface{}, error)
type NamedURI ¶
func (*NamedURI) UnmarshalText ¶
type TracerConfig ¶
Click to show internal directories.
Click to hide internal directories.