Skip to content

Commit

Permalink
Fix condition bug in dart-dio-next OauthInterceptor (OpenAPITools#10317)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevAtHeart authored Sep 3, 2021
1 parent a558554 commit 1da6c22
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class OAuthInterceptor extends AuthInterceptor {
RequestOptions options,
RequestInterceptorHandler handler,
) {
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' && secure['type'] == 'oauth2');
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2');
for (final info in authInfo) {
final token = tokens[info['name']];
if (token != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,97 +64,97 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo |
[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user
[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
[*AnotherFakeApi*](doc\AnotherFakeApi.md) | [**call123testSpecialTags**](doc\AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
[*DefaultApi*](doc\DefaultApi.md) | [**fooGet**](doc\DefaultApi.md#fooget) | **GET** /foo |
[*FakeApi*](doc\FakeApi.md) | [**fakeHealthGet**](doc\FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
[*FakeApi*](doc\FakeApi.md) | [**fakeHttpSignatureTest**](doc\FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
[*FakeApi*](doc\FakeApi.md) | [**fakeOuterBooleanSerialize**](doc\FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
[*FakeApi*](doc\FakeApi.md) | [**fakeOuterCompositeSerialize**](doc\FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[*FakeApi*](doc\FakeApi.md) | [**fakeOuterNumberSerialize**](doc\FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[*FakeApi*](doc\FakeApi.md) | [**fakeOuterStringSerialize**](doc\FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[*FakeApi*](doc\FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc\FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
[*FakeApi*](doc\FakeApi.md) | [**testBodyWithBinary**](doc\FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
[*FakeApi*](doc\FakeApi.md) | [**testBodyWithFileSchema**](doc\FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[*FakeApi*](doc\FakeApi.md) | [**testBodyWithQueryParams**](doc\FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[*FakeApi*](doc\FakeApi.md) | [**testClientModel**](doc\FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
[*FakeApi*](doc\FakeApi.md) | [**testEndpointParameters**](doc\FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[*FakeApi*](doc\FakeApi.md) | [**testEnumParameters**](doc\FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
[*FakeApi*](doc\FakeApi.md) | [**testGroupParameters**](doc\FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[*FakeApi*](doc\FakeApi.md) | [**testInlineAdditionalProperties**](doc\FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[*FakeApi*](doc\FakeApi.md) | [**testJsonFormData**](doc\FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
[*FakeApi*](doc\FakeApi.md) | [**testQueryParameterCollectionFormat**](doc\FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
[*FakeClassnameTags123Api*](doc\FakeClassnameTags123Api.md) | [**testClassname**](doc\FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
[*PetApi*](doc\PetApi.md) | [**addPet**](doc\PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
[*PetApi*](doc\PetApi.md) | [**deletePet**](doc\PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
[*PetApi*](doc\PetApi.md) | [**findPetsByStatus**](doc\PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
[*PetApi*](doc\PetApi.md) | [**findPetsByTags**](doc\PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
[*PetApi*](doc\PetApi.md) | [**getPetById**](doc\PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
[*PetApi*](doc\PetApi.md) | [**updatePet**](doc\PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
[*PetApi*](doc\PetApi.md) | [**updatePetWithForm**](doc\PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
[*PetApi*](doc\PetApi.md) | [**uploadFile**](doc\PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
[*PetApi*](doc\PetApi.md) | [**uploadFileWithRequiredFile**](doc\PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
[*StoreApi*](doc\StoreApi.md) | [**deleteOrder**](doc\StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[*StoreApi*](doc\StoreApi.md) | [**getInventory**](doc\StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[*StoreApi*](doc\StoreApi.md) | [**getOrderById**](doc\StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[*StoreApi*](doc\StoreApi.md) | [**placeOrder**](doc\StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
[*UserApi*](doc\UserApi.md) | [**createUser**](doc\UserApi.md#createuser) | **POST** /user | Create user
[*UserApi*](doc\UserApi.md) | [**createUsersWithArrayInput**](doc\UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
[*UserApi*](doc\UserApi.md) | [**createUsersWithListInput**](doc\UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
[*UserApi*](doc\UserApi.md) | [**deleteUser**](doc\UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
[*UserApi*](doc\UserApi.md) | [**getUserByName**](doc\UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
[*UserApi*](doc\UserApi.md) | [**loginUser**](doc\UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
[*UserApi*](doc\UserApi.md) | [**logoutUser**](doc\UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
[*UserApi*](doc\UserApi.md) | [**updateUser**](doc\UserApi.md#updateuser) | **PUT** /user/{username} | Updated user


## Documentation For Models

- [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md)
- [Animal](doc/Animal.md)
- [ApiResponse](doc/ApiResponse.md)
- [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md)
- [ArrayTest](doc/ArrayTest.md)
- [Capitalization](doc/Capitalization.md)
- [Cat](doc/Cat.md)
- [CatAllOf](doc/CatAllOf.md)
- [Category](doc/Category.md)
- [ClassModel](doc/ClassModel.md)
- [DeprecatedObject](doc/DeprecatedObject.md)
- [Dog](doc/Dog.md)
- [DogAllOf](doc/DogAllOf.md)
- [EnumArrays](doc/EnumArrays.md)
- [EnumTest](doc/EnumTest.md)
- [FileSchemaTestClass](doc/FileSchemaTestClass.md)
- [Foo](doc/Foo.md)
- [FormatTest](doc/FormatTest.md)
- [HasOnlyReadOnly](doc/HasOnlyReadOnly.md)
- [HealthCheckResult](doc/HealthCheckResult.md)
- [InlineResponseDefault](doc/InlineResponseDefault.md)
- [MapTest](doc/MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](doc/Model200Response.md)
- [ModelClient](doc/ModelClient.md)
- [ModelEnumClass](doc/ModelEnumClass.md)
- [ModelFile](doc/ModelFile.md)
- [ModelList](doc/ModelList.md)
- [ModelReturn](doc/ModelReturn.md)
- [Name](doc/Name.md)
- [NullableClass](doc/NullableClass.md)
- [NumberOnly](doc/NumberOnly.md)
- [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md)
- [Order](doc/Order.md)
- [OuterComposite](doc/OuterComposite.md)
- [OuterEnum](doc/OuterEnum.md)
- [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md)
- [OuterEnumInteger](doc/OuterEnumInteger.md)
- [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md)
- [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md)
- [Pet](doc/Pet.md)
- [ReadOnlyFirst](doc/ReadOnlyFirst.md)
- [SpecialModelName](doc/SpecialModelName.md)
- [Tag](doc/Tag.md)
- [User](doc/User.md)
- [AdditionalPropertiesClass](doc\AdditionalPropertiesClass.md)
- [Animal](doc\Animal.md)
- [ApiResponse](doc\ApiResponse.md)
- [ArrayOfArrayOfNumberOnly](doc\ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](doc\ArrayOfNumberOnly.md)
- [ArrayTest](doc\ArrayTest.md)
- [Capitalization](doc\Capitalization.md)
- [Cat](doc\Cat.md)
- [CatAllOf](doc\CatAllOf.md)
- [Category](doc\Category.md)
- [ClassModel](doc\ClassModel.md)
- [DeprecatedObject](doc\DeprecatedObject.md)
- [Dog](doc\Dog.md)
- [DogAllOf](doc\DogAllOf.md)
- [EnumArrays](doc\EnumArrays.md)
- [EnumTest](doc\EnumTest.md)
- [FileSchemaTestClass](doc\FileSchemaTestClass.md)
- [Foo](doc\Foo.md)
- [FormatTest](doc\FormatTest.md)
- [HasOnlyReadOnly](doc\HasOnlyReadOnly.md)
- [HealthCheckResult](doc\HealthCheckResult.md)
- [InlineResponseDefault](doc\InlineResponseDefault.md)
- [MapTest](doc\MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](doc\MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](doc\Model200Response.md)
- [ModelClient](doc\ModelClient.md)
- [ModelEnumClass](doc\ModelEnumClass.md)
- [ModelFile](doc\ModelFile.md)
- [ModelList](doc\ModelList.md)
- [ModelReturn](doc\ModelReturn.md)
- [Name](doc\Name.md)
- [NullableClass](doc\NullableClass.md)
- [NumberOnly](doc\NumberOnly.md)
- [ObjectWithDeprecatedFields](doc\ObjectWithDeprecatedFields.md)
- [Order](doc\Order.md)
- [OuterComposite](doc\OuterComposite.md)
- [OuterEnum](doc\OuterEnum.md)
- [OuterEnumDefaultValue](doc\OuterEnumDefaultValue.md)
- [OuterEnumInteger](doc\OuterEnumInteger.md)
- [OuterEnumIntegerDefaultValue](doc\OuterEnumIntegerDefaultValue.md)
- [OuterObjectWithEnumProperty](doc\OuterObjectWithEnumProperty.md)
- [Pet](doc\Pet.md)
- [ReadOnlyFirst](doc\ReadOnlyFirst.md)
- [SpecialModelName](doc\SpecialModelName.md)
- [Tag](doc\Tag.md)
- [User](doc\User.md)


## Documentation For Authorization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class OAuthInterceptor extends AuthInterceptor {
RequestOptions options,
RequestInterceptorHandler handler,
) {
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' && secure['type'] == 'oauth2');
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2');
for (final info in authInfo) {
final token = tokens[info['name']];
if (token != null) {
Expand Down

0 comments on commit 1da6c22

Please sign in to comment.