[eglib] make g_mkdir_with_parents work for paths not ending in /
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Security.Tokens / ServiceModelSecurityTokenRequirement.cs
1 //
2 // ServiceModelSecurityTokenRequirement.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2006 Novell, Inc.  http://www.novell.com
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 using System.Collections.Generic;
29 using System.IdentityModel.Selectors;
30 using System.IdentityModel.Tokens;
31 using System.ServiceModel.Channels;
32 using System.ServiceModel.Security;
33 using System.Text;
34
35 namespace System.ServiceModel.Security.Tokens
36 {
37         public abstract class ServiceModelSecurityTokenRequirement :
38                 SecurityTokenRequirement
39         {
40                 protected ServiceModelSecurityTokenRequirement ()
41                 {
42                 }
43
44                 protected const string Namespace = "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement";
45
46                 public static string AuditLogLocationProperty {
47                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/AuditLogLocation"; }
48                 }
49
50                 public static string ChannelParametersCollectionProperty {
51                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/ChannelParametersCollection"; }
52                 }
53
54                 public static string DuplexClientLocalAddressProperty {
55                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/DuplexClientLocalAddress"; }
56                 }
57
58                 public static string EndpointFilterTableProperty {
59                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/EndpointFilterTable"; }
60                 }
61
62                 public static string ExtendedProtectionPolicy {
63                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/ExtendedProtectionPolicy"; }
64                 }
65
66                 public static string HttpAuthenticationSchemeProperty {
67                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/HttpAuthenticationScheme"; }
68                 }
69
70                 public static string IsInitiatorProperty {
71                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/IsInitiator"; }
72                 }
73
74                 public static string IsOutOfBandTokenProperty {
75                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/IsOutOfBandToken"; }
76                 }
77
78                 public static string IssuedSecurityTokenParametersProperty {
79                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/IssuedSecurityTokenParameters"; }
80                 }
81
82                 public static string IssuerAddressProperty {
83                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/IssuerAddress"; }
84                 }
85
86                 public static string IssuerBindingContextProperty {
87                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/IssuerBindingContext"; }
88                 }
89
90                 public static string IssuerBindingProperty {
91                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/IssuerBinding"; }
92                 }
93
94                 public static string ListenUriProperty {
95                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/ListenUri"; }
96                 }
97
98                 public static string MessageAuthenticationAuditLevelProperty {
99                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/MessageAuthenticationAuditLevel"; }
100                 }
101
102                 public static string MessageDirectionProperty {
103                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/MessageDirection"; }
104                 }
105
106                 public static string MessageSecurityVersionProperty {
107                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/MessageSecurityVersion"; }
108                 }
109
110                 public static string PrivacyNoticeUriProperty {
111                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/PrivacyNoticeUri"; }
112                 }
113
114                 public static string PrivacyNoticeVersionProperty {
115                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/PrivacyNoticeVersion"; }
116                 }
117
118                 public static string SecureConversationSecurityBindingElementProperty {
119                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/SecureConversationSecurityBindingElement"; }
120                 }
121
122                 public static string SecurityAlgorithmSuiteProperty {
123                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/SecurityAlgorithmSuite"; }
124                 }
125
126                 public static string SecurityBindingElementProperty {
127                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/SecurityBindingElement"; }
128                 }
129
130                 public static string SupportingTokenAttachmentModeProperty {
131                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/SupportingTokenAttachmentMode"; }
132                 }
133
134                 public static string SupportSecurityContextCancellationProperty {
135                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/SupportSecurityContextCancellation"; }
136                 }
137
138                 public static string SuppressAuditFailureProperty {
139                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/SuppressAuditFailure"; }
140                 }
141
142                 public static string TargetAddressProperty {
143                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/TargetAddress"; }
144                 }
145
146                 public static string TransportSchemeProperty {
147                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/TransportScheme"; }
148                 }
149
150                 public static string ViaProperty {
151                         get { return "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement/Via"; }
152                 }
153
154                 public bool IsInitiator {
155                         get {
156                                 bool ret;
157                                 if (TryGetProperty<bool> (IsInitiatorProperty, out ret))
158                                         return ret;
159                                 return false;
160                         }
161                 }
162
163                 public EndpointAddress IssuerAddress {
164                         get {
165                                 EndpointAddress ret;
166                                 TryGetProperty<EndpointAddress> (IssuerAddressProperty, out ret);
167                                 return ret;
168                         }
169                         set { Properties [IssuerAddressProperty] = value; }
170                 }
171
172                 public Binding IssuerBinding {
173                         get {
174                                 Binding ret;
175                                 TryGetProperty<Binding> (IssuerBindingProperty, out ret);
176                                 return ret;
177                         }
178                         set { Properties [IssuerBindingProperty] = value; }
179                 }
180
181                 public SecurityTokenVersion MessageSecurityVersion {
182                         get {
183                                 SecurityTokenVersion ret;
184                                 TryGetProperty<SecurityTokenVersion> (MessageSecurityVersionProperty, out ret);
185                                 return ret;
186                         }
187                         set { Properties [MessageSecurityVersionProperty] = value; }
188                 }
189
190                 public SecurityBindingElement SecureConversationSecurityBindingElement {
191                         get {
192                                 SecurityBindingElement ret;
193                                 TryGetProperty<SecurityBindingElement> (SecureConversationSecurityBindingElementProperty, out ret);
194                                 return ret;
195                         }
196                         set { Properties [SecureConversationSecurityBindingElementProperty] = value; }
197                 }
198
199                 public SecurityAlgorithmSuite SecurityAlgorithmSuite {
200                         get {
201                                 SecurityAlgorithmSuite ret;
202                                 TryGetProperty<SecurityAlgorithmSuite> (SecurityAlgorithmSuiteProperty, out ret);
203                                 return ret;
204                         }
205                         set { Properties [SecurityAlgorithmSuiteProperty] = value; }
206                 }
207
208                 public SecurityBindingElement SecurityBindingElement {
209                         get {
210                                 SecurityBindingElement ret;
211                                 TryGetProperty<SecurityBindingElement> (SecurityBindingElementProperty, out ret);
212                                 return ret;
213                         }
214                         set { Properties [SecurityBindingElementProperty] = value; }
215                 }
216
217                 public string TransportScheme {
218                         get {
219                                 string ret;
220                                 TryGetProperty<string> (TransportSchemeProperty, out ret);
221                                 return ret;
222                         }
223                         set { Properties [TransportSchemeProperty] = value; }
224                 }
225
226                 internal string Dump ()
227                 {
228                         StringBuilder sb = new StringBuilder ();
229                         sb.Append (GetType ()).Append (":");
230                         foreach (KeyValuePair<string, object> p in Properties)
231                                 sb.Append ("\n------------\n")
232                                   .Append ("URI: ")
233                                   .Append (p.Key)
234                                   .Append ("\nValue: ")
235                                   .Append (p.Value);
236                         return sb.ToString ();
237                 }
238         }
239 }