Documentation ¶
Index ¶
- Constants
- Variables
- func ContextWithGRPCAuth(ctx context.Context, token string) context.Context
- func ExtractProviderToken(ctx context.Context) (*oauth2.Token, error)
- func WithGrpcErrorLogging(log logr.Logger) runtime.ServeMuxOption
- func WithLogging(log logr.Logger, mux *runtime.ServeMux) http.Handler
- func WithProviderToken(jwtClient auth.JWTClient, h http.Handler, log logr.Logger) http.Handler
Constants ¶
View Source
const ( GRPCAuthMetadataKey = "grpc-auth" GitProviderTokenHeader = "Git-Provider-Token" )
Variables ¶
View Source
var RequestErrorText = "request error"
View Source
var RequestOkText = "request success"
View Source
var ServerErrorText = "server error"
Functions ¶
func ContextWithGRPCAuth ¶
func ExtractProviderToken ¶
Get the token from request context.
func WithGrpcErrorLogging ¶
func WithGrpcErrorLogging(log logr.Logger) runtime.ServeMuxOption
WithGrpcErrorLogging logs errors returned from server RPC handlers. Our errors happen in gRPC land, so we cannot introspect into the content of the error message in the WithLogging http.Handler. Normal gRPC middleware was not working for this: https://github.com/grpc-ecosystem/grpc-gateway/issues/1043
func WithLogging ¶
WithLogging adds basic logging for HTTP requests. Note that this accepts a grpc-gateway ServeMux instead of an http.Handler.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.