Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TenantId to TokenRequestContext #21664

Merged
merged 3 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net461.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,12 @@ public readonly partial struct TokenRequestContext
private readonly object _dummy;
private readonly int _dummyPrimitive;
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null) { throw null; }
public string? Claims { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
public string[] Scopes { get { throw null; } }
public string? TenantId { get { throw null; } }
}
}
namespace Azure.Core.Cryptography
Expand Down
4 changes: 3 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net5.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,12 @@ public readonly partial struct TokenRequestContext
private readonly object _dummy;
private readonly int _dummyPrimitive;
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null) { throw null; }
public string? Claims { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
public string[] Scopes { get { throw null; } }
public string? TenantId { get { throw null; } }
}
}
namespace Azure.Core.Cryptography
Expand Down
4 changes: 3 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,12 @@ public readonly partial struct TokenRequestContext
private readonly object _dummy;
private readonly int _dummyPrimitive;
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null) { throw null; }
public string? Claims { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
public string[] Scopes { get { throw null; } }
public string? TenantId { get { throw null; } }
}
}
namespace Azure.Core.Cryptography
Expand Down
4 changes: 3 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,12 @@ public readonly partial struct TokenRequestContext
private readonly object _dummy;
private readonly int _dummyPrimitive;
public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims) { throw null; }
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null) { throw null; }
public string? Claims { get { throw null; } }
public string? ParentRequestId { get { throw null; } }
public string[] Scopes { get { throw null; } }
public string? TenantId { get { throw null; } }
}
}
namespace Azure.Core.Cryptography
Expand Down
24 changes: 23 additions & 1 deletion sdk/core/Azure.Core/src/TokenRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public TokenRequestContext(string[] scopes, string? parentRequestId)
Scopes = scopes;
ParentRequestId = parentRequestId;
Claims = default;
TenantId = default;
}

/// <summary>
Expand All @@ -26,11 +27,27 @@ public TokenRequestContext(string[] scopes, string? parentRequestId)
/// <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>
public TokenRequestContext(string[] scopes, string? parentRequestId = default, string? claims = default)
public TokenRequestContext(string[] scopes, string? parentRequestId, string? claims)
{
Scopes = scopes;
ParentRequestId = parentRequestId;
Claims = claims;
TenantId = default;
}

/// <summary>
/// Creates a new TokenRequest with the specified scopes.
/// </summary>
/// <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>
public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null, string? tenantId = null)
{
Scopes = scopes;
ParentRequestId = parentRequestId;
Claims = claims;
TenantId = tenantId;
}

/// <summary>
Expand All @@ -47,5 +64,10 @@ public TokenRequestContext(string[] scopes, string? parentRequestId = default, s
/// Additional claims to be included in the token. See <see href="https://openid.net/specs/openid-connect-core-1_0-final.html#ClaimsParameter">https://openid.net/specs/openid-connect-core-1_0-final.html#ClaimsParameter</see> for more information on format and content.
/// </summary>
public string? Claims { get; }

/// <summary>
/// The tenantId to be included in the token request.
/// </summary>
public string? TenantId { get; }
}
}