Documentation
¶
Index ¶
- Variables
- func CheckCookie(key Key) func(http.Handler) http.Handler
- func CheckHeader(key Key) func(http.Handler) http.Handler
- func CheckIdentity(handle func(http.ResponseWriter, *http.Request)) http.HandlerFunc
- func ControllerHandler(controllerHandlerFunc ControllerHandlerFunc) http.HandlerFunc
- func DoCheckCookie(h http.Handler, key Key) http.Handler
- func DoCheckHeader(h http.Handler, key Key) http.Handler
- func GetFlorenceToken(ctx context.Context, req *http.Request) (string, error)
- func Identity(zebedeeURL string) func(http.Handler) http.Handler
- func IdentityWithHTTPClient(cli *clientsidentity.Client) func(http.Handler) http.Handler
- type ControllerHandlerFunc
- type Key
- type KeyMap
Constants ¶
This section is empty.
Variables ¶
var KeyMaps = map[Key]*KeyMap{ UserAccess: { Header: request.FlorenceHeaderKey, Cookie: request.FlorenceCookieKey, Context: request.FlorenceIdentityKey, }, Locale: { Header: request.LocaleHeaderKey, Cookie: request.LocaleCookieKey, Context: request.LocaleContextKey, }, CollectionID: { Header: request.CollectionIDHeaderKey, Cookie: request.CollectionIDCookieKey, Context: request.CollectionIDContextKey, }, }
KeyMaps maps the possible values of Key enumeration to their Header, Cookie and Context correspnding keys
Functions ¶
func CheckCookie ¶
CheckCookie is a wrapper which adds a cookie value (if found) to the request context. This function complies with alice middleware Constructor type: func(http.Handler) -> (http.Handler))
func CheckHeader ¶
CheckHeader is a wrapper which adds a value from the request header (if found) to the request context. This function complies with alice middleware Constructor type: func(http.Handler) -> (http.Handler)
func CheckIdentity ¶
func CheckIdentity(handle func(http.ResponseWriter, *http.Request)) http.HandlerFunc
CheckIdentity wraps a HTTP handler function. It validates that the request context contains a Caller, snf only calls the provided HTTP handler if the Caller is available, else it returns an error code and drains the http body
func ControllerHandler ¶
func ControllerHandler(controllerHandlerFunc ControllerHandlerFunc) http.HandlerFunc
ControllerHandler is a middleware handler that ensures all required logical arguments are being passed along and then returns a generic http.HandlerFunc
func DoCheckCookie ¶
DoCheckCookie returns a handler that performs the CheckCookie logic
func DoCheckHeader ¶
DoCheckHeader returns a handler that performs the CheckHeader logic
func GetFlorenceToken ¶
func IdentityWithHTTPClient ¶
IdentityWithHTTPClient allows a handler to be created that uses the given identity client
Types ¶
type ControllerHandlerFunc ¶
type ControllerHandlerFunc func(w http.ResponseWriter, r *http.Request, lang, collectionID, accessToken string)
ControllerHandlerFunc is a function type that accepts arguments required for logical flow in handlers Implementation of function should set headers as needed