Skip to content

Commit

Permalink
Remove CreateSigner from serviceClient and requests with authtype
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-othman committed Nov 12, 2024
1 parent cb3e18a commit 4e304ff
Show file tree
Hide file tree
Showing 22 changed files with 473 additions and 906 deletions.
5 changes: 0 additions & 5 deletions extensions/test/NETCore.SetupTests/MockServiceClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public MockServiceClient(AWSCredentials credentials, MockServiceConfig config)
{

}

protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
}

public class MockServiceConfig : AmazonS3Config
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ namespace <#=this.Config.Namespace#>
///
/// </summary>
public Amazon<#=this.Config.ClassName#>Client()
<# if (this.Config.ClassName == "AutoScaling") { #>
: base(new Amazon<#=this.Config.ClassName#>Config()) { }
<#} else {#>
: base(FallbackCredentialsFactory.GetCredentials(<#= fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""#>), new Amazon<#=this.Config.ClassName#>Config()) { }
<#}#>

/// <summary>
/// Constructs Amazon<#=this.Config.ClassName#>Client with the credentials loaded from the application's
Expand All @@ -103,11 +99,7 @@ namespace <#=this.Config.Namespace#>
/// </summary>
/// <param name="region">The region to connect.</param>
public Amazon<#=this.Config.ClassName#>Client(RegionEndpoint region)
<# if (this.Config.ClassName == "AutoScaling") { #>
: base(new Amazon<#=this.Config.ClassName#>Config{RegionEndpoint = region}) { }
<#} else {#>
: base(FallbackCredentialsFactory.GetCredentials(<#= fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""#>), new Amazon<#=this.Config.ClassName#>Config{RegionEndpoint = region}) { }
<#}#>

/// <summary>
/// Constructs Amazon<#=this.Config.ClassName#>Client with the credentials loaded from the application's
Expand All @@ -126,11 +118,7 @@ namespace <#=this.Config.Namespace#>
/// </summary>
/// <param name="config">The Amazon<#=this.Config.ClassName#>Client Configuration Object</param>
public Amazon<#=this.Config.ClassName#>Client(Amazon<#=this.Config.ClassName#>Config config)
<# if (this.Config.ClassName == "AutoScaling") { #>
: base(config) { }
<#} else {#>
: base(FallbackCredentialsFactory.GetCredentials(config<#= fallbackToAnonymousCredentials ? ", fallbackToAnonymous: true" : ""#>), config){}
<#}#>

/// <summary>
/// Constructs Amazon<#=this.Config.ClassName#>Client with AWS Credentials
Expand Down Expand Up @@ -236,15 +224,7 @@ namespace <#=this.Config.Namespace#>
}
#>

#region Overrides

/// <summary>
/// Creates the signer for the service.
/// </summary>
protected override AbstractAWSSigner CreateSigner()
{
return new <#=GeneratorHelpers.DetermineSigner(this.Config.ServiceModel.SignatureVersion, this.Config.ClassName)#>();
}
#region Overrides

<# if(this.Config.ServiceModel.Customizations.PipelineOverride != null || this.Config.EndpointsRuleSet != null) { #>
/// <summary>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ namespace <#=this.Config.Namespace#>
///
/// </summary>
public Amazon<#=this.Config.ClassName#>Client()
<# if (this.Config.ClassName == "AutoScaling") { #>
: base(new Amazon<#=this.Config.ClassName#>Config()) { }
<#} else {#>
: base(FallbackCredentialsFactory.GetCredentials(<#= fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""#>), new Amazon<#=this.Config.ClassName#>Config()) { }
<#}#>

/// <summary>
/// Constructs Amazon<#=this.Config.ClassName#>Client with the credentials loaded from the application's
Expand All @@ -80,11 +76,7 @@ namespace <#=this.Config.Namespace#>
/// </summary>
/// <param name="region">The region to connect.</param>
public Amazon<#=this.Config.ClassName#>Client(RegionEndpoint region)
<# if (this.Config.ClassName == "AutoScaling") { #>
: base(new Amazon<#=this.Config.ClassName#>Config{RegionEndpoint = region}) { }
<#} else {#>
: base(FallbackCredentialsFactory.GetCredentials(<#= fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""#>), new Amazon<#=this.Config.ClassName#>Config{RegionEndpoint = region}) { }
<#}#>

/// <summary>
/// Constructs Amazon<#=this.Config.ClassName#>Client with the credentials loaded from the application's
Expand All @@ -103,11 +95,7 @@ namespace <#=this.Config.Namespace#>
/// </summary>
/// <param name="config">The Amazon<#=this.Config.ClassName#>Client Configuration Object</param>
public Amazon<#=this.Config.ClassName#>Client(Amazon<#=this.Config.ClassName#>Config config)
<# if (this.Config.ClassName == "AutoScaling") { #>
: base(config) { }
<#} else {#>
: base(FallbackCredentialsFactory.GetCredentials(config<#= fallbackToAnonymousCredentials ? ", fallbackToAnonymous: true" : ""#>), config){}
<#}#>


/// <summary>
Expand Down Expand Up @@ -242,14 +230,6 @@ namespace <#=this.Config.Namespace#>

#region Overrides

/// <summary>
/// Creates the signer for the service.
/// </summary>
protected override AbstractAWSSigner CreateSigner()
{
return new <#=GeneratorHelpers.DetermineSigner(this.Config.ServiceModel.SignatureVersion, this.Config.ClassName)#>();
}

<# if(this.Config.ServiceModel.Customizations.PipelineOverride != null || this.Config.EndpointsRuleSet != null) { #>
/// <summary>
/// Customizes the runtime pipeline.
Expand Down
Loading

0 comments on commit 4e304ff

Please sign in to comment.