Preserve order of securitySchemes (#14536)

* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
This commit is contained in:
Beppe Catanese
2023-02-10 15:20:19 +01:00
committed by GitHub
parent 1b60ee1799
commit 68b944e6e6
308 changed files with 4019 additions and 4014 deletions

View File

@@ -357,6 +357,16 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## api_key
- **Type**: API key
@@ -371,30 +381,20 @@ Class | Method | HTTP request | Description
- **Location**: URL query string
## bearer_test
- **Type**: Bearer authentication (JWT)
## http_basic_test
- **Type**: HTTP basic authentication
## bearer_test
- **Type**: Bearer authentication (JWT)
Authentication schemes defined for the API:
## http_signature_test
- **Type**: HTTP signature authentication
Authentication schemes defined for the API:
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## Author

View File

@@ -42,6 +42,12 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
@@ -101,12 +107,6 @@ configuration = petstore_api.Configuration(
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
@@ -188,7 +188,7 @@ headers | Unset | headers were not defined |
### Authorization
[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth)
[petstore_auth](../../../README.md#petstore_auth), [http_signature_test](../../../README.md#http_signature_test)
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
@@ -342,6 +342,12 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
@@ -401,12 +407,6 @@ configuration = petstore_api.Configuration(
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
@@ -505,7 +505,7 @@ headers | Unset | headers were not defined |
### Authorization
[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth)
[petstore_auth](../../../README.md#petstore_auth), [http_signature_test](../../../README.md#http_signature_test)
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
@@ -536,6 +536,12 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
@@ -595,12 +601,6 @@ configuration = petstore_api.Configuration(
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
@@ -699,7 +699,7 @@ headers | Unset | headers were not defined |
### Authorization
[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth)
[petstore_auth](../../../README.md#petstore_auth), [http_signature_test](../../../README.md#http_signature_test)
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
@@ -850,6 +850,12 @@ configuration = petstore_api.Configuration(
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
@@ -909,12 +915,6 @@ configuration = petstore_api.Configuration(
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Configure OAuth2 access token for authorization: petstore_auth
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
access_token = 'YOUR_ACCESS_TOKEN'
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
@@ -1004,7 +1004,7 @@ headers | Unset | headers were not defined |
### Authorization
[http_signature_test](../../../README.md#http_signature_test), [petstore_auth](../../../README.md#petstore_auth)
[petstore_auth](../../../README.md#petstore_auth), [http_signature_test](../../../README.md#http_signature_test)
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)

View File

@@ -460,6 +460,13 @@ conf = petstore_api.Configuration(
:return: The Auth Settings information dict.
"""
auth = {}
if self.access_token is not None:
auth['petstore_auth'] = {
'type': 'oauth2',
'in': 'header',
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
if 'api_key' in self.api_key:
auth['api_key'] = {
'type': 'api_key',
@@ -478,6 +485,13 @@ conf = petstore_api.Configuration(
'api_key_query',
),
}
if self.username is not None and self.password is not None:
auth['http_basic_test'] = {
'type': 'basic',
'in': 'header',
'key': 'Authorization',
'value': self.get_basic_auth_token()
}
if self.access_token is not None:
auth['bearer_test'] = {
'type': 'bearer',
@@ -486,13 +500,6 @@ conf = petstore_api.Configuration(
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
if self.username is not None and self.password is not None:
auth['http_basic_test'] = {
'type': 'basic',
'in': 'header',
'key': 'Authorization',
'value': self.get_basic_auth_token()
}
if self.signing_info is not None:
auth['http_signature_test'] = {
'type': 'http-signature',
@@ -500,13 +507,6 @@ conf = petstore_api.Configuration(
'key': 'Authorization',
'value': None # Signature headers are calculated for every HTTP request
}
if self.access_token is not None:
auth['petstore_auth'] = {
'type': 'oauth2',
'in': 'header',
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
return auth
def to_debug_report(self):

View File

@@ -44,8 +44,8 @@ request_body_pet = api_client.RequestBody(
required=True,
)
_auth = [
'http_signature_test',
'petstore_auth',
'http_signature_test',
]
_servers = (
{

View File

@@ -44,8 +44,8 @@ request_body_pet = api_client.RequestBody(
required=True,
)
_auth = [
'http_signature_test',
'petstore_auth',
'http_signature_test',
]
_servers = (
{

View File

@@ -103,8 +103,8 @@ request_query_status = api_client.QueryParameter(
required=True,
)
_auth = [
'http_signature_test',
'petstore_auth',
'http_signature_test',
]

View File

@@ -78,8 +78,8 @@ request_query_tags = api_client.QueryParameter(
required=True,
)
_auth = [
'http_signature_test',
'petstore_auth',
'http_signature_test',
]