Documentation ¶
Overview ¶
Pacakge proxy provides a reverse proxy for talking to Apple DEP APIs based on the standard Go reverse proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(transport http.RoundTripper, store client.ConfigRetriever, logger log.Logger) *httputil.ReverseProxy
New creates new NanoDEP ReverseProxy. It dispatches requests using transport which should be a NanoDEP RoundTripper transport (which handles authentication and session management). DEP name configurations are retrieved using store and logger is used for logging.
func ProxyDEPNameHandler ¶
func ProxyDEPNameHandler(p *httputil.ReverseProxy, logger log.Logger) http.HandlerFunc
ProxyDEPNameHandler tries to extract the DEP name from the request URL path and replaces it with the just the endpoint and embeds the name as a context value.
For example if the request URL path is "hello/world/" then "hello" is the DEP name and is set in the request context and "/world/" is then set in the HTTP request passed onto p.
Note the very beginning of the URL path is used as the DEP name. This necessitates stripping the URL prefix before using this handler. Note also that DEP names with a "/" or "%2F" are likely to cause issues as we naively search and cut by "/" in the path.
Types ¶
This section is empty.