diff --git a/eng/ApiListing.exclude-attributes.txt b/eng/ApiListing.exclude-attributes.txt index 78b9bdf9bcb51..cd890199bf466 100644 --- a/eng/ApiListing.exclude-attributes.txt +++ b/eng/ApiListing.exclude-attributes.txt @@ -1,3 +1,5 @@ T:System.Runtime.CompilerServices.AsyncIteratorStateMachineAttribute T:System.Runtime.CompilerServices.AsyncStateMachineAttribute T:System.Runtime.CompilerServices.CompilerGeneratedAttribute +T:System.Runtime.CompilerServices.NullableContextAttribute +T:System.Runtime.CompilerServices.NullableAttribute \ No newline at end of file diff --git a/sdk/core/Azure.Core/api/Azure.Core.net461.cs b/sdk/core/Azure.Core/api/Azure.Core.net461.cs index 5690e26096ccb..8c9615fd5d352 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net461.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net461.cs @@ -416,7 +416,9 @@ public readonly partial struct TokenRequestContext { private readonly object _dummy; private readonly int _dummyPrimitive; - public TokenRequestContext(string[] scopes, string? parentRequestId = null) { throw null; } + public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; } + public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; } + public string? Claims { get { throw null; } } public string? ParentRequestId { get { throw null; } } public string[] Scopes { get { throw null; } } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs index e7a6b0df30ff0..a9855e2e08fa8 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs @@ -416,7 +416,9 @@ public readonly partial struct TokenRequestContext { private readonly object _dummy; private readonly int _dummyPrimitive; - public TokenRequestContext(string[] scopes, string? parentRequestId = null) { throw null; } + public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; } + public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; } + public string? Claims { get { throw null; } } public string? ParentRequestId { get { throw null; } } public string[] Scopes { get { throw null; } } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index 5690e26096ccb..8c9615fd5d352 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -416,7 +416,9 @@ public readonly partial struct TokenRequestContext { private readonly object _dummy; private readonly int _dummyPrimitive; - public TokenRequestContext(string[] scopes, string? parentRequestId = null) { throw null; } + public TokenRequestContext(string[] scopes, string? parentRequestId) { throw null; } + public TokenRequestContext(string[] scopes, string? parentRequestId = null, string? claims = null) { throw null; } + public string? Claims { get { throw null; } } public string? ParentRequestId { get { throw null; } } public string[] Scopes { get { throw null; } } } diff --git a/sdk/core/Azure.Core/src/TokenRequestContext.cs b/sdk/core/Azure.Core/src/TokenRequestContext.cs index 5ce510582c10f..fe4237f61b34d 100644 --- a/sdk/core/Azure.Core/src/TokenRequestContext.cs +++ b/sdk/core/Azure.Core/src/TokenRequestContext.cs @@ -13,10 +13,24 @@ public readonly struct TokenRequestContext /// /// The scopes required for the token. /// The of the request requiring a token for authentication, if applicable. - public TokenRequestContext(string[] scopes, string? parentRequestId = default) + public TokenRequestContext(string[] scopes, string? parentRequestId) { Scopes = scopes; ParentRequestId = parentRequestId; + Claims = default; + } + + /// + /// Creates a new TokenRequest with the specified scopes. + /// + /// The scopes required for the token. + /// The of the request requiring a token for authentication, if applicable. + /// Additional claims to be included in the token. + public TokenRequestContext(string[] scopes, string? parentRequestId = default, string? claims = default) + { + Scopes = scopes; + ParentRequestId = parentRequestId; + Claims = claims; } /// @@ -28,5 +42,10 @@ public TokenRequestContext(string[] scopes, string? parentRequestId = default) /// The of the request requiring a token for authentication, if applicable. /// public string? ParentRequestId { get; } + + /// + /// Additional claims to be included in the token. + /// + public string? Claims { get; } } }