@@ -18,15 +18,16 @@ type SignatureData struct {
18// Options holds Configuration Options that can be set by Command Line Flag,
18// Options holds Configuration Options that can be set by Command Line Flag,
19// or Config File
19// or Config File
20type Options struct {
20type Options struct {
21− ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix"`
21+ ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix"`
22− PingPath string `flag:"ping-path" cfg:"ping_path"`
22+ PingPath string `flag:"ping-path" cfg:"ping_path"`
23− PingUserAgent string `flag:"ping-user-agent" cfg:"ping_user_agent"`
23+ PingUserAgent string `flag:"ping-user-agent" cfg:"ping_user_agent"`
24− ReadyPath string `flag:"ready-path" cfg:"ready_path"`
24+ ReadyPath string `flag:"ready-path" cfg:"ready_path"`
25− ReverseProxy bool `flag:"reverse-proxy" cfg:"reverse_proxy"`
25+ ReverseProxy bool `flag:"reverse-proxy" cfg:"reverse_proxy"`
26− RealClientIPHeader string `flag:"real-client-ip-header" cfg:"real_client_ip_header"`
26+ RealClientIPHeader string `flag:"real-client-ip-header" cfg:"real_client_ip_header"`
27− TrustedIPs []string `flag:"trusted-ip" cfg:"trusted_ips"`
27+ TrustedIPs []string `flag:"trusted-ip" cfg:"trusted_ips"`
28− ForceHTTPS bool `flag:"force-https" cfg:"force_https"`
28+ ForceHTTPS bool `flag:"force-https" cfg:"force_https"`
29− RawRedirectURL string `flag:"redirect-url" cfg:"redirect_url"`
29+ RawRedirectURL string `flag:"redirect-url" cfg:"redirect_url"`
30+ RelativeRedirectURL bool `flag:"relative-redirect-url" cfg:"relative_redirect_url"`
31 AuthenticatedEmailsFile string `flag:"authenticated-emails-file" cfg:"authenticated_emails_file"`
32 AuthenticatedEmailsFile string `flag:"authenticated-emails-file" cfg:"authenticated_emails_file"`
32 EmailDomains []string `flag:"email-domain" cfg:"email_domains"`
33 EmailDomains []string `flag:"email-domain" cfg:"email_domains"`
@@ -117,6 +118,7 @@ func NewFlagSet() *pflag.FlagSet {
117 flagSet.StringSlice("trusted-ip", []string{}, "list of IPs or CIDR ranges to allow to bypass authentication. WARNING: trusting by IP has inherent security flaws, read the configuration documentation for more information.")
118 flagSet.StringSlice("trusted-ip", []string{}, "list of IPs or CIDR ranges to allow to bypass authentication. WARNING: trusting by IP has inherent security flaws, read the configuration documentation for more information.")
118 flagSet.Bool("force-https", false, "force HTTPS redirect for HTTP requests")
119 flagSet.Bool("force-https", false, "force HTTPS redirect for HTTP requests")
119 flagSet.String("redirect-url", "", "the OAuth Redirect URL. ie: \"https://internalapp.yourcompany.com/oauth2/callback\"")
120 flagSet.String("redirect-url", "", "the OAuth Redirect URL. ie: \"https://internalapp.yourcompany.com/oauth2/callback\"")
121+ flagSet.Bool("relative-redirect-url", false, "allow relative OAuth Redirect URL.")
120 flagSet.StringSlice("skip-auth-regex", []string{}, "(DEPRECATED for --skip-auth-route) bypass authentication for requests path's that match (may be given multiple times)")
122 flagSet.StringSlice("skip-auth-regex", []string{}, "(DEPRECATED for --skip-auth-route) bypass authentication for requests path's that match (may be given multiple times)")
121 flagSet.StringSlice("skip-auth-route", []string{}, "bypass authentication for requests that match the method & path. Format: method=path_regex OR method!=path_regex. For all methods: path_regex OR !=path_regex")
123 flagSet.StringSlice("skip-auth-route", []string{}, "bypass authentication for requests that match the method & path. Format: method=path_regex OR method!=path_regex. For all methods: path_regex OR !=path_regex")
122 flagSet.StringSlice("api-route", []string{}, "return HTTP 401 instead of redirecting to authentication server if token is not valid. Format: path_regex")
124 flagSet.StringSlice("api-route", []string{}, "return HTTP 401 instead of redirecting to authentication server if token is not valid. Format: path_regex")