Skip to content

Commit

Permalink
fix: mark client_id and client_secret as required
Browse files Browse the repository at this point in the history
Closes #3261
  • Loading branch information
aeneasr committed Mar 16, 2023
1 parent 4f65365 commit fe0caab
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 20 deletions.
6 changes: 6 additions & 0 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4155,9 +4155,13 @@ components:
revokeOAuth2Token_request:
properties:
client_id:
required:
- client_id
type: string
x-formData-name: client_id
client_secret:
required:
- client_secret
type: string
x-formData-name: client_secret
token:
Expand All @@ -4166,6 +4170,8 @@ components:
type: string
x-formData-name: token
required:
- client_id
- client_secret
- token
type: object
oauth2TokenExchange_request:
Expand Down
26 changes: 14 additions & 12 deletions internal/httpclient/api_o_auth2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions internal/httpclient/docs/OAuth2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ No authorization required

## RevokeOAuth2Token

> RevokeOAuth2Token(ctx).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute()
> RevokeOAuth2Token(ctx).ClientId(clientId).ClientSecret(clientSecret).Token(token).Execute()
Revoke OAuth 2.0 Access or Refresh Token

Expand All @@ -1683,13 +1683,13 @@ import (
)

func main() {
clientId := "clientId_example" // string |
clientSecret := "clientSecret_example" // string |
token := "token_example" // string |
clientId := "clientId_example" // string | (optional)
clientSecret := "clientSecret_example" // string | (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute()
resp, r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).ClientId(clientId).ClientSecret(clientSecret).Token(token).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2Token``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -1708,9 +1708,9 @@ Other parameters are passed through a pointer to a apiRevokeOAuth2TokenRequest s

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**token** | **string** | |
**clientId** | **string** | |
**clientSecret** | **string** | |
**token** | **string** | |

### Return type

Expand Down
2 changes: 2 additions & 0 deletions oauth2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,10 @@ type revokeOAuth2Token struct {
// required: true
Token string `json:"token"`
// in: formData
// required: true
ClientID string `json:"client_id"`
// in: formData
// required: true
ClientSecret string `json:"client_secret"`
}

Expand Down
10 changes: 9 additions & 1 deletion spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3432,10 +3432,16 @@
"schema": {
"properties": {
"client_id": {
"required": [
"client_id"
],
"type": "string",
"x-formData-name": "client_id"
},
"client_secret": {
"required": [
"client_secret"
],
"type": "string",
"x-formData-name": "client_secret"
},
Expand All @@ -3448,7 +3454,9 @@
}
},
"required": [
"token"
"token",
"client_id",
"client_secret"
],
"type": "object"
}
Expand Down
6 changes: 4 additions & 2 deletions spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1880,12 +1880,14 @@
{
"type": "string",
"name": "client_id",
"in": "formData"
"in": "formData",
"required": true
},
{
"type": "string",
"name": "client_secret",
"in": "formData"
"in": "formData",
"required": true
}
],
"responses": {
Expand Down

0 comments on commit fe0caab

Please sign in to comment.