Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3536406

Browse files
dotnet-botvenkat-raman251
authored andcommitted
Changes to system.security.claims
1 parent 47a5917 commit 3536406

File tree

12 files changed

+40
-142
lines changed

12 files changed

+40
-142
lines changed

src/System.Security.Claims/src/System.Security.Claims.builds

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<ItemGroup>
5-
<Project Include="facade\System.Security.Claims.csproj" Condition="'$(TargetsWindows)' == 'true'">
6-
<AdditionalProperties>TargetGroup=net46</AdditionalProperties>
7-
</Project>
85
<Project Include="System.Security.Claims.csproj">
96
<AdditionalProperties>TargetGroup=</AdditionalProperties>
107
</Project>
11-
<Project Include="System.Security.Claims.csproj">
8+
<Project Include="System.Security.Claims.csproj" Condition="'$(TargetsWindows)' == 'true'">
129
<AdditionalProperties>TargetGroup=net46</AdditionalProperties>
1310
</Project>
1411
</ItemGroup>
Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,33 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
3-
<Import Project="..\dir.settings.targets" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<PropertyGroup>
5-
<DefineConstants>$(DefineConstants);PROJECTK</DefineConstants>
6-
<IsProjectNLibrary>true</IsProjectNLibrary>
7-
<IsNETCoreForCoreCLRLibrary>true</IsNETCoreForCoreCLRLibrary>
8-
<IsProjectKLibrary>true</IsProjectKLibrary>
9-
<IsTestNetLibrary>true</IsTestNetLibrary>
105
<AssemblyName>System.Security.Claims</AssemblyName>
116
<AssemblyVersion>4.0.1.0</AssemblyVersion>
12-
<OutputType>Library</OutputType>
137
<ProjectGuid>{A70BEC0D-5A1C-4DA0-8A0F-69F3BF565D52}</ProjectGuid>
14-
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
15-
<PackageTargetFramework>dotnet5.4</PackageTargetFramework>
8+
<PackageTargetFramework Condition="'$(PackageTargetFramework)'==''">dotnet5.4</PackageTargetFramework>
9+
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net46'">true</IsPartialFacadeAssembly>
1610
</PropertyGroup>
1711
<!-- Default configurations to help VS understand the options -->
18-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
19-
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
21-
</PropertyGroup>
22-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|amd64' ">
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|amd64' ">
25-
</PropertyGroup>
26-
<ItemGroup>
27-
<Reference Include="System.Collections" />
28-
<Reference Include="System.Globalization" />
29-
<Reference Include="System.IO" />
30-
<Reference Include="System.Resources.ResourceManager" />
31-
<Reference Include="System.Runtime">
32-
<Version>4.0.20.0</Version>
33-
</Reference>
34-
<Reference Include="System.Runtime.Extensions" />
35-
<Reference Include="System.Security.Principal" />
36-
</ItemGroup>
37-
<ItemGroup>
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
14+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Debug|AnyCPU'" />
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Release|AnyCPU'" />
16+
17+
<ItemGroup Condition="'$(TargetGroup)'==''" >
3818
<Compile Include="System\Security\Claims\Claim.cs" />
3919
<Compile Include="System\Security\Claims\ClaimsIdentity.cs" />
4020
<Compile Include="System\Security\Claims\ClaimsPrincipal.cs" />
4121
<Compile Include="System\Security\Claims\ClaimTypes.cs" />
4222
<Compile Include="System\Security\Claims\ClaimValueTypes.cs" />
4323
<Compile Include="System\Security\Claims\GenericIdentity.cs" />
44-
<Compile Include="System\Security\Claims\GenericPrincipal.cs" />
24+
<Compile Include="System\Security\Claims\GenericPrincipal.cs" />
25+
</ItemGroup>
26+
<ItemGroup Condition="'$(TargetGroup)'=='net46'">
27+
<TargetingPackReference Include="mscorlib" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<None Include="project.json" />
4531
</ItemGroup>
46-
<Import Project="..\dir.targets" />
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
4733
</Project>

src/System.Security.Claims/src/System/Security/Claims/Claim.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
//------------------------------------------------------------------------------
44

5-
6-
//
7-
8-
//
9-
// Claim.cs
10-
//
11-
125
using System.Collections.Generic;
136
using System.Diagnostics.Contracts;
147
using System.IO;

