Skip to content

Commit

Permalink
fix: add client_id and client_secret to revokeOAuth2Token (#3373)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Dec 1, 2022
1 parent 3831b44 commit 93bac07
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 5 deletions.
6 changes: 6 additions & 0 deletions internal/httpclient/api/openapi.yaml
Expand Up @@ -4136,6 +4136,12 @@ components:
type: object
revokeOAuth2Token_request:
properties:
client_id:
type: string
x-formData-name: client_id
client_secret:
type: string
x-formData-name: client_secret
token:
required:
- token
Expand Down
24 changes: 21 additions & 3 deletions internal/httpclient/api_o_auth2.go

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

8 changes: 6 additions & 2 deletions internal/httpclient/docs/OAuth2Api.md
Expand Up @@ -1662,7 +1662,7 @@ No authorization required

## RevokeOAuth2Token

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

Expand All @@ -1682,10 +1682,12 @@ import (

func main() {
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).Execute()
resp, r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).Token(token).ClientId(clientId).ClientSecret(clientSecret).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 @@ -1705,6 +1707,8 @@ Other parameters are passed through a pointer to a apiRevokeOAuth2TokenRequest s
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**token** | **string** | |
**clientId** | **string** | |
**clientSecret** | **string** | |

### Return type

Expand Down
4 changes: 4 additions & 0 deletions oauth2/handler.go
Expand Up @@ -614,6 +614,10 @@ type revokeOAuth2Token struct {
// in: formData
// required: true
Token string `json:"token"`
// in: formData
ClientID string `json:"client_id"`
// in: formData
ClientSecret string `json:"client_secret"`
}

// swagger:route POST /oauth2/revoke oAuth2 revokeOAuth2Token
Expand Down
8 changes: 8 additions & 0 deletions spec/api.json
Expand Up @@ -3419,6 +3419,14 @@
"application/x-www-form-urlencoded": {
"schema": {
"properties": {
"client_id": {
"type": "string",
"x-formData-name": "client_id"
},
"client_secret": {
"type": "string",
"x-formData-name": "client_secret"
},
"token": {
"required": [
"token"
Expand Down
10 changes: 10 additions & 0 deletions spec/swagger.json
Expand Up @@ -1870,6 +1870,16 @@
"name": "token",
"in": "formData",
"required": true
},
{
"type": "string",
"name": "client_id",
"in": "formData"
},
{
"type": "string",
"name": "client_secret",
"in": "formData"
}
],
"responses": {
Expand Down

0 comments on commit 93bac07

Please sign in to comment.