Skip to content

Commit 367154d

Browse files
committed
fix: add client_id and client_secret to revokeOAuth2Token
1 parent d7a28e9 commit 367154d

File tree

6 files changed

+76
-6
lines changed

6 files changed

+76
-6
lines changed

internal/httpclient/api/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,12 +4136,24 @@ components:
41364136
type: object
41374137
revokeOAuth2Token_request:
41384138
properties:
4139+
client_id:
4140+
required:
4141+
- client_id
4142+
type: string
4143+
x-formData-name: client_id
4144+
client_secret:
4145+
required:
4146+
- client_secret
4147+
type: string
4148+
x-formData-name: client_secret
41394149
token:
41404150
required:
41414151
- token
41424152
type: string
41434153
x-formData-name: token
41444154
required:
4155+
- client_id
4156+
- client_secret
41454157
- token
41464158
type: object
41474159
oauth2TokenExchange_request:

internal/httpclient/api_o_auth2.go

Lines changed: 23 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/httpclient/docs/OAuth2Api.md

Lines changed: 6 additions & 2 deletions
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).ClientId(clientId).ClientSecret(clientSecret).Token(token).Execute()
16661666
16671667
Revoke OAuth 2.0 Access or Refresh Token
16681668

@@ -1681,11 +1681,13 @@ import (
16811681
)
16821682

16831683
func main() {
1684+
clientId := "clientId_example" // string |
1685+
clientSecret := "clientSecret_example" // string |
16841686
token := "token_example" // string |
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()).ClientId(clientId).ClientSecret(clientSecret).Token(token).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)
@@ -1704,6 +1706,8 @@ Other parameters are passed through a pointer to a apiRevokeOAuth2TokenRequest s
17041706

17051707
Name | Type | Description | Notes
17061708
------------- | ------------- | ------------- | -------------
1709+
**clientId** | **string** | |
1710+
**clientSecret** | **string** | |
17071711
**token** | **string** | |
17081712

17091713
### Return type

oauth2/handler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,12 @@ type revokeOAuth2Token struct {
614614
// in: formData
615615
// required: true
616616
Token string `json:"token"`
617+
// in: formData
618+
// required: true
619+
ClientID string `json:"client_id"`
620+
// in: formData
621+
// required: true
622+
ClientSecret string `json:"client_secret"`
617623
}
618624

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

spec/api.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3419,6 +3419,20 @@
34193419
"application/x-www-form-urlencoded": {
34203420
"schema": {
34213421
"properties": {
3422+
"client_id": {
3423+
"required": [
3424+
"client_id"
3425+
],
3426+
"type": "string",
3427+
"x-formData-name": "client_id"
3428+
},
3429+
"client_secret": {
3430+
"required": [
3431+
"client_secret"
3432+
],
3433+
"type": "string",
3434+
"x-formData-name": "client_secret"
3435+
},
34223436
"token": {
34233437
"required": [
34243438
"token"
@@ -3428,7 +3442,9 @@
34283442
}
34293443
},
34303444
"required": [
3431-
"token"
3445+
"token",
3446+
"client_id",
3447+
"client_secret"
34323448
],
34333449
"type": "object"
34343450
}

spec/swagger.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,18 @@
18701870
"name": "token",
18711871
"in": "formData",
18721872
"required": true
1873+
},
1874+
{
1875+
"type": "string",
1876+
"name": "client_id",
1877+
"in": "formData",
1878+
"required": true
1879+
},
1880+
{
1881+
"type": "string",
1882+
"name": "client_secret",
1883+
"in": "formData",
1884+
"required": true
18731885
}
18741886
],
18751887
"responses": {

0 commit comments

Comments
 (0)