Skip to content

Commit

Permalink
Move AuthSchemeHandler to run after the Marshaller
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-othman committed Nov 28, 2024
1 parent 46cbc70 commit 8fb5541
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,16 +567,9 @@ public override string TransformText()
/// <param name=""pipeline""></param>
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.CredentialsRetriever>(new Amazon");
");

#line 235 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));

#line default
#line hidden
this.Write("AuthSchemeHandler());\r\n");

#line 236 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

var pipelineOverrides = this.Config.ServiceModel.Customizations.PipelineOverride;
if (pipelineOverrides != null)
Expand All @@ -591,14 +584,14 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line hidden
this.Write(" if(");

#line 245 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 244 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.Condition));

#line default
#line hidden
this.Write(")\r\n {\r\n");

#line 247 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 246 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

if(o.OverrideMethod == "remove")
{
Expand All @@ -608,14 +601,14 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line hidden
this.Write(" pipeline.");

#line 251 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 250 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));

#line default
#line hidden
this.Write("();\r\n");

#line 252 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 251 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

}
else
Expand All @@ -626,28 +619,28 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line hidden
this.Write(" pipeline.");

#line 257 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 256 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));

#line default
#line hidden
this.Write("(new ");

#line 257 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 256 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));

#line default
#line hidden
this.Write("(");

#line 257 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 256 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));

#line default
#line hidden
this.Write("));\r\n");

#line 258 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 257 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

}

Expand All @@ -656,7 +649,7 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line hidden
this.Write(" }\r\n");

#line 262 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 261 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

}
else if(o.OverrideMethod == "remove")
Expand All @@ -667,14 +660,14 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line hidden
this.Write(" pipeline.");

#line 267 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 266 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));

#line default
#line hidden
this.Write("();\r\n");

#line 268 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 267 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

}
else
Expand All @@ -685,28 +678,28 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line hidden
this.Write(" pipeline.");

#line 273 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 272 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));

#line default
#line hidden
this.Write("(new ");

#line 273 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 272 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));

#line default
#line hidden
this.Write("(");

#line 273 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 272 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));

#line default
#line hidden
this.Write("));\r\n");

#line 274 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 273 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"

}
}
Expand All @@ -716,7 +709,7 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
#line default
#line hidden

#line 279 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 278 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
if (this.Config.EndpointsRuleSet != null) {

#line default
Expand All @@ -725,19 +718,28 @@ protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
" pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Ama" +
"zon");

#line 281 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 280 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));

#line default
#line hidden
this.Write("EndpointResolver());\r\n");

#line 282 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
#line 281 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
}

#line default
#line hidden
this.Write(@" }
this.Write(" pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amaz" +
"on");

#line 282 "C:\repos\aws-sdk-net-v4\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetFramework.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));

#line default
#line hidden
this.Write(@"AuthSchemeHandler());
}
/// <summary>
/// Capture metadata for the service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ namespace <#=this.Config.Namespace#>
/// <param name="pipeline"></param>
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.CredentialsRetriever>(new Amazon<#=this.Config.ClassName#>AuthSchemeHandler());
<#
var pipelineOverrides = this.Config.ServiceModel.Customizations.PipelineOverride;
if (pipelineOverrides != null)
Expand Down Expand Up @@ -280,6 +279,7 @@ namespace <#=this.Config.Namespace#>
pipeline.RemoveHandler<Amazon.Runtime.Internal.EndpointResolver>();
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon<#=this.Config.ClassName#>EndpointResolver());
<# } #>
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon<#=this.Config.ClassName#>AuthSchemeHandler());
}

/// <summary>
Expand Down
Loading

0 comments on commit 8fb5541

Please sign in to comment.