Skip to content

Commit

Permalink
refactor: Remove default assignment and obsolete attribute from AWSTo…
Browse files Browse the repository at this point in the history
…kenProvider property
  • Loading branch information
dscpinheiro committed Jan 30, 2025
1 parent 63cb4e0 commit 4c632b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions sdk/src/Core/Amazon.Runtime/ClientConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public abstract partial class ClientConfig : IClientConfig
private bool didProcessServiceURL = false;
private AWSCredentials _defaultAWSCredentials = null;
private IIdentityResolverConfiguration _identityResolverConfiguration = DefaultIdentityResolverConfiguration.Instance;
private IAWSTokenProvider _awsTokenProvider = new DefaultAWSTokenProviderChain();
private IAWSTokenProvider _awsTokenProvider;
private TelemetryProvider telemetryProvider = AWSConfigs.TelemetryProvider;
private AccountIdEndpointMode? accountIdEndpointMode = null;

Expand Down Expand Up @@ -202,7 +202,6 @@ public IIdentityResolverConfiguration IdentityResolverConfiguration
}

/// <inheritdoc />
[Obsolete("This property is deprecated in favor of the new Identity resolvers configured through IdentityResolverConfiguration.")]
public IAWSTokenProvider AWSTokenProvider
{
get { return this._awsTokenProvider; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ public class DefaultAWSTokenIdentityResolver : IIdentityResolver<AWSToken>
{
private readonly IAWSTokenProvider _tokenProvider;

public DefaultAWSTokenIdentityResolver() : this(null) { }

public DefaultAWSTokenIdentityResolver(string profileName)
=> _tokenProvider = new AWSTokenProviderChain(new ProfileTokenProvider(profileName));
public DefaultAWSTokenIdentityResolver()
=> _tokenProvider = new AWSTokenProviderChain(new ProfileTokenProvider());

BaseIdentity IIdentityResolver.ResolveIdentity()
{
Expand Down
5 changes: 4 additions & 1 deletion sdk/src/Core/Amazon.Runtime/IClientConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Amazon.Runtime.Telemetry;
using Amazon.Runtime.Credentials.Internal;
using Amazon.Runtime.Identity;
using Amazon.Runtime.Credentials;

#if NETSTANDARD
using System.Net.Http;
Expand Down Expand Up @@ -84,10 +85,12 @@ public partial interface IClientConfig
IIdentityResolverConfiguration IdentityResolverConfiguration { get; }

/// <summary>
/// For Services using Bearer authentication, this controls how <see cref="BearerTokenSigner"/>
/// For services using Bearer authentication, this provider can be used to override how the <see cref="BearerTokenSigner"/>
/// resolves a <see cref="AWSToken"/>.
/// <para />
/// See <see cref="DefaultAWSTokenProviderChain"/> for additional information.
/// <para />
/// If null, the SDK will use the <see cref="DefaultAWSTokenIdentityResolver"/> to resolve the bearer token.
/// </summary>
IAWSTokenProvider AWSTokenProvider { get; }

Expand Down

0 comments on commit 4c632b8

Please sign in to comment.