Documentation
¶
Index ¶
- func APIKeyAuthMiddleware(validator func(apiKey string) bool, apiKeys ...string) func(handler http.Handler) http.Handler
- func BasicAuthMiddleware(basicAuthProvider BasicAuthProvider) func(handler http.Handler) http.Handler
- func CORS() func(inner http.Handler) http.Handler
- func Logging(logger logger) func(inner http.Handler) http.Handler
- func Metrics(metrics metrics) func(inner http.Handler) http.Handler
- func OAuth(key PublicKeyProvider) func(inner http.Handler) http.Handler
- func Tracer(inner http.Handler) http.Handler
- type BasicAuthProvider
- type JSONWebKey
- type JWKNotFound
- type JWKS
- type JWKSProvider
- type JWTClaim
- type OauthConfigs
- type PublicKeyProvider
- type PublicKeys
- type RequestLog
- type StatusResponseWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIKeyAuthMiddleware ¶ added in v1.1.1
func BasicAuthMiddleware ¶ added in v1.1.1
func BasicAuthMiddleware(basicAuthProvider BasicAuthProvider) func(handler http.Handler) http.Handler
func Logging ¶
Logging is a middleware which logs response status and time in microseconds along with other data.
Types ¶
type BasicAuthProvider ¶ added in v1.1.1
type JSONWebKey ¶ added in v1.1.1
type JWKNotFound ¶ added in v1.1.1
type JWKNotFound struct { }
func (JWKNotFound) Error ¶ added in v1.1.1
func (i JWKNotFound) Error() string
type JWKS ¶ added in v1.1.1
type JWKS struct {
Keys []JSONWebKey `json:"keys"`
}
JWKS represents a JSON Web Key Set.
type JWKSProvider ¶ added in v1.1.1
type OauthConfigs ¶ added in v1.1.1
type OauthConfigs struct { Provider JWKSProvider RefreshInterval time.Duration }
type PublicKeyProvider ¶ added in v1.1.1
func NewOAuth ¶ added in v1.1.1
func NewOAuth(config OauthConfigs) PublicKeyProvider
type PublicKeys ¶ added in v1.1.1
type PublicKeys struct {
// contains filtered or unexported fields
}
type RequestLog ¶
type RequestLog struct { TraceID string `json:"trace_id,omitempty"` SpanID string `json:"span_id,omitempty"` StartTime string `json:"start_time,omitempty"` ResponseTime int64 `json:"response_time,omitempty"` Method string `json:"method,omitempty"` UserAgent string `json:"user_agent,omitempty"` IP string `json:"ip,omitempty"` URI string `json:"uri,omitempty"` Response int `json:"response,omitempty"` }
type StatusResponseWriter ¶
type StatusResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
StatusResponseWriter Defines own Response Writer to be used for logging of status - as http.ResponseWriter does not let us read status.
func (*StatusResponseWriter) WriteHeader ¶
func (w *StatusResponseWriter) WriteHeader(status int)
Click to show internal directories.
Click to hide internal directories.