Skip to content

Commit fe0caab

Browse files
committed
fix: mark client_id and client_secret as required
Closes #3261
1 parent 4f65365 commit fe0caab

File tree

6 files changed

+40
-20
lines changed

6 files changed

+40
-20
lines changed

internal/httpclient/api/openapi.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -4155,9 +4155,13 @@ components:
41554155
revokeOAuth2Token_request:
41564156
properties:
41574157
client_id:
4158+
required:
4159+
- client_id
41584160
type: string
41594161
x-formData-name: client_id
41604162
client_secret:
4163+
required:
4164+
- client_secret
41614165
type: string
41624166
x-formData-name: client_secret
41634167
token:
@@ -4166,6 +4170,8 @@ components:
41664170
type: string
41674171
x-formData-name: token
41684172
required:
4173+
- client_id
4174+
- client_secret
41694175
- token
41704176
type: object
41714177
oauth2TokenExchange_request:

internal/httpclient/api_o_auth2.go

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

internal/httpclient/docs/OAuth2Api.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ No authorization required
16641664

16651665
## RevokeOAuth2Token
16661666

1667-
> RevokeOAuth2Token(ctx).Token(token).ClientId(clientId).ClientSecret(clientSecret).Execute()
1667+
> RevokeOAuth2Token(ctx).ClientId(clientId).ClientSecret(clientSecret).Token(token).Execute()
16681668
16691669
Revoke OAuth 2.0 Access or Refresh Token
16701670

@@ -1683,13 +1683,13 @@ import (
16831683
)
16841684

16851685
func main() {
1686+
clientId := "clientId_example" // string |
1687+
clientSecret := "clientSecret_example" // string |
16861688
token := "token_example" // string |
1687-
clientId := "clientId_example" // string | (optional)
1688-
clientSecret := "clientSecret_example" // string | (optional)
16891689

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

17091709
Name | Type | Description | Notes
17101710
------------- | ------------- | ------------- | -------------
1711-
**token** | **string** | |
17121711
**clientId** | **string** | |
17131712
**clientSecret** | **string** | |
1713+
**token** | **string** | |
17141714

17151715
### Return type
17161716

oauth2/handler.go

+2
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,10 @@ type revokeOAuth2Token struct {
630630
// required: true
631631
Token string `json:"token"`
632632
// in: formData
633+
// required: true
633634
ClientID string `json:"client_id"`
634635
// in: formData
636+
// required: true
635637
ClientSecret string `json:"client_secret"`
636638
}
637639

spec/api.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -3432,10 +3432,16 @@
34323432
"schema": {
34333433
"properties": {
34343434
"client_id": {
3435+
"required": [
3436+
"client_id"
3437+
],
34353438
"type": "string",
34363439
"x-formData-name": "client_id"
34373440
},
34383441
"client_secret": {
3442+
"required": [
3443+
"client_secret"
3444+
],
34393445
"type": "string",
34403446
"x-formData-name": "client_secret"
34413447
},
@@ -3448,7 +3454,9 @@
34483454
}
34493455
},
34503456
"required": [
3451-
"token"
3457+
"token",
3458+
"client_id",
3459+
"client_secret"
34523460
],
34533461
"type": "object"
34543462
}

spec/swagger.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1880,12 +1880,14 @@
18801880
{
18811881
"type": "string",
18821882
"name": "client_id",
1883-
"in": "formData"
1883+
"in": "formData",
1884+
"required": true
18841885
},
18851886
{
18861887
"type": "string",
18871888
"name": "client_secret",
1888-
"in": "formData"
1889+
"in": "formData",
1890+
"required": true
18891891
}
18901892
],
18911893
"responses": {

0 commit comments

Comments
 (0)