proxy: support external access control requests (#324)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2019-10-03 21:22:44 -07:00 committed by GitHub
parent 7abcf650e5
commit eaa1e7a4fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 730 additions and 133 deletions

View file

@ -173,6 +173,11 @@ func (p *Proxy) UpdatePolicies(opts *config.Options) error {
r.HandleFunc("/robots.txt", p.RobotsTxt).Methods(http.MethodGet)
r = p.registerHelperHandlers(r)
if opts.ForwardAuthURL != nil {
// create a route to handle forward auth requests
r.Host(opts.ForwardAuthURL.Host).Subrouter().PathPrefix("/")
}
for _, policy := range opts.Policies {
if err := policy.Validate(); err != nil {
return fmt.Errorf("proxy: invalid policy %s", err)