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

feat: improve openapi spec #3908

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions .schema/openapi/patches/oauth2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@
description: "Specify a time duration in milliseconds, seconds, minutes, hours."
type: string
pattern: "^([0-9]+(ns|us|ms|s|m|h))*$"
- op: replace
path: /components/schemas/oAuth2Client/properties/jwks
value:
"$ref": "#/components/schemas/jsonWebKeySet"
226 changes: 211 additions & 15 deletions internal/httpclient/api/openapi.yaml

Large diffs are not rendered by default.

18 changes: 4 additions & 14 deletions internal/httpclient/docs/OAuth2Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Name | Type | Description | Notes
**GrantTypes** | Pointer to **[]string** | | [optional]
**ImplicitGrantAccessTokenLifespan** | Pointer to **string** | Specify a time duration in milliseconds, seconds, minutes, hours. | [optional]
**ImplicitGrantIdTokenLifespan** | Pointer to **string** | Specify a time duration in milliseconds, seconds, minutes, hours. | [optional]
**Jwks** | Pointer to **interface{}** | OAuth 2.0 Client JSON Web Key Set Client's JSON Web Key Set [JWK] document, passed by value. The semantics of the jwks parameter are the same as the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client can use jwks_uri, it MUST NOT use jwks. One significant downside of jwks is that it does not enable key rotation (which jwks_uri does, as described in Section 10 of OpenID Connect Core 1.0 [OpenID.Core]). The jwks_uri and jwks parameters MUST NOT be used together. | [optional]
**Jwks** | Pointer to [**JsonWebKeySet**](JsonWebKeySet.md) | | [optional]
**JwksUri** | Pointer to **string** | OAuth 2.0 Client JSON Web Key Set URL URL for the Client's JSON Web Key Set [JWK] document. If the Client signs requests to the Server, it contains the signing key(s) the Server uses to validate signatures from the Client. The JWK Set MAY also contain the Client's encryption keys(s), which are used by the Server to encrypt responses to the Client. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. | [optional]
**JwtBearerGrantAccessTokenLifespan** | Pointer to **string** | Specify a time duration in milliseconds, seconds, minutes, hours. | [optional]
**LogoUri** | Pointer to **string** | OAuth 2.0 Client Logo URI A URL string referencing the client's logo. | [optional]
Expand Down Expand Up @@ -599,20 +599,20 @@ HasImplicitGrantIdTokenLifespan returns a boolean if a field has been set.

### GetJwks

`func (o *OAuth2Client) GetJwks() interface{}`
`func (o *OAuth2Client) GetJwks() JsonWebKeySet`

GetJwks returns the Jwks field if non-nil, zero value otherwise.

### GetJwksOk

`func (o *OAuth2Client) GetJwksOk() (*interface{}, bool)`
`func (o *OAuth2Client) GetJwksOk() (*JsonWebKeySet, bool)`

GetJwksOk returns a tuple with the Jwks field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetJwks

`func (o *OAuth2Client) SetJwks(v interface{})`
`func (o *OAuth2Client) SetJwks(v JsonWebKeySet)`

SetJwks sets Jwks field to given value.

Expand All @@ -622,16 +622,6 @@ SetJwks sets Jwks field to given value.

HasJwks returns a boolean if a field has been set.

### SetJwksNil

`func (o *OAuth2Client) SetJwksNil(b bool)`

SetJwksNil sets the value for Jwks to be an explicit nil

### UnsetJwks
`func (o *OAuth2Client) UnsetJwks()`

UnsetJwks ensures that no value is present for Jwks, not even an explicit nil
### GetJwksUri

