[Java] [Kotlin] (#14876) fix use of isBasic conditions - do not use HttpBearerAuth (or HttpBasicAuth) for other http auth methods (such as http signature auth or custom schemes) (#15220)

* remove http signature from test yaml when not supported

* do not use HttpBearerAuth for signature auth or other unsupported http auth method

ignore unsupported http auth method unless generated code would not compile (in which case, an exception is thrown)

* [Java] fix use of isBasic condition

* [kotlin] fix use of isBasic condition
This commit is contained in:
Tiffany Marrel
2023-05-22 10:08:08 +02:00
committed by GitHub
parent 216e2c45ff
commit cbcf3d36f6
55 changed files with 292 additions and 256 deletions

View File

@@ -243,13 +243,13 @@ Authentication schemes defined for the API:
### bearer_test
- **Type**: HTTP basic authentication
- **Type**: HTTP Bearer Token authentication (JWT)
<a id="http_signature_test"></a>
### http_signature_test
- **Type**: HTTP basic authentication
- **Type**: HTTP signature authentication
## Recommendation

View File

@@ -179,7 +179,6 @@ public class ApiClient extends JavaTimeFormatter {
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
authentications.put("http_basic_test", new HttpBasicAuth());
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
authentications.put("http_signature_test", new HttpBearerAuth("signature"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);