Skip to content

Commit 93bac07

Browse files
authored
fix: add client_id and client_secret to revokeOAuth2Token (#3373)
1 parent 3831b44 commit 93bac07

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

internal/httpclient/api/openapi.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -4136,6 +4136,12 @@ components:
41364136
type: object
41374137
revokeOAuth2Token_request:
41384138
properties:
4139+
client_id:
4140+
type: string
4141+
x-formData-name: client_id
4142+
client_secret:
4143+
type: string
4144+
x-formData-name: client_secret
41394145
token:
41404146
required:
41414147
- token

internal/httpclient/api_o_auth2.go

+21-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/httpclient/docs/OAuth2Api.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ No authorization required
16621662

16631663
## RevokeOAuth2Token
16641664

1665-
> RevokeOAuth2Token(ctx).Token(token).Execute()
1665+
> RevokeOAuth2Token(ctx).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute()
16661666
16671667
Revoke OAuth 2.0 Access or Refresh Token
16681668

@@ -1682,10 +1682,12 @@ import (
16821682

16831683
func main() {
16841684
token := "token_example" // string |
1685+
clientId := "clientId_example" // string | (optional)
1686+
clientSecret := "clientSecret_example" // string | (optional)
16851687

16861688
configuration := openapiclient.NewConfiguration()
16871689
apiClient := openapiclient.NewAPIClient(configuration)
1688-
resp, r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).Token(token).Execute()
1690+
resp, r, err := apiClient.OAuth2Api.RevokeOAuth2Token(context.Background()).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute()
16891691
if err != nil {
16901692
fmt.Fprintf(os.Stderr, "Error when calling `OAuth2Api.RevokeOAuth2Token``: %v\n", err)
16911693
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
@@ -1705,6 +1707,8 @@ Other parameters are passed through a pointer to a apiRevokeOAuth2TokenRequest s
17051707
Name | Type | Description | Notes
17061708
------------- | ------------- | ------------- | -------------
17071709
**token** | **string** | |
1710+
**clientId** | **string** | |
1711+
**clientSecret** | **string** | |
17081712

17091713
### Return type
17101714

oauth2/handler.go

+4
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,10 @@ type revokeOAuth2Token struct {
614614
// in: formData
615615
// required: true
616616
Token string `json:"token"`
617+
// in: formData
618+
ClientID string `json:"client_id"`
619+
// in: formData
620+
ClientSecret string `json:"client_secret"`
617621
}
618622

619623
// swagger:route POST /oauth2/revoke oAuth2 revokeOAuth2Token

spec/api.json

+8
Original file line numberDiff line numberDiff line change
@@ -3419,6 +3419,14 @@
34193419
"application/x-www-form-urlencoded": {
34203420
"schema": {
34213421
"properties": {
3422+
"client_id": {
3423+
"type": "string",
3424+
"x-formData-name": "client_id"
3425+
},
3426+
"client_secret": {
3427+
"type": "string",
3428+
"x-formData-name": "client_secret"
3429+
},
34223430
"token": {
34233431
"required": [
34243432
"token"

spec/swagger.json

+10
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,16 @@
18701870
"name": "token",
18711871
"in": "formData",
18721872
"required": true
1873+
},
1874+
{
1875+
"type": "string",
1876+
"name": "client_id",
1877+
"in": "formData"
1878+
},
1879+
{
1880+
"type": "string",
1881+
"name": "client_secret",
1882+
"in": "formData"
18731883
}
18741884
],
18751885
"responses": {

0 commit comments

Comments
 (0)