Skip to content

Commit

Permalink
All credentials have parameterless ctor (#43962)
Browse files Browse the repository at this point in the history
  • Loading branch information
christothes authored May 15, 2024
1 parent 2866346 commit 9637250
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public BrowserCustomizationOptions() { }
}
public partial class ChainedTokenCredential : Azure.Core.TokenCredential
{
protected ChainedTokenCredential() { }
public ChainedTokenCredential(params Azure.Core.TokenCredential[] sources) { }
public override Azure.Core.AccessToken GetToken(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.ValueTask<Azure.Core.AccessToken> GetTokenAsync(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down Expand Up @@ -180,6 +181,7 @@ public CredentialUnavailableException(string message, System.Exception innerExce
}
public partial class DefaultAzureCredential : Azure.Core.TokenCredential
{
protected DefaultAzureCredential() { }
public DefaultAzureCredential(Azure.Identity.DefaultAzureCredentialOptions options) { }
public DefaultAzureCredential(bool includeInteractiveCredentials = false) { }
public override Azure.Core.AccessToken GetToken(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public class ChainedTokenCredential : TokenCredential
private readonly TokenCredential[] _sources;

/// <summary>
/// Constructor for instrumenting in tests
/// Protected constructor for <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
/// </summary>
internal ChainedTokenCredential()
protected ChainedTokenCredential()
{
_sources = Array.Empty<TokenCredential>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ public class DefaultAzureCredential : TokenCredential

internal TokenCredential[] _sources;

internal DefaultAzureCredential() : this(false) { }
/// <summary>
/// Protected constructor for <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
/// </summary>
protected DefaultAzureCredential() : this(false) { }

/// <summary>
/// Creates an instance of the DefaultAzureCredential class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public override TokenCredential GetTokenCredential(CommonCredentialTestConfig co
PlanId = "myplan",
JobId = "myjob",
TeamProjectId = "myteamproject",
SystemAccessToken = "mytoken"
SystemAccessToken = "mytoken",
HubName = "myhub",
};
if (config.Transport != null)
{
Expand Down

0 comments on commit 9637250

Please sign in to comment.