Skip to content

Commit

Permalink
Fix lint errors after merging AllowedHeaders feature (#3247)
Browse files Browse the repository at this point in the history
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
  • Loading branch information
nabokihms authored Dec 28, 2023
1 parent 366e53c commit 4f307d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/dex/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/dex/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4f307d7

Please sign in to comment.