Mark option to skip verified email check as insecure
This commit is contained in:
		
							parent
							
								
									018a25be04
								
							
						
					
					
						commit
						39b6a42d43
					
				
							
								
								
									
										72
									
								
								options.go
								
								
								
								
							
							
						
						
									
										72
									
								
								options.go
								
								
								
								
							|  | @ -79,18 +79,18 @@ type Options struct { | ||||||
| 
 | 
 | ||||||
| 	// These options allow for other providers besides Google, with
 | 	// These options allow for other providers besides Google, with
 | ||||||
| 	// potential overrides.
 | 	// potential overrides.
 | ||||||
| 	Provider                 string `flag:"provider" cfg:"provider" env:"OAUTH2_PROXY_PROVIDER"` | 	Provider                         string `flag:"provider" cfg:"provider" env:"OAUTH2_PROXY_PROVIDER"` | ||||||
| 	OIDCIssuerURL            string `flag:"oidc-issuer-url" cfg:"oidc_issuer_url" env:"OAUTH2_PROXY_OIDC_ISSUER_URL"` | 	OIDCIssuerURL                    string `flag:"oidc-issuer-url" cfg:"oidc_issuer_url" env:"OAUTH2_PROXY_OIDC_ISSUER_URL"` | ||||||
| 	OIDCAllowUnverifiedEmail bool   `flag:"oidc-allow-unverified-email" cfg:"oidc_allow_unverified_email" env:"OAUTH2_PROXY_OIDC_ALLOW_UNVERIFIED_EMAIL"` | 	InsecureOIDCAllowUnverifiedEmail bool   `flag:"insecure-oidc-allow-unverified-email" cfg:"insecure_oidc_allow_unverified_email" env:"OAUTH2_PROXY_INSECURE_OIDC_ALLOW_UNVERIFIED_EMAIL"` | ||||||
| 	SkipOIDCDiscovery        bool   `flag:"skip-oidc-discovery" cfg:"skip_oidc_discovery" env:"OAUTH2_SKIP_OIDC_DISCOVERY"` | 	SkipOIDCDiscovery                bool   `flag:"skip-oidc-discovery" cfg:"skip_oidc_discovery" env:"OAUTH2_SKIP_OIDC_DISCOVERY"` | ||||||
| 	OIDCJwksURL              string `flag:"oidc-jwks-url" cfg:"oidc_jwks_url" env:"OAUTH2_OIDC_JWKS_URL"` | 	OIDCJwksURL                      string `flag:"oidc-jwks-url" cfg:"oidc_jwks_url" env:"OAUTH2_OIDC_JWKS_URL"` | ||||||
| 	LoginURL                 string `flag:"login-url" cfg:"login_url" env:"OAUTH2_PROXY_LOGIN_URL"` | 	LoginURL                         string `flag:"login-url" cfg:"login_url" env:"OAUTH2_PROXY_LOGIN_URL"` | ||||||
| 	RedeemURL                string `flag:"redeem-url" cfg:"redeem_url" env:"OAUTH2_PROXY_REDEEM_URL"` | 	RedeemURL                        string `flag:"redeem-url" cfg:"redeem_url" env:"OAUTH2_PROXY_REDEEM_URL"` | ||||||
| 	ProfileURL               string `flag:"profile-url" cfg:"profile_url" env:"OAUTH2_PROXY_PROFILE_URL"` | 	ProfileURL                       string `flag:"profile-url" cfg:"profile_url" env:"OAUTH2_PROXY_PROFILE_URL"` | ||||||
| 	ProtectedResource        string `flag:"resource" cfg:"resource" env:"OAUTH2_PROXY_RESOURCE"` | 	ProtectedResource                string `flag:"resource" cfg:"resource" env:"OAUTH2_PROXY_RESOURCE"` | ||||||
| 	ValidateURL              string `flag:"validate-url" cfg:"validate_url" env:"OAUTH2_PROXY_VALIDATE_URL"` | 	ValidateURL                      string `flag:"validate-url" cfg:"validate_url" env:"OAUTH2_PROXY_VALIDATE_URL"` | ||||||
| 	Scope                    string `flag:"scope" cfg:"scope" env:"OAUTH2_PROXY_SCOPE"` | 	Scope                            string `flag:"scope" cfg:"scope" env:"OAUTH2_PROXY_SCOPE"` | ||||||
| 	ApprovalPrompt           string `flag:"approval-prompt" cfg:"approval_prompt" env:"OAUTH2_PROXY_APPROVAL_PROMPT"` | 	ApprovalPrompt                   string `flag:"approval-prompt" cfg:"approval_prompt" env:"OAUTH2_PROXY_APPROVAL_PROMPT"` | ||||||
| 
 | 
 | ||||||
| 	// Configuration values for logging
 | 	// Configuration values for logging
 | ||||||
| 	LoggingFilename       string `flag:"logging-filename" cfg:"logging_filename" env:"OAUTH2_LOGGING_FILENAME"` | 	LoggingFilename       string `flag:"logging-filename" cfg:"logging_filename" env:"OAUTH2_LOGGING_FILENAME"` | ||||||
|  | @ -148,29 +148,29 @@ func NewOptions() *Options { | ||||||
| 		SessionOptions: options.SessionOptions{ | 		SessionOptions: options.SessionOptions{ | ||||||
| 			Type: "cookie", | 			Type: "cookie", | ||||||
| 		}, | 		}, | ||||||
| 		SetXAuthRequest:          false, | 		SetXAuthRequest:                  false, | ||||||
| 		SkipAuthPreflight:        false, | 		SkipAuthPreflight:                false, | ||||||
| 		PassBasicAuth:            true, | 		PassBasicAuth:                    true, | ||||||
| 		PassUserHeaders:          true, | 		PassUserHeaders:                  true, | ||||||
| 		PassAccessToken:          false, | 		PassAccessToken:                  false, | ||||||
| 		PassHostHeader:           true, | 		PassHostHeader:                   true, | ||||||
| 		SetAuthorization:         false, | 		SetAuthorization:                 false, | ||||||
| 		PassAuthorization:        false, | 		PassAuthorization:                false, | ||||||
| 		ApprovalPrompt:           "force", | 		ApprovalPrompt:                   "force", | ||||||
| 		OIDCAllowUnverifiedEmail: false, | 		InsecureOIDCAllowUnverifiedEmail: false, | ||||||
| 		SkipOIDCDiscovery:        false, | 		SkipOIDCDiscovery:                false, | ||||||
| 		LoggingFilename:          "", | 		LoggingFilename:                  "", | ||||||
| 		LoggingMaxSize:           100, | 		LoggingMaxSize:                   100, | ||||||
| 		LoggingMaxAge:            7, | 		LoggingMaxAge:                    7, | ||||||
| 		LoggingMaxBackups:        0, | 		LoggingMaxBackups:                0, | ||||||
| 		LoggingLocalTime:         true, | 		LoggingLocalTime:                 true, | ||||||
| 		LoggingCompress:          false, | 		LoggingCompress:                  false, | ||||||
| 		StandardLogging:          true, | 		StandardLogging:                  true, | ||||||
| 		StandardLoggingFormat:    logger.DefaultStandardLoggingFormat, | 		StandardLoggingFormat:            logger.DefaultStandardLoggingFormat, | ||||||
| 		RequestLogging:           true, | 		RequestLogging:                   true, | ||||||
| 		RequestLoggingFormat:     logger.DefaultRequestLoggingFormat, | 		RequestLoggingFormat:             logger.DefaultRequestLoggingFormat, | ||||||
| 		AuthLogging:              true, | 		AuthLogging:                      true, | ||||||
| 		AuthLoggingFormat:        logger.DefaultAuthLoggingFormat, | 		AuthLoggingFormat:                logger.DefaultAuthLoggingFormat, | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -399,7 +399,7 @@ func parseProviderInfo(o *Options, msgs []string) []string { | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	case *providers.OIDCProvider: | 	case *providers.OIDCProvider: | ||||||
| 		p.AllowUnverifiedEmail = o.OIDCAllowUnverifiedEmail | 		p.AllowUnverifiedEmail = o.InsecureOIDCAllowUnverifiedEmail | ||||||
| 		if o.oidcVerifier == nil { | 		if o.oidcVerifier == nil { | ||||||
| 			msgs = append(msgs, "oidc provider requires an oidc issuer URL") | 			msgs = append(msgs, "oidc provider requires an oidc issuer URL") | ||||||
| 		} else { | 		} else { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue