Skip to content

Commit

Permalink
Make upstream oauth flow client secret omitempty
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffy-mathew committed Nov 18, 2024
1 parent f0fcb3f commit dac0cee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apidef/api_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ type ClientAuthData struct {
// ClientID is the application's ID.
ClientID string `bson:"client_id" json:"client_id"`
// ClientSecret is the application's secret.
ClientSecret string `bson:"client_secret" json:"client_secret"`
ClientSecret string `bson:"client_secret,omitempty" json:"client_secret,omitempty"` // client secret is optional for password flow
}

// ClientCredentials holds the client credentials for upstream OAuth2 authentication.
Expand Down
2 changes: 1 addition & 1 deletion apidef/oas/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ type ClientAuthData struct {
// ClientID is the application's ID.
ClientID string `bson:"clientId" json:"clientId"`
// ClientSecret is the application's secret.
ClientSecret string `bson:"clientSecret" json:"clientSecret"`
ClientSecret string `bson:"clientSecret,omitempty" json:"clientSecret,omitempty"` // client secret is optional for password flow
}

// ClientCredentials holds the configuration for OAuth2 Client Credentials flow.
Expand Down
1 change: 0 additions & 1 deletion apidef/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,6 @@ const Schema = `{
},
"required": [
"client_id",
"client_secret",
"token_url",
"username",
"password"
Expand Down

0 comments on commit dac0cee

Please sign in to comment.