Skip to content

Commit 5bcabbe

Browse files
committed
Obsolete AWS4aSignerCRTWrapper and related APIs.
1 parent 56db341 commit 5bcabbe

File tree

5 files changed

+11
-30
lines changed

5 files changed

+11
-30
lines changed

extensions/src/AWSSDK.Extensions.CrtIntegration/CrtAWS4aSigner.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using AWSSDK.Extensions.CrtIntegration;
2525
using System;
2626
using System.Collections.Generic;
27+
using System.ComponentModel;
2728
using System.Globalization;
2829
using System.IO;
2930
using System.Linq;
@@ -34,6 +35,7 @@ namespace Amazon.Extensions.CrtIntegration
3435
/// <summary>
3536
/// Asymmetric Sigv4 (SigV4a) protocol signer using the implementation provided by Aws.Crt.Auth
3637
/// </summary>
38+
[Obsolete("Use Amazon.Runtime.Internal.Auth.AWS4aSigner instead."), EditorBrowsable(EditorBrowsableState.Never)]
3739
public class CrtAWS4aSigner : IAWSSigV4aProvider
3840
{
3941
/// <summary>

sdk/src/Core/Amazon.Runtime/Internal/Auth/AWS4aSignerCRTWrapper.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Amazon.Util.Internal;
2020
using System;
2121
using System.Collections.Generic;
22+
using System.ComponentModel;
2223
using System.Diagnostics.CodeAnalysis;
2324
using System.Globalization;
2425
using System.IO;
@@ -29,6 +30,7 @@ namespace Amazon.Runtime.Internal.Auth
2930
/// <summary>
3031
/// Asymmetric SigV4 signer using a the AWS Common Runtime implementation of SigV4a via AWSSDK.Extensions.CrtIntegration
3132
/// </summary>
33+
[Obsolete("Use AWS4aSigner instead."), EditorBrowsable(EditorBrowsableState.Never)]
3234
public class AWS4aSignerCRTWrapper : AbstractAWSSigner
3335
{
3436
internal const string CRT_WRAPPER_ASSEMBLY_NAME = "AWSSDK.Extensions.CrtIntegration";

sdk/src/Core/Amazon.Runtime/Pipeline/Handlers/BaseEndpointResolver.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,6 @@ private static void SetAuthenticationAndHeaders(IRequest request, Endpoint endpo
162162
}
163163
case "sigv4a":
164164
{
165-
// If there are multiple authentication schemes but the CRT dependency is not available,
166-
// we will proceed to check the next value in authSchemes.
167-
if (hasMultipleSchemes)
168-
{
169-
if (!IsCrtDependencyAvailable())
170-
{
171-
continue;
172-
}
173-
}
174-
175165
request.SignatureVersion = SignatureVersion.SigV4a;
176166

177167
var signingRegions = ((List<object>)schema["signingRegionSet"]).OfType<string>().ToArray();
@@ -220,25 +210,6 @@ private static void ApplyCommonSchema(IRequest request, PropertyBag schema)
220210
}
221211
}
222212

223-
/// <summary>
224-
/// Validates whether the CRT dependency is available by trying to create an <see cref="AWS4aSignerCRTWrapper"/> instance.
225-
/// </summary>
226-
/// <returns>
227-
/// True if the CRT package is available at runtime, false otherwise.
228-
/// </returns>
229-
private static bool IsCrtDependencyAvailable()
230-
{
231-
try
232-
{
233-
var signer = new AWS4aSignerCRTWrapper();
234-
return signer != null;
235-
}
236-
catch (AWSCommonRuntimeException)
237-
{
238-
return false;
239-
}
240-
}
241-
242213
/// <summary>
243214
/// Inject host prefix into request endpoint.
244215
/// </summary>

sdk/src/Core/Amazon.Runtime/SharedInterfaces/IAWSSigV4aProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616
using Amazon.Runtime.Internal;
1717
using Amazon.Runtime.Internal.Auth;
1818
using Amazon.Runtime.Internal.Util;
19+
using System;
1920
using System.Collections.Generic;
21+
using System.ComponentModel;
2022
using System.IO;
2123

2224
namespace Amazon.Runtime.SharedInterfaces
2325
{
2426
/// <summary>
2527
/// Interface for an asymmetric SigV4 (SigV4a) signer
2628
/// </summary>
29+
[Obsolete("SigV4a provider is now built-in; this interface is no longer necessary to implement."), EditorBrowsable(EditorBrowsableState.Never)]
2730
public interface IAWSSigV4aProvider
2831
{
2932
/// <summary>

sdk/src/Core/RuntimeDependencies/GlobalRuntimeDependencyRegistry.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using Amazon.Runtime.Internal;
1616
using Amazon.Runtime.Internal.Auth;
1717
using AWSSDK.Runtime.Internal.Util;
18+
using System;
19+
using System.ComponentModel;
1820

1921
namespace Amazon.RuntimeDependencies
2022
{
@@ -60,10 +62,11 @@ public void RegisterChecksumProvider(object instance)
6062
/// GlobalRuntimeDependencyRegistry.Instance.RegisterSigV4aProvider((context) =>
6163
/// {
6264
/// return new Amazon.Extensions.CrtIntegration.CrtAWS4aSigner(context.SigV4aCrtSignerContextData.Payload);
63-
/// }
65+
/// });
6466
/// </code>
6567
/// </summary>
6668
/// <param name="factory"></param>
69+
[Obsolete("SigV4a provider is now built-in; this method is no longer necessary to call."), EditorBrowsable(EditorBrowsableState.Never)]
6770
public void RegisterSigV4aProvider(RuntimeDependencyFactory factory)
6871
{
6972
RegisterInstance(AWS4aSignerCRTWrapper.CRT_WRAPPER_ASSEMBLY_NAME, AWS4aSignerCRTWrapper.CRT_WRAPPER_CLASS_NAME, factory);

0 commit comments

Comments
 (0)