CSharp Auth and auth lib changes v1.0
This commit is contained in:
parent
39dd71cdb6
commit
1133bd580f
|
@ -61,7 +61,7 @@ AWSAuthenticationCredentials awsAuthenticationCredentials = new AWSAuthenticatio
|
|||
restRequest = new AWSSigV4Signer(awsAuthenticationCredentials)
|
||||
.Sign(restRequest, restClient.BaseUrl.Host);
|
||||
```
|
||||
Note the IRestRequest reference is treated as **mutable** when signed.
|
||||
Note the IRestRequest reference is treated as **mutable** when signed. **AWSSigV4 Authentication is now optional**
|
||||
|
||||
## RateLimitConfiguration
|
||||
|
||||
|
@ -77,6 +77,8 @@ RateLimitConfiguration rateLimitConfig = new RateLimitConfigurationOnRequests
|
|||
};
|
||||
|
||||
```
|
||||
## Version
|
||||
Selling Partner API Authentication/Authorization Library version 1.0
|
||||
|
||||
## Resources
|
||||
This package features Mustache templates designed for use with [swagger codegen](https://swagger.io/tools/swagger-codegen/).
|
||||
|
|
|
@ -49,8 +49,12 @@ namespace {{packageName}}.Client
|
|||
private void InterceptRequest(IRestRequest request)
|
||||
{
|
||||
lwaAuthorizationSigner.Sign(request);
|
||||
|
||||
if(awsSigV4Signer != null && RestClient.BaseUrl.Host.Contains("business-api.amazon.com"))
|
||||
{
|
||||
awsSigV4Signer.Sign(request, RestClient.BaseUrl.Host);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows for extending response processing for <see cref="ApiClient"/> generated code.
|
||||
|
@ -74,7 +78,10 @@ namespace {{packageName}}.Client
|
|||
{{/netStandard}}
|
||||
|
||||
lwaAuthorizationSigner = new LWAAuthorizationSigner(Configuration.AuthorizationCredentials);
|
||||
if(Configuration.AuthenticationCredentials != null)
|
||||
{
|
||||
awsSigV4Signer = new AWSSigV4Signer(Configuration.AuthenticationCredentials);
|
||||
}
|
||||
rateLimitConfig = Configuration.RateLimitConfig;
|
||||
if(rateLimitConfig != null)
|
||||
{
|
||||
|
|
|
@ -464,18 +464,19 @@ namespace {{packageName}}.{{apiPackage}}
|
|||
throw new NullReferenceException("LWAAuthoriztionCredentials not set");
|
||||
}
|
||||
|
||||
if (awsAuthenticationCredentials == null)
|
||||
{
|
||||
throw new NullReferenceException("AWSAuthenticationCredentials not set");
|
||||
}
|
||||
|
||||
{{packageName}}.Client.Configuration configuration = new {{packageName}}.Client.Configuration()
|
||||
{
|
||||
AuthorizationCredentials = lwaAuthorizationCredentials,
|
||||
AuthenticationCredentials = awsAuthenticationCredentials,
|
||||
RateLimitConfig = rateLimitConfiguration
|
||||
};
|
||||
|
||||
|
||||
if(awsAuthenticationCredentials != null)
|
||||
{
|
||||
configuration.AuthenticationCredentials = awsAuthenticationCredentials;
|
||||
}
|
||||
|
||||
// default HTTP connection timeout (in milliseconds)
|
||||
configuration.Timeout = 100000;
|
||||
|
||||
|
|
Loading…
Reference in New Issue