Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // JwtCheckExp will determine if we need to verify if the token is expired or not JwtCheckExp = true // JwtIssuer is the url where we can retrieve a set of public keys to verify rsa based tokens with JwtIssuer = "http://localhost/.well-known/jwks.json" // JwtOutboundHeader is the name of header the parsed token claims will be inserted into JwtOutboundHeader = "X-JWT-PAYLOAD" // AllowBasicAuthPassThrough will allow requests with a basic auth authorization header to be passed through AllowBasicAuthPassThrough = false // AllowBasicAuthHeaders specifies the header to extract the basic auth request from AllowBasicAuthHeaders = []string{"Authorization"} // AllowBasicAuthPathRegex allows us to only allow a basic auth pass through for requests with a certain path AllowBasicAuthPathRegex = regexp.MustCompile(`^\/.*`) // NewErrorMessageRegex is used to apply new error structure only to specific endpoints (see bcab0f12220b1e26c6dad10ee6aa1825172051ab). This is for backward compatibility. NewErrorMessageRegex = regexp.MustCompile(`^\/.*`) // BasicAuthRegex is for checking if a basic auth request is formatted correctly BasicAuthRegex = regexp.MustCompile(`^Basic\ .*`) )
Functions ¶
This section is empty.
Types ¶
type ErrorMsg ¶ added in v0.4.0
type ErrorMsg struct { StatusCode int `json:"status_code,omitempty"` Errors []Error `json:"errors"` }
ErrorMsg is returned on unauthorized requests
type Server ¶
type Server struct { Issuer string JwkSet jose.JSONWebKeySet }
Server needs to know about the Issuer url to verify tokens against
func (*Server) DecodeHTTPHandler ¶
func (server *Server) DecodeHTTPHandler(w http.ResponseWriter, r *http.Request)
DecodeHTTPHandler will try to extract the bearer token found in the Authorization header of each request and verify it
Click to show internal directories.
Click to hide internal directories.