Add Bearer authentication support to Python client (#1999)

* add bearer auth support to python

* add bearer auth support to python

* update python oas2 petstore samples

* update samples

* add bearer format

* update php symfony samle
This commit is contained in:
William Cheng
2019-01-30 22:16:53 +08:00
committed by GitHub
parent 77d2de4e3d
commit 2eb99f602a
37 changed files with 294 additions and 89 deletions

View File

@@ -166,6 +166,10 @@ Class | Method | HTTP request | Description
- **API key parameter name**: api_key_query
- **Location**: URL query string
### bearer_test
- **Type**: HTTP basic authentication
### http_basic_test
- **Type**: HTTP basic authentication

View File

@@ -482,6 +482,12 @@ Fake endpoint to test group parameters (optional)
```ruby
# load the gem
require 'petstore'
# setup authorization
Petstore.configure do |config|
# Configure HTTP basic authorization: bearer_test
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = Petstore::FakeApi.new
required_string_group = 56 # Integer | Required String in group parameters
@@ -518,7 +524,7 @@ nil (empty response body)
### Authorization
No authorization required
[bearer_test](../README.md#bearer_test)
### HTTP request headers

View File

@@ -686,7 +686,7 @@ module Petstore
# http body (model)
post_body = nil
auth_names = []
auth_names = ['bearer_test']
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
:header_params => header_params,
:query_params => query_params,

View File

@@ -210,6 +210,13 @@ module Petstore
key: 'api_key_query',
value: api_key_with_prefix('api_key_query')
},
'bearer_test' =>
{
type: 'basic',
in: 'header',
key: 'Authorization',
value: basic_auth_token
},
'http_basic_test' =>
{
type: 'basic',