Skip to content

Commit a7a1ba6

Browse files
authored
Identity arch board API feedback changes for GA (#24287)
* Identity arch board API feedback changes
1 parent dc9a291 commit a7a1ba6

14 files changed

+61
-127
lines changed

sdk/identity/Azure.Identity/api/Azure.Identity.netstandard2.0.cs

Lines changed: 10 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public partial class AuthorizationCodeCredential : Azure.Core.TokenCredential
3131
protected AuthorizationCodeCredential() { }
3232
public AuthorizationCodeCredential(string tenantId, string clientId, string clientSecret, string authorizationCode) { }
3333
public AuthorizationCodeCredential(string tenantId, string clientId, string clientSecret, string authorizationCode, Azure.Identity.AuthorizationCodeCredentialOptions options) { }
34+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
3435
public AuthorizationCodeCredential(string tenantId, string clientId, string clientSecret, string authorizationCode, Azure.Identity.TokenCredentialOptions options) { }
3536
public override Azure.Core.AccessToken GetToken(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
3637
public override System.Threading.Tasks.ValueTask<Azure.Core.AccessToken> GetTokenAsync(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
@@ -104,7 +105,6 @@ public ClientCertificateCredential(string tenantId, string clientId, string clie
104105
public partial class ClientCertificateCredentialOptions : Azure.Identity.TokenCredentialOptions
105106
{
106107
public ClientCertificateCredentialOptions() { }
107-
public Azure.Identity.RegionalAuthority? RegionalAuthority { get { throw null; } set { } }
108108
public bool SendCertificateChain { get { throw null; } set { } }
109109
public Azure.Identity.TokenCachePersistenceOptions TokenCachePersistenceOptions { get { throw null; } set { } }
110110
}
@@ -120,7 +120,6 @@ public ClientSecretCredential(string tenantId, string clientId, string clientSec
120120
public partial class ClientSecretCredentialOptions : Azure.Identity.TokenCredentialOptions
121121
{
122122
public ClientSecretCredentialOptions() { }
123-
public Azure.Identity.RegionalAuthority? RegionalAuthority { get { throw null; } set { } }
124123
public Azure.Identity.TokenCachePersistenceOptions TokenCachePersistenceOptions { get { throw null; } set { } }
125124
}
126125
public partial class CredentialUnavailableException : Azure.Identity.AuthenticationFailedException
@@ -242,87 +241,17 @@ public partial class OnBehalfOfCredential : Azure.Core.TokenCredential
242241
{
243242
protected OnBehalfOfCredential() { }
244243
public OnBehalfOfCredential(string tenantId, string clientId, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate, string userAssertion) { }
245-
public OnBehalfOfCredential(string tenantId, string clientId, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate, string userAssertion, Azure.Identity.OnBehalfOfCredentialOptions options) { }
246-
public OnBehalfOfCredential(string tenantId, string clientId, string clientSecret, string userAssertion, Azure.Identity.OnBehalfOfCredentialOptions options = null) { }
244+
public OnBehalfOfCredential(string tenantId, string clientId, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate, string userAssertion, Azure.Identity.OnBehalfOfCredentialOptions options = null) { }
245+
public OnBehalfOfCredential(string tenantId, string clientId, string clientSecret, string userAssertion, Azure.Identity.OnBehalfOfCredentialOptions options) { }
247246
public override Azure.Core.AccessToken GetToken(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken) { throw null; }
248247
public override System.Threading.Tasks.ValueTask<Azure.Core.AccessToken> GetTokenAsync(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken) { throw null; }
249248
}
250249
public partial class OnBehalfOfCredentialOptions : Azure.Identity.TokenCredentialOptions
251250
{
252251
public OnBehalfOfCredentialOptions() { }
253-
public Azure.Identity.RegionalAuthority? RegionalAuthority { get { throw null; } set { } }
254252
public bool SendCertificateChain { get { throw null; } set { } }
255253
public Azure.Identity.TokenCachePersistenceOptions TokenCachePersistenceOptions { get { throw null; } set { } }
256254
}
257-
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
258-
public readonly partial struct RegionalAuthority : System.IEquatable<Azure.Identity.RegionalAuthority>
259-
{
260-
private readonly object _dummy;
261-
private readonly int _dummyPrimitive;
262-
public RegionalAuthority(string value) { throw null; }
263-
public static Azure.Identity.RegionalAuthority AsiaEast { get { throw null; } }
264-
public static Azure.Identity.RegionalAuthority AsiaSouthEast { get { throw null; } }
265-
public static Azure.Identity.RegionalAuthority AustraliaCentral { get { throw null; } }
266-
public static Azure.Identity.RegionalAuthority AustraliaCentral2 { get { throw null; } }
267-
public static Azure.Identity.RegionalAuthority AustraliaEast { get { throw null; } }
268-
public static Azure.Identity.RegionalAuthority AustraliaSouthEast { get { throw null; } }
269-
public static Azure.Identity.RegionalAuthority AutoDiscoverRegion { get { throw null; } }
270-
public static Azure.Identity.RegionalAuthority BrazilSouth { get { throw null; } }
271-
public static Azure.Identity.RegionalAuthority CanadaCentral { get { throw null; } }
272-
public static Azure.Identity.RegionalAuthority CanadaEast { get { throw null; } }
273-
public static Azure.Identity.RegionalAuthority ChinaEast { get { throw null; } }
274-
public static Azure.Identity.RegionalAuthority ChinaEast2 { get { throw null; } }
275-
public static Azure.Identity.RegionalAuthority ChinaNorth { get { throw null; } }
276-
public static Azure.Identity.RegionalAuthority ChinaNorth2 { get { throw null; } }
277-
public static Azure.Identity.RegionalAuthority EuropeNorth { get { throw null; } }
278-
public static Azure.Identity.RegionalAuthority EuropeWest { get { throw null; } }
279-
public static Azure.Identity.RegionalAuthority FranceCentral { get { throw null; } }
280-
public static Azure.Identity.RegionalAuthority FranceSouth { get { throw null; } }
281-
public static Azure.Identity.RegionalAuthority GermanyCentral { get { throw null; } }
282-
public static Azure.Identity.RegionalAuthority GermanyNorth { get { throw null; } }
283-
public static Azure.Identity.RegionalAuthority GermanyNorthEast { get { throw null; } }
284-
public static Azure.Identity.RegionalAuthority GermanyWestCentral { get { throw null; } }
285-
public static Azure.Identity.RegionalAuthority GovernmentUSArizona { get { throw null; } }
286-
public static Azure.Identity.RegionalAuthority GovernmentUSDodCentral { get { throw null; } }
287-
public static Azure.Identity.RegionalAuthority GovernmentUSDodEast { get { throw null; } }
288-
public static Azure.Identity.RegionalAuthority GovernmentUSIowa { get { throw null; } }
289-
public static Azure.Identity.RegionalAuthority GovernmentUSTexas { get { throw null; } }
290-
public static Azure.Identity.RegionalAuthority GovernmentUSVirginia { get { throw null; } }
291-
public static Azure.Identity.RegionalAuthority IndiaCentral { get { throw null; } }
292-
public static Azure.Identity.RegionalAuthority IndiaSouth { get { throw null; } }
293-
public static Azure.Identity.RegionalAuthority IndiaWest { get { throw null; } }
294-
public static Azure.Identity.RegionalAuthority JapanEast { get { throw null; } }
295-
public static Azure.Identity.RegionalAuthority JapanWest { get { throw null; } }
296-
public static Azure.Identity.RegionalAuthority KoreaCentral { get { throw null; } }
297-
public static Azure.Identity.RegionalAuthority KoreaSouth { get { throw null; } }
298-
public static Azure.Identity.RegionalAuthority NorwayEast { get { throw null; } }
299-
public static Azure.Identity.RegionalAuthority NorwayWest { get { throw null; } }
300-
public static Azure.Identity.RegionalAuthority SouthAfricaNorth { get { throw null; } }
301-
public static Azure.Identity.RegionalAuthority SouthAfricaWest { get { throw null; } }
302-
public static Azure.Identity.RegionalAuthority SwitzerlandNorth { get { throw null; } }
303-
public static Azure.Identity.RegionalAuthority SwitzerlandWest { get { throw null; } }
304-
public static Azure.Identity.RegionalAuthority UAECentral { get { throw null; } }
305-
public static Azure.Identity.RegionalAuthority UAENorth { get { throw null; } }
306-
public static Azure.Identity.RegionalAuthority UKSouth { get { throw null; } }
307-
public static Azure.Identity.RegionalAuthority UKWest { get { throw null; } }
308-
public static Azure.Identity.RegionalAuthority USCentral { get { throw null; } }
309-
public static Azure.Identity.RegionalAuthority USEast { get { throw null; } }
310-
public static Azure.Identity.RegionalAuthority USEast2 { get { throw null; } }
311-
public static Azure.Identity.RegionalAuthority USNorthCentral { get { throw null; } }
312-
public static Azure.Identity.RegionalAuthority USSouthCentral { get { throw null; } }
313-
public static Azure.Identity.RegionalAuthority USWest { get { throw null; } }
314-
public static Azure.Identity.RegionalAuthority USWest2 { get { throw null; } }
315-
public static Azure.Identity.RegionalAuthority USWestCentral { get { throw null; } }
316-
public bool Equals(Azure.Identity.RegionalAuthority other) { throw null; }
317-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
318-
public override bool Equals(object obj) { throw null; }
319-
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
320-
public override int GetHashCode() { throw null; }
321-
public static bool operator ==(Azure.Identity.RegionalAuthority left, Azure.Identity.RegionalAuthority right) { throw null; }
322-
public static implicit operator Azure.Identity.RegionalAuthority (string value) { throw null; }
323-
public static bool operator !=(Azure.Identity.RegionalAuthority left, Azure.Identity.RegionalAuthority right) { throw null; }
324-
public override string ToString() { throw null; }
325-
}
326255
public partial class SharedTokenCacheCredential : Azure.Core.TokenCredential
327256
{
328257
public SharedTokenCacheCredential() { }
@@ -344,23 +273,23 @@ public SharedTokenCacheCredentialOptions(Azure.Identity.TokenCachePersistenceOpt
344273
public string Username { get { throw null; } set { } }
345274
}
346275
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
347-
public partial struct TokenCacheDetails
276+
public partial struct TokenCacheData
348277
{
349278
private object _dummy;
350279
private int _dummyPrimitive;
351280
public System.ReadOnlyMemory<byte> CacheBytes { get { throw null; } set { } }
352281
}
353-
public partial class TokenCacheNotificationDetails
354-
{
355-
internal TokenCacheNotificationDetails() { }
356-
public string SuggestedCacheKey { get { throw null; } }
357-
}
358282
public partial class TokenCachePersistenceOptions
359283
{
360284
public TokenCachePersistenceOptions() { }
361285
public string Name { get { throw null; } set { } }
362286
public bool UnsafeAllowUnencryptedStorage { get { throw null; } set { } }
363287
}
288+
public partial class TokenCacheRefreshArgs
289+
{
290+
internal TokenCacheRefreshArgs() { }
291+
public string SuggestedCacheKey { get { throw null; } }
292+
}
364293
public partial class TokenCacheUpdatedArgs
365294
{
366295
internal TokenCacheUpdatedArgs() { }
@@ -376,7 +305,7 @@ public abstract partial class UnsafeTokenCacheOptions : Azure.Identity.TokenCach
376305
{
377306
protected UnsafeTokenCacheOptions() { }
378307
protected internal abstract System.Threading.Tasks.Task<System.ReadOnlyMemory<byte>> RefreshCacheAsync();
379-
protected internal virtual System.Threading.Tasks.Task<Azure.Identity.TokenCacheDetails> RefreshCacheAsync(Azure.Identity.TokenCacheNotificationDetails details) { throw null; }
308+
protected internal virtual System.Threading.Tasks.Task<Azure.Identity.TokenCacheData> RefreshCacheAsync(Azure.Identity.TokenCacheRefreshArgs args, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
380309
protected internal abstract System.Threading.Tasks.Task TokenCacheUpdatedAsync(Azure.Identity.TokenCacheUpdatedArgs tokenCacheUpdatedArgs);
381310
}
382311
public partial class UsernamePasswordCredential : Azure.Core.TokenCredential

sdk/identity/Azure.Identity/src/AuthorizationCodeCredential.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System;
5+
using System.ComponentModel;
56
using System.Threading;
67
using System.Threading.Tasks;
78
using Azure.Core;
@@ -71,6 +72,7 @@ public AuthorizationCodeCredential(
7172
/// <param name="authorizationCode">The authorization code obtained from a call to authorize. The code should be obtained with all required scopes.
7273
/// See https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow for more information.</param>
7374
/// <param name="options">Options that allow to configure the management of the requests sent to the Azure Active Directory service.</param>
75+
[EditorBrowsable(EditorBrowsableState.Never)]
7476
public AuthorizationCodeCredential(string tenantId, string clientId, string clientSecret, string authorizationCode, TokenCredentialOptions options)
7577
: this(tenantId, clientId, clientSecret, authorizationCode, options, null)
7678
{ }

sdk/identity/Azure.Identity/src/ClientCertificateCredentialOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public class ClientCertificateCredentialOptions : TokenCredentialOptions, IToken
2222
/// Specifies either the specific <see cref="RegionalAuthority"/> (preferred), or use <see cref="RegionalAuthority.AutoDiscoverRegion"/> to attempt to auto-detect the region.
2323
/// If not specified or auto-detection fails the non-regional endpoint will be used.
2424
/// </summary>
25-
public RegionalAuthority? RegionalAuthority { get; set; } = Azure.Identity.RegionalAuthority.FromEnvironment();
25+
internal RegionalAuthority? RegionalAuthority { get; set; } = Azure.Identity.RegionalAuthority.FromEnvironment();
2626
}
2727
}

sdk/identity/Azure.Identity/src/ClientSecretCredentialOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public class ClientSecretCredentialOptions : TokenCredentialOptions, ITokenCache
1717
/// Specifies either the specific <see cref="RegionalAuthority"/> (preferred), or use <see cref="RegionalAuthority.AutoDiscoverRegion"/> to attempt to auto-detect the region.
1818
/// If not specified or auto-detection fails the non-regional endpoint will be used.
1919
/// </summary>
20-
public RegionalAuthority? RegionalAuthority { get; set; } = Azure.Identity.RegionalAuthority.FromEnvironment();
20+
internal RegionalAuthority? RegionalAuthority { get; set; } = Azure.Identity.RegionalAuthority.FromEnvironment();
2121
}
2222
}

sdk/identity/Azure.Identity/src/InMemoryTokenCacheOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System;
5+
using System.Threading;
56
using System.Threading.Tasks;
67

78
namespace Azure.Identity

sdk/identity/Azure.Identity/src/OnBehalfOfCredential.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,27 @@ public OnBehalfOfCredential(string tenantId, string clientId, X509Certificate2 c
4848
/// <param name="clientCertificate">The authentication X509 Certificate of the service principal</param>
4949
/// <param name="userAssertion">The access token that will be used by <see cref="OnBehalfOfCredential"/> as the user assertion when requesting On-Behalf-Of tokens.</param>
5050
/// <param name="options">Options that allow to configure the management of the requests sent to the Azure Active Directory service.</param>
51-
public OnBehalfOfCredential(string tenantId, string clientId, X509Certificate2 clientCertificate, string userAssertion, OnBehalfOfCredentialOptions options)
51+
public OnBehalfOfCredential(string tenantId, string clientId, X509Certificate2 clientCertificate, string userAssertion, OnBehalfOfCredentialOptions options = null)
5252
: this(tenantId, clientId, clientCertificate, userAssertion, options, null, null)
5353
{ }
5454

55+
/// <summary>
56+
/// Creates an instance of the <see cref="OnBehalfOfCredential"/> with the details needed to authenticate with Azure Active Directory.
57+
/// </summary>
58+
/// <param name="tenantId">The Azure Active Directory tenant (directory) Id of the service principal.</param>
59+
/// <param name="clientId">The client (application) ID of the service principal</param>
60+
/// <param name="clientSecret">A client secret that was generated for the App Registration used to authenticate the client.</param>
61+
/// <param name="userAssertion">The access token that will be used by <see cref="OnBehalfOfCredential"/> as the user assertion when requesting On-Behalf-Of tokens.</param>
62+
/// <param name="options">Options that allow to configure the management of the requests sent to the Azure Active Directory service.</param>
63+
public OnBehalfOfCredential(
64+
string tenantId,
65+
string clientId,
66+
string clientSecret,
67+
string userAssertion,
68+
OnBehalfOfCredentialOptions options)
69+
: this(tenantId, clientId, clientSecret, userAssertion, options, null, null)
70+
{ }
71+
5572
internal OnBehalfOfCredential(
5673
string tenantId,
5774
string clientId,
@@ -97,23 +114,6 @@ internal OnBehalfOfCredential(
97114
options.IsLoggingPIIEnabled);
98115
}
99116

100-
/// <summary>
101-
/// Creates an instance of the <see cref="OnBehalfOfCredential"/> with the details needed to authenticate with Azure Active Directory.
102-
/// </summary>
103-
/// <param name="tenantId">The Azure Active Directory tenant (directory) Id of the service principal.</param>
104-
/// <param name="clientId">The client (application) ID of the service principal</param>
105-
/// <param name="clientSecret">A client secret that was generated for the App Registration used to authenticate the client.</param>
106-
/// <param name="userAssertion">The access token that will be used by <see cref="OnBehalfOfCredential"/> as the user assertion when requesting On-Behalf-Of tokens.</param>
107-
/// <param name="options">Options that allow to configure the management of the requests sent to the Azure Active Directory service.</param>
108-
public OnBehalfOfCredential(
109-
string tenantId,
110-
string clientId,
111-
string clientSecret,
112-
string userAssertion,
113-
OnBehalfOfCredentialOptions options = null)
114-
: this(tenantId, clientId, clientSecret, userAssertion, options, null, null)
115-
{ }
116-
117117
internal OnBehalfOfCredential(
118118
string tenantId,
119119
string clientId,

sdk/identity/Azure.Identity/src/OnBehalfOfCredentialOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public class OnBehalfOfCredentialOptions : TokenCredentialOptions, ITokenCacheOp
2222
/// Specifies either the specific <see cref="RegionalAuthority"/> (preferred), or use <see cref="RegionalAuthority.AutoDiscoverRegion"/> to attempt to auto-detect the region.
2323
/// If not specified or auto-detection fails the non-regional endpoint will be used.
2424
/// </summary>
25-
public RegionalAuthority? RegionalAuthority { get; set; } = Azure.Identity.RegionalAuthority.FromEnvironment();
25+
internal RegionalAuthority? RegionalAuthority { get; set; } = Azure.Identity.RegionalAuthority.FromEnvironment();
2626
}
2727
}

sdk/identity/Azure.Identity/src/RegionalAuthority.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Azure.Identity
1212
/// <summary>
1313
/// Identifies the regional authority to be used for authentication.
1414
/// </summary>
15-
public readonly struct RegionalAuthority : IEquatable<RegionalAuthority>
15+
internal readonly struct RegionalAuthority : IEquatable<RegionalAuthority>
1616
{
1717
internal const string USWestValue = "westus";
1818
internal const string USWest2Value = "westus2";

0 commit comments

Comments
 (0)