Browse Source

Apply suggestions from code review

Signed-off-by: Maksim Nabokikh <max.nabokih@gmail.com>
pull/4583/head
Maksim Nabokikh 3 weeks ago committed by GitHub
parent
commit
ed0b5e5319
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      pkg/featureflags/set.go
  2. 2
      server/handlers.go

2
pkg/featureflags/set.go

@ -18,7 +18,7 @@ var (
// ConfigDisallowUnknownFields enables to forbid unknown fields in the config while unmarshaling.
ConfigDisallowUnknownFields = newFlag("config_disallow_unknown_fields", false)
// ClientCredentialGrantEnabledByDefault enables the client_credentials grant type by default
// ClientCredentialGrantEnabledByDefault enables the client_credentials grant type by default
// without requiring explicit configuration in oauth2.grantTypes.
ClientCredentialGrantEnabledByDefault = newFlag("client_credential_grant_enabled_by_default", false)
)

2
server/handlers.go

@ -1540,6 +1540,8 @@ func (s *Server) handleClientCredentialsGrant(w http.ResponseWriter, r *http.Req
nonce := r.Form.Get("nonce")
// Empty connector ID is unique for cluster credentials grant
// Creating connectors with an empty ID with the config and API is prohibited
connID := ""
accessToken, expiry, err := s.newAccessToken(ctx, client.ID, claims, scopes, nonce, connID)

Loading…
Cancel
Save