Allow a whitelist of email addresses

This commit is contained in:
Jasper Lammens
2018-08-26 15:19:16 +02:00
committed by Thom Seddon
parent 36fffd2382
commit eaad0a9054
4 changed files with 32 additions and 1 deletions

View File

@ -141,6 +141,7 @@ func main() {
cookieSecret := flag.String("cookie-secret", "", "depreciated")
cookieSecure := flag.Bool("cookie-secure", true, "Use secure cookies")
domainList := flag.String("domain", "", "Comma separated list of email domains to allow")
emailWhitelist := flag.String("whitelist", "", "Comma separated list of emails to allow")
direct := flag.Bool("direct", false, "Run in direct mode (use own hostname as oppose to X-Forwarded-Host, used for testing/development)")
prompt := flag.String("prompt", "", "Space separated list of OpenID prompt options")
@ -182,6 +183,10 @@ func main() {
if *domainList != "" {
domain = strings.Split(*domainList, ",")
}
var whitelist []string
if *emailWhitelist != "" {
whitelist = strings.Split(*emailWhitelist, ",")
}
// Setup
fw = &ForwardAuth{
@ -215,6 +220,7 @@ func main() {
CookieSecure: *cookieSecure,
Domain: domain,
Whitelist: whitelist,
Direct: *direct,