Skip to content

Commit

Permalink
addressing pull request comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentschmaltz committed Nov 2, 2021
1 parent ab9b3c1 commit 0a105a9
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace System.ServiceModel.Federation
/// A service contract that defines the Issue request.
/// </summary>
[ServiceContract]
[ComVisible(false)]
public interface IWSTrustChannelContract : IWSTrustContract
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,11 @@ public class WSTrustChannel : IWSTrustChannelContract, IChannel, ICommunicationO
/// Constructs a <see cref="WSTrustChannel" />.
/// </summary>
/// <param name="channelfactory">The <see cref="ChannelFactory" /> that is creating this object.</param>
/// <param name="trustVersion">The version of WS-Trust this channel will use for serializing <see cref="Message" /> objects.</param>
public WSTrustChannel(ChannelFactory channelFactory,
WsTrustVersion trustVersion)
{
if (!(channelFactory is IRequestChannel requestChannel))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetResourceString(SR.ChannelFactoryMustSupportIRequestChannel)));

Initialize(channelFactory, requestChannel, trustVersion);
}

/// <summary>
/// Constructs a <see cref="WSTrustChannel" />.
/// </summary>
/// <param name="channelfactory">The <see cref="Federation.ChannelFactory" /> that is creating this object.</param>
/// <param name="requestChannel">The <see cref="IRequestChannel" /> this object will be used to send and receive <see cref="Message" /> objects.</param>
/// <param name="trustVersion">The version of WS-Trust this channel will use for serializing <see cref="Message" /> objects.</param>
public WSTrustChannel(ChannelFactory channelfactory,
IRequestChannel requestChannel,
WsTrustVersion trustVersion)
{
Initialize(channelfactory, requestChannel, trustVersion);
}

private void Initialize(ChannelFactory channelfactory,
IRequestChannel requestChannel,
WsTrustVersion trustVersion)
{
_ = channelfactory ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(channelfactory));
_ = requestChannel ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(requestChannel));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.Runtime.InteropServices;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using Microsoft.IdentityModel.Protocols.WsTrust;
Expand All @@ -12,19 +11,8 @@ namespace System.ServiceModel.Federation
/// <summary>
/// A <see cref="WSTrustChannelFactory" /> that produces <see cref="WSTrustChannel" /> objects used to communicate with a WS-Trust endpoint.
/// </summary>
[ComVisible(false)]
public class WSTrustChannelFactory : ChannelFactory<IWSTrustChannelContract>
{
/// <summary>
/// Initializes a new instance of the <see cref="WSTrustChannelFactory" /> class with a specified endpoint.
/// configuration name.
/// </summary>
/// <param name="endpointConfigurationName">The configuration name used for the endpoint.</param>
public WSTrustChannelFactory(string endpointConfigurationName)
: base(endpointConfigurationName)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="WSTrustChannelFactory" /> class with a specified endpoint.
/// </summary>
Expand All @@ -34,17 +22,6 @@ public WSTrustChannelFactory(ServiceEndpoint endpoint)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="WSTrustChannelFactory" /> class associated with a specified
/// name for the endpoint configuration and remote address.
/// </summary>
/// <param name="endpointConfigurationName">The configuration name used for the endpoint.</param>
/// <param name="remoteAddress">The <see cref="EndpointAddress" /> that provides the location of the service.</param>
public WSTrustChannelFactory(string endpointConfigurationName, EndpointAddress remoteAddress)
: base(endpointConfigurationName, remoteAddress)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="WSTrustChannelFactory" /> class with a specified binding
/// and endpoint address.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace System.ServiceModel.Federation
/// <see cref="WSTrustChannelSecurityTokenProvider"/> has been designed to work with the <see cref="WSFederationHttpBinding"/> to send a WsTrust message to obtain a SecurityToken from an STS. The SecurityToken is
/// added as an IssuedToken on the outbound WCF message.
/// </summary>
public static class WSTrustUtilities
internal static class WSTrustUtilities
{
/// <summary>
/// Gets the WsTrustVersion for the current MessageSecurityVersion.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class WSTrustChannelFactoryTest
[WcfFact]
public static void DefaultWSTrustChannelFactory()
{
WSTrustChannelFactory trustChannelFactory = new WSTrustChannelFactory((string)null, null);
WSTrustChannelFactory trustChannelFactory = new WSTrustChannelFactory(null, null);
}
}
}

0 comments on commit 0a105a9

Please sign in to comment.