Przeglądaj źródła

more internal namespace moving.

svn path=/trunk/mcs/; revision=160234
Atsushi Eno 15 lat temu
rodzic
commit
6da7552dd2

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels.Security/ChangeLog

@@ -1,3 +1,8 @@
+2010-07-12  Atsushi Enomoto  <[email protected]>
+
+	* SecurityCapabilities.cs, SupportingTokenInfo.cs :
+	  new internal types, split from MessageSecurityBindingSupport.cs.
+
 2010-07-12  Atsushi Enomoto  <[email protected]>
 
 	* SecurityRequestContext.cs : revert extra and bogus changes I had

+ 172 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels.Security/SecurityCapabilities.cs

@@ -0,0 +1,172 @@
+//
+// SecurityCapabilities.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2005-2007 Novell, Inc.  http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.IdentityModel.Tokens;
+using System.Net.Security;
+using System.Security.Cryptography.Xml;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Security;
+using System.ServiceModel.Security.Tokens;
+
+using ReqType = System.ServiceModel.Security.Tokens.ServiceModelSecurityTokenRequirement;
+
+namespace System.ServiceModel.Channels.Security
+{
+	internal abstract class SecurityCapabilities
+		: ISecurityCapabilities
+	{
+		public abstract SecurityBindingElement Element { get; }
+
+		public abstract bool AllowSerializedSigningTokenOnReply { get; }
+
+		public abstract MessageProtectionOrder MessageProtectionOrder { get; }
+
+		public abstract SecurityTokenParameters InitiatorParameters { get; }
+
+		public abstract SecurityTokenParameters RecipientParameters { get; }
+
+		public abstract bool RequireSignatureConfirmation { get; }
+
+		public abstract string DefaultKeyWrapAlgorithm { get; }
+
+		public abstract string DefaultSignatureAlgorithm { get; }
+
+
+		// ISecurityCapabilities
+		// FIXME: implement correctly
+		public ProtectionLevel SupportedRequestProtectionLevel {
+			get { return ProtectionLevel.EncryptAndSign; }
+		}
+
+		public ProtectionLevel SupportedResponseProtectionLevel {
+			get { return ProtectionLevel.EncryptAndSign; }
+		}
+
+		public bool SupportsClientAuthentication {
+			get { return InitiatorParameters != null ? InitiatorParameters.InternalSupportsClientAuthentication : false; }
+		}
+
+		public bool SupportsClientWindowsIdentity {
+			get { return InitiatorParameters != null ? InitiatorParameters.InternalSupportsClientWindowsIdentity : false; }
+		}
+
+		public bool SupportsServerAuthentication {
+			get { return RecipientParameters != null ? RecipientParameters.InternalSupportsServerAuthentication : false; }
+		}
+	}
+
+	internal class SymmetricSecurityCapabilities : SecurityCapabilities
+	{
+		SymmetricSecurityBindingElement element;
+
+		public SymmetricSecurityCapabilities (
+			SymmetricSecurityBindingElement element)
+		{
+			this.element = element;
+		}
+
+		public override SecurityBindingElement Element {
+			get { return element; }
+		}
+
+		// FIXME: const true or false
+		public override bool AllowSerializedSigningTokenOnReply {
+			get { throw new NotImplementedException (); }
+		}
+
+		public override MessageProtectionOrder MessageProtectionOrder {
+			get { return element.MessageProtectionOrder; }
+		}
+
+		public override SecurityTokenParameters InitiatorParameters {
+			get { return element.ProtectionTokenParameters; }
+		}
+
+		public override SecurityTokenParameters RecipientParameters {
+			get { return element.ProtectionTokenParameters; }
+		}
+
+		public override bool RequireSignatureConfirmation {
+			get { return element.RequireSignatureConfirmation; }
+		}
+
+		public override string DefaultSignatureAlgorithm {
+			get { return element.DefaultAlgorithmSuite.DefaultSymmetricSignatureAlgorithm; }
+		}
+
+		public override string DefaultKeyWrapAlgorithm {
+			get { return element.DefaultAlgorithmSuite.DefaultSymmetricKeyWrapAlgorithm; }
+		}
+	}
+
+	internal class AsymmetricSecurityCapabilities : SecurityCapabilities
+	{
+		AsymmetricSecurityBindingElement element;
+
+		public AsymmetricSecurityCapabilities (
+			AsymmetricSecurityBindingElement element)
+		{
+			this.element = element;
+		}
+
+		public override bool AllowSerializedSigningTokenOnReply {
+			get { return element.AllowSerializedSigningTokenOnReply; }
+		}
+
+		public override SecurityBindingElement Element {
+			get { return element; }
+		}
+
+		public override MessageProtectionOrder MessageProtectionOrder {
+			get { return element.MessageProtectionOrder; }
+		}
+
+		public override SecurityTokenParameters InitiatorParameters {
+			get { return element.InitiatorTokenParameters; }
+		}
+
+		public override SecurityTokenParameters RecipientParameters {
+			get { return element.RecipientTokenParameters; }
+		}
+
+		public override bool RequireSignatureConfirmation {
+			get { return element.RequireSignatureConfirmation; }
+		}
+
+		public override string DefaultSignatureAlgorithm {
+			get { return element.DefaultAlgorithmSuite.DefaultAsymmetricSignatureAlgorithm; }
+		}
+
+		public override string DefaultKeyWrapAlgorithm {
+			get { return element.DefaultAlgorithmSuite.DefaultAsymmetricKeyWrapAlgorithm; }
+		}
+	}
+}

