Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add client_id and client_secret to revokeOAuth2Token #3373

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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