Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for WS2007HttpBinding plus some cleanup #4169

Merged
merged 1 commit into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ foreach ($argument in $PSBoundParameters.Keys)
"allconfigurations" { $arguments += " /p:BuildAllConfigurations=true" }
"arch" { $arguments += " /p:ArchGroup=$($PSBoundParameters[$argument]) /p:TargetArchitecture=$($PSBoundParameters[$argument])" }
"properties" { $arguments += " " + $properties }
"testscope" { if ($testscope -eq "outerloop" -or $testscope -eq "all") { $arguments += " /p:IntegrationTest=true" }}
default { $arguments += " /p:$argument=$($PSBoundParameters[$argument])" }
}
}
Expand Down
11 changes: 10 additions & 1 deletion src/System.Private.ServiceModel/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2499,4 +2499,13 @@
<data name="BasicHttpMessageSecurityRequiresCertificate" xml:space="preserve">
<value>BasicHttp binding requires that BasicHttpBinding.Security.Message.ClientCredentialType be equivalent to the BasicHttpMessageCredentialType.Certificate credential type for secure messages. Select Transport or TransportWithMessageCredential security for UserName credentials.</value>
</data>
</root>
<data name="NoCookieInSct" xml:space="preserve">
<value>The SecurityContextSecurityToken does not have a cookie.</value>
</data>
<data name="NoSecurityContextIdentifier" xml:space="preserve">
<value>The SecurityContextSecurityToken does not have a context-id.</value>
</data>
<data name="SecurityContextNotRegistered" xml:space="preserve">
<value>The SecurityContextSecurityToken with context-id={0} (key generation-id={1}) is not registered.</value>
</data>
</root>
30 changes: 15 additions & 15 deletions src/System.Private.ServiceModel/src/System.Private.ServiceModel.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.329
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Private.ServiceModel", "System.Private.ServiceModel.csproj", "{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.ServiceModel", "System.Private.ServiceModel.csproj", "{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,18 +15,18 @@ Global
uap-Windows_NT-Release|Any CPU = uap-Windows_NT-Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Debug|Any CPU.ActiveCfg = netstandard-Unix-Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Debug|Any CPU.Build.0 = netstandard-Unix-Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Release|Any CPU.ActiveCfg = netstandard-Unix-Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Release|Any CPU.Build.0 = netstandard-Unix-Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Debug|Any CPU.ActiveCfg = uap-Windows_NT-Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Debug|Any CPU.Build.0 = uap-Windows_NT-Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Release|Any CPU.ActiveCfg = uap-Windows_NT-Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Release|Any CPU.Build.0 = uap-Windows_NT-Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Debug|Any CPU.Build.0 = Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Release|Any CPU.ActiveCfg = Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Unix-Release|Any CPU.Build.0 = Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Debug|Any CPU.Build.0 = Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Release|Any CPU.ActiveCfg = Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.netstandard-Windows_NT-Release|Any CPU.Build.0 = Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Debug|Any CPU.Build.0 = Debug|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Release|Any CPU.ActiveCfg = Release|Any CPU
{9E50E7BF-CD6E-4269-A6DD-59FD0BD6C0FD}.uap-Windows_NT-Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Xml;

namespace System.ServiceModel.Security
{
sealed class SctClaimDictionary : XmlDictionary
{
private SctClaimDictionary()
{
SecurityContextSecurityToken = Add("SecurityContextSecurityToken");
Version = Add("Version");
ContextId = Add("ContextId");
Id = Add("Id");
Key = Add("Key");
IsCookieMode = Add("IsCookieMode");
ServiceContractId = Add("ServiceContractId");
EffectiveTime = Add("EffectiveTime");
ExpiryTime = Add("ExpiryTime");
KeyGeneration = Add("KeyGeneration");
KeyEffectiveTime = Add("KeyEffectiveTime");
KeyExpiryTime = Add("KeyExpiryTime");
Claim = Add("Claim");
ClaimSets = Add("ClaimSets");
ClaimSet = Add("ClaimSet");
Identities = Add("Identities");
PrimaryIdentity = Add("PrimaryIdentity");
PrimaryIssuer = Add("PrimaryIssuer");

X509CertificateClaimSet = Add("X509CertificateClaimSet");
SystemClaimSet = Add("SystemClaimSet");
WindowsClaimSet = Add("WindowsClaimSet");
AnonymousClaimSet = Add("AnonymousClaimSet");

BinaryClaim = Add("BinaryClaim");
DnsClaim = Add("DnsClaim");
GenericIdentity = Add("GenericIdentity");
AuthenticationType = Add("AuthenticationType");
Right = Add("Right");
HashClaim = Add("HashClaim");
MailAddressClaim = Add("MailAddressClaim");
NameClaim = Add("NameClaim");
RsaClaim = Add("RsaClaim");
SpnClaim = Add("SpnClaim");
SystemClaim = Add("SystemClaim");
UpnClaim = Add("UpnClaim");
UrlClaim = Add("UrlClaim");
WindowsSidClaim = Add("WindowsSidClaim");
DenyOnlySidClaim = Add("DenyOnlySidClaim");
WindowsSidIdentity = Add("WindowsSidIdentity");
X500DistinguishedNameClaim = Add("X500DistinguishedClaim");
X509ThumbprintClaim = Add("X509ThumbprintClaim");

Name = Add("Name");
Sid = Add("Sid");
Value = Add("Value");
NullValue = Add("Null");
GenericXmlSecurityToken = Add("GenericXmlSecurityToken");
TokenType = Add("TokenType");
InternalTokenReference = Add("InternalTokenReference");
ExternalTokenReference = Add("ExternalTokenReference");
TokenXml = Add("TokenXml");
EmptyString = Add(string.Empty);
}

public static SctClaimDictionary Instance { get; } = new SctClaimDictionary();

public XmlDictionaryString Claim { get; }

public XmlDictionaryString ClaimSets { get; }

public XmlDictionaryString ClaimSet { get; }

public XmlDictionaryString PrimaryIssuer { get; }

public XmlDictionaryString Identities { get; }

public XmlDictionaryString PrimaryIdentity { get; }

public XmlDictionaryString X509CertificateClaimSet { get; }

public XmlDictionaryString SystemClaimSet { get; }

public XmlDictionaryString WindowsClaimSet { get; }

public XmlDictionaryString AnonymousClaimSet { get; }

public XmlDictionaryString ContextId { get; }

public XmlDictionaryString BinaryClaim { get; }

public XmlDictionaryString DnsClaim { get; }

public XmlDictionaryString GenericIdentity { get; }

public XmlDictionaryString AuthenticationType { get; }

public XmlDictionaryString Right { get; }

public XmlDictionaryString HashClaim { get; }

public XmlDictionaryString MailAddressClaim { get; }

public XmlDictionaryString NameClaim { get; }

public XmlDictionaryString RsaClaim { get; }

public XmlDictionaryString SpnClaim { get; }

public XmlDictionaryString SystemClaim { get; }

public XmlDictionaryString UpnClaim { get; }

public XmlDictionaryString UrlClaim { get; }

public XmlDictionaryString WindowsSidClaim { get; }

public XmlDictionaryString DenyOnlySidClaim { get; }

public XmlDictionaryString WindowsSidIdentity { get; }

public XmlDictionaryString X500DistinguishedNameClaim { get; }

public XmlDictionaryString X509ThumbprintClaim { get; }

public XmlDictionaryString EffectiveTime { get; }

public XmlDictionaryString ExpiryTime { get; }

public XmlDictionaryString Id { get; }

public XmlDictionaryString IsCookieMode { get; }

public XmlDictionaryString Key { get; }

public XmlDictionaryString Sid { get; }

public XmlDictionaryString Name { get; }

public XmlDictionaryString NullValue { get; }

public XmlDictionaryString SecurityContextSecurityToken { get; }

public XmlDictionaryString ServiceContractId { get; }

public XmlDictionaryString Value { get; }

public XmlDictionaryString Version { get; }

public XmlDictionaryString GenericXmlSecurityToken { get; }

public XmlDictionaryString TokenType { get; }

public XmlDictionaryString TokenXml { get; }

public XmlDictionaryString InternalTokenReference { get; }

public XmlDictionaryString ExternalTokenReference { get; }

public XmlDictionaryString EmptyString { get; }

public XmlDictionaryString KeyGeneration { get; }

public XmlDictionaryString KeyEffectiveTime { get; }

public XmlDictionaryString KeyExpiryTime { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public SecurityStandardsManager(MessageSecurityVersion messageSecurityVersion, S
_tokenSerializer = tokenSerializer ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenSerializer));
if (messageSecurityVersion.SecureConversationVersion == SecureConversationVersion.WSSecureConversation13)
{
throw ExceptionHelper.PlatformNotSupported();
SecureConversationDriver = new WSSecureConversationDec2005.DriverDec2005();
}
else
{
Expand All @@ -55,7 +55,7 @@ public SecurityStandardsManager(MessageSecurityVersion messageSecurityVersion, S
TrustDriver = null;
if (messageSecurityVersion.MessageSecurityTokenVersion.TrustVersion == TrustVersion.WSTrust13)
{
throw ExceptionHelper.PlatformNotSupported();
TrustDriver = new WSTrustDec2005.DriverDec2005(this);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.ServiceModel.Security.Tokens
{
public interface ISecurityContextSecurityTokenCache
internal interface ISecurityContextSecurityTokenCache
mconnew marked this conversation as resolved.
Show resolved Hide resolved
{
void AddContext(SecurityContextSecurityToken token);
bool TryAddContext(SecurityContextSecurityToken token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public SecurityKeyType KeyType
set
{
SecurityKeyTypeHelper.Validate(value);
if(value == SecurityKeyType.BearerKey)
{
throw ExceptionHelper.PlatformNotSupported();
}

_keyType = value;
}
}
Expand Down

This file was deleted.

Loading