+ 70 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels.Security/SupportingTokenInfo.cs

@@ -0,0 +1,70 @@
+//
+// SupportingTokenInfo.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+// Copyright (C) 2005-2007 Novell, Inc.  http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.IdentityModel.Tokens;
+using System.Net.Security;
+using System.Security.Cryptography.Xml;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Security;
+using System.ServiceModel.Security.Tokens;
+
+using ReqType = System.ServiceModel.Security.Tokens.ServiceModelSecurityTokenRequirement;
+
+namespace System.ServiceModel.Channels.Security
+{
+	internal class SupportingTokenInfo
+	{
+		public SupportingTokenInfo (SecurityToken token,
+			SecurityTokenAttachmentMode mode,
+			bool isOptional)
+		{
+			Token = token;
+			Mode = mode;
+			IsOptional = isOptional;
+		}
+
+		public SecurityToken Token;
+		public SecurityTokenAttachmentMode Mode;
+		public bool IsOptional;
+		public EncryptedData Encrypted;
+	}
+
+	internal class SupportingTokenInfoCollection : Collection<SupportingTokenInfo>
+	{
+		protected override void InsertItem (int index, SupportingTokenInfo item)
+		{
+			foreach (SupportingTokenInfo i in this)
+				if (i.Token.GetType () == item.Token.GetType ())
+					throw new ArgumentException (String.Format ("Supporting tokens do not allow multiple SecurityTokens of the same type: {0}", i.Token.GetType ()));
+			base.InsertItem (index, item);
+		}
+	}
+}

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog

@@ -1,3 +1,8 @@
+2010-07-12  Atsushi Enomoto  <[email protected]>
+
+	* MessageSecurityBindingSupport.cs : split a couple of classes out.
+	  Changed namespace to internal one.
+
 2010-07-12  Atsushi Enomoto  <[email protected]>
 
 	* SecurityChannelFactory.cs

+ 1 - 159
mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageSecurityBindingSupport.cs

@@ -38,36 +38,8 @@ using System.ServiceModel.Security.Tokens;
 
 using ReqType = System.ServiceModel.Security.Tokens.ServiceModelSecurityTokenRequirement;
 
-namespace System.ServiceModel.Channels
+namespace System.ServiceModel.Channels.Security
 {
-	internal class SupportingTokenInfo
-	{
-		public SupportingTokenInfo (SecurityToken token,
-			SecurityTokenAttachmentMode mode,
-			bool isOptional)
-		{
-			Token = token;
-			Mode = mode;
-			IsOptional = isOptional;
-		}
-
-		public SecurityToken Token;
-		public SecurityTokenAttachmentMode Mode;
-		public bool IsOptional;
-		public EncryptedData Encrypted;
-	}
-
-	internal class SupportingTokenInfoCollection : Collection<SupportingTokenInfo>
-	{
-		protected override void InsertItem (int index, SupportingTokenInfo item)
-		{
-			foreach (SupportingTokenInfo i in this)
-				if (i.Token.GetType () == item.Token.GetType ())
-					throw new ArgumentException (String.Format ("Supporting tokens do not allow multiple SecurityTokens of the same type: {0}", i.Token.GetType ()));
-			base.InsertItem (index, item);
-		}
-	}
-
 	internal abstract class MessageSecurityBindingSupport
 	{
 		SecurityTokenManager manager;
@@ -472,134 +444,4 @@ namespace System.ServiceModel.Channels
 			return SecurityTokenManager.CreateSecurityTokenAuthenticator (r, out resolver);
 		}
 	}
