This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Porting System.Security.Claims #4933
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Changes to system.security.claims
- Loading branch information
commit 353640643c1cc528f9688a289d0e80c0b317b3ae
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 17 additions & 31 deletions
48
src/System.Security.Claims/src/System.Security.Claims.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> | ||
<Import Project="..\dir.settings.targets" /> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||
<PropertyGroup> | ||
<DefineConstants>$(DefineConstants);PROJECTK</DefineConstants> | ||
<IsProjectNLibrary>true</IsProjectNLibrary> | ||
<IsNETCoreForCoreCLRLibrary>true</IsNETCoreForCoreCLRLibrary> | ||
<IsProjectKLibrary>true</IsProjectKLibrary> | ||
<IsTestNetLibrary>true</IsTestNetLibrary> | ||
<AssemblyName>System.Security.Claims</AssemblyName> | ||
<AssemblyVersion>4.0.1.0</AssemblyVersion> | ||
<OutputType>Library</OutputType> | ||
<ProjectGuid>{A70BEC0D-5A1C-4DA0-8A0F-69F3BF565D52}</ProjectGuid> | ||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks> | ||
<PackageTargetFramework>dotnet5.4</PackageTargetFramework> | ||
<PackageTargetFramework Condition="'$(PackageTargetFramework)'==''">dotnet5.4</PackageTargetFramework> | ||
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net46'">true</IsPartialFacadeAssembly> | ||
</PropertyGroup> | ||
<!-- Default configurations to help VS understand the options --> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|amd64' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|amd64' "> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System.Collections" /> | ||
<Reference Include="System.Globalization" /> | ||
<Reference Include="System.IO" /> | ||
<Reference Include="System.Resources.ResourceManager" /> | ||
<Reference Include="System.Runtime"> | ||
<Version>4.0.20.0</Version> | ||
</Reference> | ||
<Reference Include="System.Runtime.Extensions" /> | ||
<Reference Include="System.Security.Principal" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Debug|AnyCPU'" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Release|AnyCPU'" /> | ||
|
||
<ItemGroup Condition="'$(TargetGroup)'==''" > | ||
<Compile Include="System\Security\Claims\Claim.cs" /> | ||
<Compile Include="System\Security\Claims\ClaimsIdentity.cs" /> | ||
<Compile Include="System\Security\Claims\ClaimsPrincipal.cs" /> | ||
<Compile Include="System\Security\Claims\ClaimTypes.cs" /> | ||
<Compile Include="System\Security\Claims\ClaimValueTypes.cs" /> | ||
<Compile Include="System\Security\Claims\GenericIdentity.cs" /> | ||
<Compile Include="System\Security\Claims\GenericPrincipal.cs" /> | ||
<Compile Include="System\Security\Claims\GenericPrincipal.cs" /> | ||
</ItemGroup> | ||
<ItemGroup Condition="'$(TargetGroup)'=='net46'"> | ||
<TargetingPackReference Include="mscorlib" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="project.json" /> | ||
</ItemGroup> | ||
<Import Project="..\dir.targets" /> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
|
||
// | ||
|
||
// | ||
// ClaimsIdentity.cs | ||
// | ||
|
||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Diagnostics.Contracts; | ||
|
@@ -21,7 +14,6 @@ namespace System.Security.Claims | |
/// <summary> | ||
/// An Identity that is represented by a set of claims. | ||
/// </summary> | ||
[ComVisible(true)] | ||
public class ClaimsIdentity : IIdentity | ||
{ | ||
private enum SerializationMask | ||
|
@@ -288,7 +280,6 @@ public object BootstrapContext | |
{ | ||
get { return _bootstrapContext; } | ||
|
||
[SecurityCritical] | ||
set | ||
{ _bootstrapContext = value; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: formatting here looks strange |
||
} | ||
|
@@ -400,7 +391,6 @@ public virtual ClaimsIdentity Clone() | |
/// <param name="claim">the <see cref="Claim"/>add.</param> | ||
/// <remarks>If <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks> | ||
/// <exception cref="ArgumentNullException">if 'claim' is null.</exception> | ||
[SecurityCritical] | ||
public virtual void AddClaim(Claim claim) | ||
{ | ||
if (claim == null) | ||
|
@@ -426,7 +416,6 @@ public virtual void AddClaim(Claim claim) | |
/// <param name="claims">Enumeration of claims to add.</param> | ||
/// <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> | ||
/// <exception cref="ArgumentNullException">if 'claims' is null.</exception> | ||
[SecurityCritical] | ||
public virtual void AddClaims(IEnumerable<Claim> claims) | ||
{ | ||
if (claims == null) | ||
|
@@ -461,7 +450,6 @@ public virtual void AddClaims(IEnumerable<Claim> claims) | |
/// <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. | ||
/// <para>object.ReferenceEquals is used to 'match'.</para> | ||
/// </remarks> | ||
[SecurityCritical] | ||
public virtual bool TryRemoveClaim(Claim claim) | ||
{ | ||
if (claim == null) | ||
|
@@ -491,7 +479,6 @@ public virtual bool TryRemoveClaim(Claim claim) | |
/// <para>object.ReferenceEquals is used to 'match'.</para> | ||
/// </remarks> | ||
/// <exception cref="InvalidOperationException">if 'claim' cannot be removed.</exception> | ||
[SecurityCritical] | ||
public virtual void RemoveClaim(Claim claim) | ||
{ | ||
if (!TryRemoveClaim(claim)) | ||
|
@@ -508,7 +495,6 @@ public virtual void RemoveClaim(Claim claim) | |
/// </summary> | ||
/// <param name="claims">a <see cref="IEnumerable<Claim>"/> to add to </param> | ||
/// <remarks>private only call from constructor, adds to internal list.</remarks> | ||
[SecuritySafeCritical] | ||
private void SafeAddClaims(IEnumerable<Claim> claims) | ||
{ | ||
foreach (Claim claim in claims) | ||
|
@@ -531,7 +517,6 @@ private void SafeAddClaims(IEnumerable<Claim> claims) | |
/// Adds claim to intenal list. Calling Claim.Clone if Claim.Subject != this. | ||
/// </summary> | ||
/// <remarks>private only call from constructor, adds to internal list.</remarks> | ||
[SecuritySafeCritical] | ||
private void SafeAddClaim(Claim claim) | ||
{ | ||
if (claim == null) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
src/System.Security.Claims/src/facade/System.Security.Claims.csproj
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"frameworks": { | ||
"dotnet5.4": { | ||
"dependencies": { | ||
"System.Collections": "4.0.0", | ||
"System.Diagnostics.Contracts": "4.0.0", | ||
"System.Globalization": "4.0.0", | ||
"System.IO": "4.0.0", | ||
"System.Resources.ResourceManager": "4.0.0", | ||
"System.Runtime": "4.0.20", | ||
"System.Runtime.Extensions": "4.0.0", | ||
"System.Security.Principal": "4.0.0" | ||
} | ||
}, | ||
"net46":{ | ||
"dependencies": { | ||
"Microsoft.TargetingPack.NetFramework.v4.6": "1.0.0", | ||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplication of facade\System.Secrit.Claims.csproj configuration. As part of your change you should eliminate the facade folder completely given you have folded it into this project. Also condition this on TargetsWindows=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@venkat-raman251 please collapse these net46 configurations.