Add header to upstream server for external authentication

This commit is contained in:
Manuel de Brito Fontes 2017-09-27 23:51:01 -03:00
parent 7d4cd1ba27
commit 8fc6101d3b
3 changed files with 4 additions and 37 deletions

View file

@ -22,7 +22,6 @@ import (
"encoding/json"
"fmt"
"net"
"net/url"
"os"
"os/exec"
"strconv"
@ -150,7 +149,6 @@ var (
"serverConfig": func(all config.TemplateConfig, server *ingress.Server) interface{} {
return struct{ First, Second interface{} }{all, server}
},
"buildAuthSignURL": buildAuthSignURL,
"isValidClientBodyBufferSize": isValidClientBodyBufferSize,
"buildForwardedFor": buildForwardedFor,
}
@ -567,22 +565,6 @@ func buildNextUpstream(input interface{}) string {
return strings.Join(nextUpstreamCodes, " ")
}
func buildAuthSignURL(input interface{}) string {
s, ok := input.(string)
if !ok {
glog.Errorf("expected an 'string' type but %T was returned", input)
return ""
}
u, _ := url.Parse(s)
q := u.Query()
if len(q) == 0 {
return fmt.Sprintf("%v?rd=$request_uri", s)
}
return fmt.Sprintf("%v&rd=$request_uri", s)
}
// buildRandomUUID return a random string to be used in the template
func buildRandomUUID() string {
s := uuid.New()