Fix lint errors after merging AllowedHeaders feature (#3247)

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
Maksim Nabokikh
2023-12-28 11:41:57 +01:00
committed by GitHub
parent 366e53c1b6
commit 4f307d70c6
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ type Web struct {
TLSCert string `json:"tlsCert"`
TLSKey string `json:"tlsKey"`
AllowedOrigins []string `json:"allowedOrigins"`
AllowedHeaders []string `json:"allowedHeaders"`
AllowedHeaders []string `json:"allowedHeaders"`
}
// Telemetry is the config format for telemetry including the HTTP server config.
+1 -1
View File
@@ -265,7 +265,7 @@ func runServe(options serveOptions) error {
AlwaysShowLoginScreen: c.OAuth2.AlwaysShowLoginScreen,
PasswordConnector: c.OAuth2.PasswordConnector,
AllowedOrigins: c.Web.AllowedOrigins,
AllowedHeaders: c.Web.AllowedHeaders,
AllowedHeaders: c.Web.AllowedHeaders,
Issuer: c.Issuer,
Storage: s,
Web: c.Frontend,
+5 -5
View File
@@ -77,8 +77,8 @@ type Config struct {
// domain.
AllowedOrigins []string
// List of allowed headers for CORS requests on discovery, token, and keys endpoint.
AllowedHeaders []string
// List of allowed headers for CORS requests on discovery, token, and keys endpoint.
AllowedHeaders []string
// If enabled, the server won't prompt the user to approve authorization requests.
// Logging in implies approval.
@@ -217,9 +217,9 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
if len(c.SupportedResponseTypes) == 0 {
c.SupportedResponseTypes = []string{responseTypeCode}
}
if len(c.AllowedHeaders) == 0 {
c.AllowedHeaders = []string{"Authorization"}
}
if len(c.AllowedHeaders) == 0 {
c.AllowedHeaders = []string{"Authorization"}
}
allSupportedGrants := map[string]bool{
grantTypeAuthorizationCode: true,