Skip to content

Commit 603e3cc

Browse files
Remove DebugProxy from ClaimsIdentity and ClaimsPrincipal (#91680)
Co-authored-by: David Cantú <[email protected]>
1 parent af44ecb commit 603e3cc

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

src/libraries/System.Security.Claims/src/System/Security/Claims/ClaimsIdentity.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace System.Security.Claims
1414
/// An Identity that is represented by a set of claims.
1515
/// </summary>
1616
[DebuggerDisplay("{DebuggerToString(),nq}")]
17-
[DebuggerTypeProxy(typeof(ClaimsIdentityDebugProxy))]
1817
public class ClaimsIdentity : IIdentity
1918
{
2019
private enum SerializationMask
@@ -962,26 +961,5 @@ internal string DebuggerToString()
962961

963962
return debugText;
964963
}
965-
966-
private sealed class ClaimsIdentityDebugProxy
967-
{
968-
private readonly ClaimsIdentity _identity;
969-
970-
public ClaimsIdentityDebugProxy(ClaimsIdentity identity)
971-
{
972-
_identity = identity;
973-
}
974-
975-
public ClaimsIdentity? Actor => _identity.Actor;
976-
public string? AuthenticationType => _identity.AuthenticationType;
977-
public object? BootstrapContext => _identity.BootstrapContext;
978-
// List type has a friendly debugger view
979-
public List<Claim> Claims => new List<Claim>(_identity.Claims);
980-
public bool IsAuthenticated => _identity.IsAuthenticated;
981-
public string? Label => _identity.Label;
982-
public string? Name => _identity.Name;
983-
public string NameClaimType => _identity.NameClaimType;
984-
public string RoleClaimType => _identity.RoleClaimType;
985-
}
986964
}
987965
}

src/libraries/System.Security.Claims/src/System/Security/Claims/ClaimsPrincipal.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ namespace System.Security.Claims
1515
/// Concrete IPrincipal supporting multiple claims-based identities
1616
/// </summary>
1717
[DebuggerDisplay("{DebuggerToString(),nq}")]
18-
[DebuggerTypeProxy(typeof(ClaimsPrincipalDebugProxy))]
1918
public class ClaimsPrincipal : IPrincipal
2019
{
2120
private enum SerializationMask
@@ -594,20 +593,5 @@ private string DebuggerToString()
594593

595594
return $"Identities = {identitiesCount}, Claims = {claimsCount}";
596595
}
597-
598-
private sealed class ClaimsPrincipalDebugProxy
599-
{
600-
private readonly ClaimsPrincipal _principal;
601-
602-
public ClaimsPrincipalDebugProxy(ClaimsPrincipal principal)
603-
{
604-
_principal = principal;
605-
}
606-
607-
// List type has a friendly debugger view
608-
public List<Claim> Claims => new List<Claim>(_principal.Claims);
609-
public List<ClaimsIdentity> Identities => new List<ClaimsIdentity>(_principal.Identities);
610-
public IIdentity? Identity => _principal.Identity;
611-
}
612596
}
613597
}

0 commit comments

Comments
 (0)