forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpBindingSecurity.cs
More file actions
54 lines (46 loc) · 1.73 KB
/
HttpBindingSecurity.cs
File metadata and controls
54 lines (46 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ServiceModel;
namespace System.Web.Http.SelfHost.Channels
{
/// <summary>
/// Specifies the types of security available to a service endpoint configured to use an
/// <see cref="HttpBinding"/> binding.
/// </summary>
public sealed class HttpBindingSecurity
{
internal const HttpBindingSecurityMode DefaultMode = HttpBindingSecurityMode.None;
private HttpBindingSecurityMode _mode;
private HttpTransportSecurity _transportSecurity;
/// <summary>
/// Creates a new instance of the <see cref="HttpBindingSecurity"/> class.
/// </summary>
public HttpBindingSecurity()
{
_mode = DefaultMode;
_transportSecurity = new HttpTransportSecurity();
}
/// <summary>
/// Gets or sets the mode of security that is used by an endpoint configured to use an
/// <see cref="HttpBinding"/> binding.
/// </summary>
public HttpBindingSecurityMode Mode
{
get { return _mode; }
set
{
HttpBindingSecurityModeHelper.Validate(value, "value");
_mode = value;
}
}
/// <summary>
/// Gets or sets an object that contains the transport-level security settings for the
/// <see cref="HttpBinding"/> binding.
/// </summary>
public HttpTransportSecurity Transport
{
get { return _transportSecurity; }
set { _transportSecurity = value ?? new HttpTransportSecurity(); }
}
}
}