Skip to content

Commit

Permalink
Azure Core API feedback (#37557)
Browse files Browse the repository at this point in the history
  • Loading branch information
christothes committed Jul 12, 2023
1 parent 30af940 commit 616f600
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net461.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public abstract partial class TokenCredential
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims, string? tenantId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool enableCae = false) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool isCaeEnabled = false) { throw null; }
public string? Claims { get { throw null; } }
public bool IsCaeEnabled { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net5.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public abstract partial class TokenCredential
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims, string? tenantId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool enableCae = false) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool isCaeEnabled = false) { throw null; }
public string? Claims { get { throw null; } }
public bool IsCaeEnabled { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net6.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public abstract partial class TokenCredential
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims, string? tenantId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool enableCae = false) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool isCaeEnabled = false) { throw null; }
public string? Claims { get { throw null; } }
public bool IsCaeEnabled { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public abstract partial class TokenCredential
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims, string? tenantId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool enableCae = false) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool isCaeEnabled = false) { throw null; }
public string? Claims { get { throw null; } }
public bool IsCaeEnabled { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public abstract partial class TokenCredential
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims, string? tenantId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool enableCae = false) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null, bool isCaeEnabled = false) { throw null; }
public string? Claims { get { throw null; } }
public bool IsCaeEnabled { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
Expand Down
8 changes: 4 additions & 4 deletions sdk/core/Azure.Core/src/TokenRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public TokenRequestContext(string[] scopes, string? parentRequestId, string? cla
/// <param name="scopes">The scopes required for the token.</param>
/// <param name="parentRequestId">The <see cref="Request.ClientRequestId"/> of the request requiring a token for authentication, if applicable.</param>
/// <param name="claims">Additional claims to be included in the token.</param>
/// <param name="tenantId"> The tenantId to be included in the token request. </param>
/// <param name="enableCae"></param>
public TokenRequestContext(string[] scopes, string? parentRequestId = default, string? claims = default, string? tenantId = default, bool enableCae = false)
/// <param name="tenantId"> The tenantId to be included in the token request.</param>
/// <param name="isCaeEnabled">Indicates whether to enable Continuous Access Evaluation (CAE) for the requested token.</param>
public TokenRequestContext(string[] scopes, string? parentRequestId = default, string? claims = default, string? tenantId = default, bool isCaeEnabled = false)
{
Scopes = scopes;
ParentRequestId = parentRequestId;
Claims = claims;
TenantId = tenantId;
IsCaeEnabled = enableCae;
IsCaeEnabled = isCaeEnabled;
}

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions sdk/identity/Azure.Identity/tests/CredentialTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,25 +268,25 @@ public async Task EnableCae()
// First call with EnableCae = false
using (HttpPipeline.CreateClientRequestIdScope("disableCae"))
{
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, enableCae: false), default);
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, isCaeEnabled: false), default);
Assert.AreEqual(token, actualToken.Token);
}
// First call with EnableCae = true
using (HttpPipeline.CreateClientRequestIdScope("enableCae"))
{
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, enableCae: true), default);
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, isCaeEnabled: true), default);
Assert.AreEqual(token, actualToken.Token);
}
// Second call with EnableCae = false
using (HttpPipeline.CreateClientRequestIdScope("disableCae"))
{
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, enableCae: false), default);
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, isCaeEnabled: false), default);
Assert.AreEqual(token, actualToken.Token);
}
// Second call with EnableCae = true
using (HttpPipeline.CreateClientRequestIdScope("enableCae"))
{
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, enableCae: true), default);
AccessToken actualToken = await credential.GetTokenAsync(new TokenRequestContext(MockScopes.Default, isCaeEnabled: true), default);
Assert.AreEqual(token, actualToken.Token);
}
Assert.True(observedCae);
Expand Down

0 comments on commit 616f600

Please sign in to comment.