Add tests for http basic authentication in python client (#16488)

* add tests for http basic auth in python client

* add new files
This commit is contained in:
William Cheng
2023-09-03 19:11:53 +08:00
committed by GitHub
parent b59719a6ea
commit 47a85e880b
41 changed files with 2096 additions and 30 deletions

View File

@@ -85,17 +85,21 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://localhost:3000";
var apiInstance = new BodyApi(config);
// Configure HTTP basic authorization: http_auth
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new AuthApi(config);
try
{
// Test binary (gif) response body
System.IO.Stream result = apiInstance.TestBinaryGif();
// To test HTTP basic authentication
string result = apiInstance.TestAuthHttpBasic();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling BodyApi.TestBinaryGif: " + e.Message );
Debug.Print("Exception when calling AuthApi.TestAuthHttpBasic: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
@@ -112,6 +116,7 @@ All URIs are relative to *http://localhost:3000*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AuthApi* | [**TestAuthHttpBasic**](docs/AuthApi.md#testauthhttpbasic) | **POST** /auth/http/basic | To test HTTP basic authentication
*BodyApi* | [**TestBinaryGif**](docs/BodyApi.md#testbinarygif) | **POST** /binary/gif | Test binary (gif) response body
*BodyApi* | [**TestBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testbodyapplicationoctetstreambinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
*BodyApi* | [**TestBodyMultipartFormdataArrayOfBinary**](docs/BodyApi.md#testbodymultipartformdataarrayofbinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
@@ -152,5 +157,10 @@ Class | Method | HTTP request | Description
<a id="documentation-for-authorization"></a>
## Documentation for Authorization
Endpoints do not require authorization.
Authentication schemes defined for the API:
<a id="http_auth"></a>
### http_auth
- **Type**: HTTP basic authentication