`func (o *OAuth2Client) GetJwksUri() string`
Expand Down
52 changes: 52 additions & 0 deletions internal/httpclient/docs/OAuth2LogoutRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Challenge** | Pointer to **string** | Challenge is the identifier (\"logout challenge\") of the logout authentication request. It is used to identify the session. | [optional]
**Client** | Pointer to [**OAuth2Client**](OAuth2Client.md) | | [optional]
**ExpiresAt** | Pointer to **time.Time** | | [optional]
**RequestUrl** | Pointer to **string** | RequestURL is the original Logout URL requested. | [optional]
**RequestedAt** | Pointer to **time.Time** | | [optional]
**RpInitiated** | Pointer to **bool** | RPInitiated is set to true if the request was initiated by a Relying Party (RP), also known as an OAuth 2.0 Client. | [optional]
**Sid** | Pointer to **string** | SessionID is the login session ID that was requested to log out. | [optional]
**Subject** | Pointer to **string** | Subject is the user for whom the logout was request. | [optional]
Expand Down Expand Up @@ -80,6 +82,31 @@ SetClient sets Client field to given value.

HasClient returns a boolean if a field has been set.

### GetExpiresAt

`func (o *OAuth2LogoutRequest) GetExpiresAt() time.Time`

GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise.

### GetExpiresAtOk

`func (o *OAuth2LogoutRequest) GetExpiresAtOk() (*time.Time, bool)`

GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetExpiresAt

`func (o *OAuth2LogoutRequest) SetExpiresAt(v time.Time)`

SetExpiresAt sets ExpiresAt field to given value.

### HasExpiresAt

`func (o *OAuth2LogoutRequest) HasExpiresAt() bool`

HasExpiresAt returns a boolean if a field has been set.

### GetRequestUrl

`func (o *OAuth2LogoutRequest) GetRequestUrl() string`
Expand All @@ -105,6 +132,31 @@ SetRequestUrl sets RequestUrl field to given value.

HasRequestUrl returns a boolean if a field has been set.

### GetRequestedAt

`func (o *OAuth2LogoutRequest) GetRequestedAt() time.Time`

GetRequestedAt returns the RequestedAt field if non-nil, zero value otherwise.

### GetRequestedAtOk

`func (o *OAuth2LogoutRequest) GetRequestedAtOk() (*time.Time, bool)`

GetRequestedAtOk returns a tuple with the RequestedAt field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetRequestedAt

`func (o *OAuth2LogoutRequest) SetRequestedAt(v time.Time)`

SetRequestedAt sets RequestedAt field to given value.

### HasRequestedAt

`func (o *OAuth2LogoutRequest) HasRequestedAt() bool`

HasRequestedAt returns a boolean if a field has been set.

### GetRpInitiated

`func (o *OAuth2LogoutRequest) GetRpInitiated() bool`
Expand Down
30 changes: 14 additions & 16 deletions internal/httpclient/model_o_auth2_client.go

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

75 changes: 74 additions & 1 deletion internal/httpclient/model_o_auth2_logout_request.go

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

8 changes: 7 additions & 1 deletion spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@
"$ref": "#/components/schemas/NullDuration"
},
"jwks": {
"description": "OAuth 2.0 Client JSON Web Key Set\n\nClient's JSON Web Key Set [JWK] document, passed by value. The semantics of the jwks parameter are the same as\nthe jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter\nis intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for\ninstance, by native applications that might not have a location to host the contents of the JWK Set. If a Client\ncan use jwks_uri, it MUST NOT use jwks. One significant downside of jwks is that it does not enable key rotation\n(which jwks_uri does, as described in Section 10 of OpenID Connect Core 1.0 [OpenID.Core]). The jwks_uri and jwks\nparameters MUST NOT be used together."
"$ref": "#/components/schemas/jsonWebKeySet"
},
"jwks_uri": {
"description": "OAuth 2.0 Client JSON Web Key Set URL\n\nURL for the Client's JSON Web Key Set [JWK] document. If the Client signs requests to the Server, it contains\nthe signing key(s) the Server uses to validate signatures from the Client. The JWK Set MAY also contain the\nClient's encryption keys(s), which are used by the Server to encrypt responses to the Client. When both signing\nand encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced\nJWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both\nsignatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used\nto provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST\nmatch those in the certificate.",
Expand Down Expand Up @@ -1037,10 +1037,16 @@
"client": {
"$ref": "#/components/schemas/oAuth2Client"
},
"expires_at": {
"$ref": "#/components/schemas/nullTime"
},
"request_url": {
"description": "RequestURL is the original Logout URL requested.",
"type": "string"
},
"requested_at": {
"$ref": "#/components/schemas/nullTime"
},
"rp_initiated": {
"description": "RPInitiated is set to true if the request was initiated by a Relying Party (RP), also known as an OAuth 2.0 Client.",
"type": "boolean"
Expand Down
Loading
Loading