-
-	internal abstract class SecurityCapabilities
-		: ISecurityCapabilities
-	{
-		public abstract SecurityBindingElement Element { get; }
-
-		public abstract bool AllowSerializedSigningTokenOnReply { get; }
-
-		public abstract MessageProtectionOrder MessageProtectionOrder { get; }
-
-		public abstract SecurityTokenParameters InitiatorParameters { get; }
-
-		public abstract SecurityTokenParameters RecipientParameters { get; }
-
-		public abstract bool RequireSignatureConfirmation { get; }
-
-		public abstract string DefaultKeyWrapAlgorithm { get; }
-
-		public abstract string DefaultSignatureAlgorithm { get; }
-
-
-		// ISecurityCapabilities
-		// FIXME: implement correctly
-		public ProtectionLevel SupportedRequestProtectionLevel {
-			get { return ProtectionLevel.EncryptAndSign; }
-		}
-
-		public ProtectionLevel SupportedResponseProtectionLevel {
-			get { return ProtectionLevel.EncryptAndSign; }
-		}
-
-		public bool SupportsClientAuthentication {
-			get { return InitiatorParameters != null ? InitiatorParameters.InternalSupportsClientAuthentication : false; }
-		}
-
-		public bool SupportsClientWindowsIdentity {
-			get { return InitiatorParameters != null ? InitiatorParameters.InternalSupportsClientWindowsIdentity : false; }
-		}
-
-		public bool SupportsServerAuthentication {
-			get { return RecipientParameters != null ? RecipientParameters.InternalSupportsServerAuthentication : false; }
-		}
-	}
-
-	internal class SymmetricSecurityCapabilities : SecurityCapabilities
-	{
-		SymmetricSecurityBindingElement element;
-
-		public SymmetricSecurityCapabilities (
-			SymmetricSecurityBindingElement element)
-		{
-			this.element = element;
-		}
-
-		public override SecurityBindingElement Element {
-			get { return element; }
-		}
-
-		// FIXME: const true or false
-		public override bool AllowSerializedSigningTokenOnReply {
-			get { throw new NotImplementedException (); }
-		}
-
-		public override MessageProtectionOrder MessageProtectionOrder {
-			get { return element.MessageProtectionOrder; }
-		}
-
-		public override SecurityTokenParameters InitiatorParameters {
-			get { return element.ProtectionTokenParameters; }
-		}
-
-		public override SecurityTokenParameters RecipientParameters {
-			get { return element.ProtectionTokenParameters; }
-		}
-
-		public override bool RequireSignatureConfirmation {
-			get { return element.RequireSignatureConfirmation; }
-		}
-
-		public override string DefaultSignatureAlgorithm {
-			get { return element.DefaultAlgorithmSuite.DefaultSymmetricSignatureAlgorithm; }
-		}
-
-		public override string DefaultKeyWrapAlgorithm {
-			get { return element.DefaultAlgorithmSuite.DefaultSymmetricKeyWrapAlgorithm; }
-		}
-	}
-
-	internal class AsymmetricSecurityCapabilities : SecurityCapabilities
-	{
-		AsymmetricSecurityBindingElement element;
-
-		public AsymmetricSecurityCapabilities (
-			AsymmetricSecurityBindingElement element)
-		{
-			this.element = element;
-		}
-
-		public override bool AllowSerializedSigningTokenOnReply {
-			get { return element.AllowSerializedSigningTokenOnReply; }
-		}
-
-		public override SecurityBindingElement Element {
-			get { return element; }
-		}
-
-		public override MessageProtectionOrder MessageProtectionOrder {
-			get { return element.MessageProtectionOrder; }
-		}
-
-		public override SecurityTokenParameters InitiatorParameters {
-			get { return element.InitiatorTokenParameters; }
-		}
-
-		public override SecurityTokenParameters RecipientParameters {
-			get { return element.RecipientTokenParameters; }
-		}
-
-		public override bool RequireSignatureConfirmation {
-			get { return element.RequireSignatureConfirmation; }
-		}
-
-		public override string DefaultSignatureAlgorithm {
-			get { return element.DefaultAlgorithmSuite.DefaultAsymmetricSignatureAlgorithm; }
-		}
-
-		public override string DefaultKeyWrapAlgorithm {
-			get { return element.DefaultAlgorithmSuite.DefaultAsymmetricKeyWrapAlgorithm; }
-		}
-	}
 }

+ 4 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog

@@ -1,3 +1,7 @@
+2010-07-12  Atsushi Enomoto  <[email protected]>
+
+	* SecurityHandler.cs : add new using. Though this class will vanish.
+
 2010-07-12  Atsushi Enomoto  <[email protected]>
 
 	* ChannelDispatcher.cs : apply ErrorHandlers to IInputChannel too.

+ 1 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/SecurityHandler.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 using System.ServiceModel.Channels;
+using System.ServiceModel.Channels.Security;
 using System.ServiceModel;
 using System.ServiceModel.Security.Tokens;
 

+ 2 - 0
mcs/class/System.ServiceModel/System.ServiceModel.dll.sources

@@ -305,12 +305,14 @@ System.ServiceModel.Channels.Http/HttpReplyChannel.cs
 System.ServiceModel.Channels.Http/HttpRequestContext.cs
 System.ServiceModel.Channels.Security/SecureMessageDecryptor.cs
 System.ServiceModel.Channels.Security/SecureMessageGenerator.cs
+System.ServiceModel.Channels.Security/SecurityCapabilities.cs
 System.ServiceModel.Channels.Security/SecurityChannelFactory.cs
 System.ServiceModel.Channels.Security/SecurityChannelListener.cs
 System.ServiceModel.Channels.Security/SecurityOutputChannel.cs
 System.ServiceModel.Channels.Security/SecurityReplyChannel.cs
 System.ServiceModel.Channels.Security/SecurityRequestChannel.cs
 System.ServiceModel.Channels.Security/SecurityRequestContext.cs
+System.ServiceModel.Channels.Security/SupportingTokenInfo.cs
 System.ServiceModel.Channels.Security/WSEncryptedXml.cs
 System.ServiceModel.Channels.Security/WSSecurityMessageHeader.cs
 System.ServiceModel.Channels.Security/WSSignedXml.cs