src/System.Security.Claims/src/System/Security/Claims/ClaimTypes.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
//------------------------------------------------------------------------------
44

5-
6-
//
7-
8-
//
9-
// ClaimTypes.cs
10-
//
11-
125
using System.Runtime.InteropServices;
136

147
namespace System.Security.Claims
158
{
169
/// <summary>
1710
/// Defines the claim types that are supported by the framework.
18-
/// </summary>
19-
[ComVisible(false)]
11+
/// </summary>
2012
public static class ClaimTypes
2113
{
2214
internal const string ClaimTypeNamespace = "http://schemas.microsoft.com/ws/2008/06/identity/claims";

src/System.Security.Claims/src/System/Security/Claims/ClaimValueTypes.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
//------------------------------------------------------------------------------
44

5-
6-
//
7-
8-
//
9-
// ClaimValueTypes.cs
10-
//
11-
125
using System.Runtime.InteropServices;
136

147
namespace System.Security.Claims
158
{
169
/// <summary>
1710
/// Defines the claim value types of the framework.
1811
/// </summary>
19-
[ComVisible(false)]
2012
public static class ClaimValueTypes
2113
{
2214
const string XmlSchemaNamespace = "http://www.w3.org/2001/XMLSchema";

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
5-
//
6-
7-
//
8-
// ClaimsIdentity.cs
9-
//
10-
114
using System.Collections.Generic;
125
using System.Collections.ObjectModel;
136
using System.Diagnostics.Contracts;
@@ -21,7 +14,6 @@ namespace System.Security.Claims
2114
/// <summary>
2215
/// An Identity that is represented by a set of claims.
2316
/// </summary>
24-
[ComVisible(true)]
2517
public class ClaimsIdentity : IIdentity
2618
{
2719
private enum SerializationMask
@@ -288,7 +280,6 @@ public object BootstrapContext
288280
{
289281
get { return _bootstrapContext; }
290282

291-
[SecurityCritical]
292283
set
293284
{ _bootstrapContext = value; }
294285
}
@@ -400,7 +391,6 @@ public virtual ClaimsIdentity Clone()
400391
/// <param name="claim">the <see cref="Claim"/>add.</param>
401392
/// <remarks>If <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
402393
/// <exception cref="ArgumentNullException">if 'claim' is null.</exception>
403-
[SecurityCritical]
404394
public virtual void AddClaim(Claim claim)
405395
{
406396
if (claim == null)
@@ -426,7 +416,6 @@ public virtual void AddClaim(Claim claim)
426416
/// <param name="claims">Enumeration of claims to add.</param>
427417
/// <remarks>Each claim is examined and if <see cref="Claim.Subject"/> != this, then then Claim.Clone(this) is called before the claim is added.</remarks>
428418
/// <exception cref="ArgumentNullException">if 'claims' is null.</exception>
429-
[SecurityCritical]
430419
public virtual void AddClaims(IEnumerable<Claim> claims)
431420
{
432421
if (claims == null)
@@ -461,7 +450,6 @@ public virtual void AddClaims(IEnumerable<Claim> claims)
461450
/// <remarks> It is possible that a <see cref="Claim"/> returned from <see cref="Claims"/> cannot be removed. This would be the case for 'External' claims that are provided by reference.
462451
/// <para>object.ReferenceEquals is used to 'match'.</para>
463452
/// </remarks>
464-
[SecurityCritical]
465453
public virtual bool TryRemoveClaim(Claim claim)
466454
{
467455
if (claim == null)
@@ -491,7 +479,6 @@ public virtual bool TryRemoveClaim(Claim claim)
491479
/// <para>object.ReferenceEquals is used to 'match'.</para>
492480
/// </remarks>
493481
/// <exception cref="InvalidOperationException">if 'claim' cannot be removed.</exception>
494-
[SecurityCritical]
495482
public virtual void RemoveClaim(Claim claim)
496483
{
497484
if (!TryRemoveClaim(claim))
@@ -508,7 +495,6 @@ public virtual void RemoveClaim(Claim claim)
508495
/// </summary>
509496
/// <param name="claims">a <see cref="IEnumerable<Claim>"/> to add to </param>
510497
/// <remarks>private only call from constructor, adds to internal list.</remarks>
511-
[SecuritySafeCritical]
512498
private void SafeAddClaims(IEnumerable<Claim> claims)
513499
{
514500
foreach (Claim claim in claims)
@@ -531,7 +517,6 @@ private void SafeAddClaims(IEnumerable<Claim> claims)
531517
/// Adds claim to intenal list. Calling Claim.Clone if Claim.Subject != this.
532518
/// </summary>
533519
/// <remarks>private only call from constructor, adds to internal list.</remarks>
534-
[SecuritySafeCritical]
535520
private void SafeAddClaim(Claim claim)
536521
{
537522
if (claim == null)

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
//------------------------------------------------------------------------------
44

5-
6-
//
7-
8-
//
9-
// ClaimPrincipal.cs
10-
//
11-
125
using System.Collections.Generic;
136
using System.Diagnostics.Contracts;
147
using System.IO;
@@ -20,7 +13,6 @@ namespace System.Security.Claims
2013
/// <summary>
2114
/// Concrete IPrincipal supporting multiple claims-based identities
2215
/// </summary>
23-
[ComVisible(true)]
2416
public class ClaimsPrincipal : IPrincipal
2517
{
2618
private enum SerializationMask
@@ -63,7 +55,6 @@ public static Func<IEnumerable<ClaimsIdentity>, ClaimsIdentity> PrimaryIdentityS
6355
{
6456
return s_identitySelector;
6557
}
66-
[SecurityCritical]
6758
set
6859
{
6960
s_identitySelector = value;
@@ -76,7 +67,6 @@ public static Func<ClaimsPrincipal> ClaimsPrincipalSelector
7667
{
7768
return s_principalSelector;
7869
}
79-
[SecurityCritical]
8070
set
8171
{
8272
s_principalSelector = value;
@@ -183,7 +173,6 @@ public ClaimsPrincipal(BinaryReader reader)
183173
/// </summary>
184174
/// <param name="identity">the <see cref="ClaimsIdentity"/>add.</param>
185175
/// <exception cref="ArgumentNullException">if 'identity' is null.</exception>
186-
[SecurityCritical]
187176
public virtual void AddIdentity(ClaimsIdentity identity)
188177
{
189178
if (identity == null)
@@ -201,7 +190,6 @@ public virtual void AddIdentity(ClaimsIdentity identity)
201190
/// </summary>
202191
/// <param name="identities">Enumeration of ClaimsIdentities to add.</param>
203192
/// <exception cref="ArgumentNullException">if 'identities' is null.</exception>
204-
[SecurityCritical]
205193
public virtual void AddIdentities(IEnumerable<ClaimsIdentity> identities)
206194
{
207195
if (identities == null)

src/System.Security.Claims/src/System/Security/Claims/GenericIdentity.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
5-
//
6-
7-
//
8-
// GenericIdentity.cs
9-
//
10-
// A generic identity
11-
//
12-
134
using System;
145
using System.Diagnostics.Contracts;
156
using System.Security.Claims;
@@ -24,7 +15,6 @@ public class GenericIdentity : ClaimsIdentity
2415
private string m_name;
2516
private string m_type;
2617

27-
[SecuritySafeCritical]
2818
public GenericIdentity(string name)
2919
{
3020
if (name == null)
@@ -37,7 +27,6 @@ public GenericIdentity(string name)
3727
AddNameClaim();
3828
}
3929

40-
[SecuritySafeCritical]
4130
public GenericIdentity(string name, string type)
4231
{
4332
if (name == null)
@@ -106,7 +95,6 @@ public override bool IsAuthenticated
10695
}
10796

10897

109-
[SecuritySafeCritical]
11098
private void AddNameClaim()
11199
{
112100
if (m_name != null)

src/System.Security.Claims/src/System/Security/Claims/GenericPrincipal.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
5-
//
6-
7-
//
8-
// GenericPrincipal.cs
9-
//
10-
114
using System;
125
using System.Collections.Generic;
136
using System.Diagnostics.Contracts;
@@ -48,7 +41,6 @@ public GenericPrincipal(IIdentity identity, string[] roles)
4841
/// <summary>
4942
/// helper method to add roles
5043
/// </summary>
51-
[SecuritySafeCritical]
5244
void AddIdentityWithRoles(IIdentity identity, string[] roles)
5345
{
5446
ClaimsIdentity claimsIdentity = identity as ClaimsIdentity;

src/System.Security.Claims/src/facade/System.Security.Claims.csproj

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)