Author: kostat
Date: 2008-01-30 07:28:32 -0500 (Wed, 30 Jan 2008)
New Revision: 94367
Added:
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ProxyGenerator.cs
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.JavaEE.csproj
trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.dll.sources
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
Log:
implemented AuthenticationService, ProxyGenerator
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.JavaEE.csproj
===================================================================
--- trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.JavaEE.csproj
2008-01-30 11:12:53 UTC (rev 94366)
+++ trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.JavaEE.csproj
2008-01-30 12:28:32 UTC (rev 94367)
@@ -123,10 +123,12 @@
<Compile Include="System.Web.Script.Serialization\JSON\ReflectionUtils.cs"
/>
<Compile
Include="System.Web.Script.Serialization\ScriptIgnoreAttribute.cs" />
<Compile Include="System.Web.Script.Serialization\SimpleTypeResolver.cs" />
+ <Compile Include="System.Web.Script.Services\AuthenticationService.cs" />
<Compile Include="System.Web.Script.Services\ClientProxyHandler.cs" />
<Compile
Include="System.Web.Script.Services\GenerateScriptTypeAttribute.cs" />
<Compile Include="System.Web.Script.Services\LogicalTypeInfo.cs" />
<Compile Include="System.Web.Script.Services\ProfileService.cs" />
+ <Compile Include="System.Web.Script.Services\ProxyGenerator.cs" />
<Compile Include="System.Web.Script.Services\ResponseFormat.cs" />
<Compile Include="System.Web.Script.Services\RestHandler.cs" />
<Compile Include="System.Web.Script.Services\ScriptHandlerFactory.cs" />
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.dll.sources
===================================================================
--- trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.dll.sources
2008-01-30 11:12:53 UTC (rev 94366)
+++ trunk/mcs/class/System.Web.Extensions/System.Web.Extensions.dll.sources
2008-01-30 12:28:32 UTC (rev 94367)
@@ -25,8 +25,10 @@
./System.Web.Script.Serialization/JSON/JavaScriptConvert.cs
./System.Web.Script.Serialization/JSON/JavaScriptUtils.cs
./System.Web.Script.Serialization/JSON/JavaScriptParameters.cs
+./System.Web.Script.Services/AuthenticationService.cs
./System.Web.Script.Services/GenerateScriptTypeAttribute.cs
./System.Web.Script.Services/ProfileService.cs
+./System.Web.Script.Services/ProxyGenerator.cs
./System.Web.Script.Services/ResponseFormat.cs
./System.Web.Script.Services/ScriptMethodAttribute.cs
./System.Web.Script.Services/ScriptServiceAttribute.cs
Added:
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
===================================================================
---
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
2008-01-30 11:12:53 UTC (rev 94366)
+++
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
2008-01-30 12:28:32 UTC (rev 94367)
@@ -0,0 +1,77 @@
+//
+// AuthenticationService.cs
+//
+// Author:
+// Konstantin Triger <[EMAIL PROTECTED]>
+//
+// (C) 2008 Mainsoft, Inc. http://www.mainsoft.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;
+using System.Collections.Generic;
+using System.Text;
+using System.Web.Services;
+using System.Web.Configuration;
+using System.Web.Security;
+
+namespace System.Web.Script.Services
+{
+ sealed class AuthenticationService
+ {
+ public const string DefaultWebServicePath =
"/Authentication_JSON_AppService.axd";
+
+ readonly ScriptingAuthenticationServiceSection _section;
+
+ public AuthenticationService () {
+ _section = (ScriptingAuthenticationServiceSection)
WebConfigurationManager.GetSection
("system.web.extensions/scripting/webServices/authenticationService");
+ }
+
+ ScriptingAuthenticationServiceSection
ScriptingProfileServiceSection {
+ get {
+ if (_section == null || !_section.Enabled)
+ throw new InvalidOperationException
("Authentication service is disabled.");
+
+ return _section;
+ }
+ }
+
+ [WebMethod ()]
+ public bool Login (string userName, string password, bool
createPersistentCookie) {
+
+ if (ScriptingProfileServiceSection.RequireSSL &&
!HttpContext.Current.Request.IsSecureConnection)
+ throw new HttpException ("SSL is required for
this operation.");
+
+ if (!Membership.Provider.ValidateUser (userName,
password))
+ return false;
+
+ FormsAuthentication.SetAuthCookie (userName,
createPersistentCookie);
+
+ return true;
+ }
+
+ [WebMethod ()]
+ public void Logout () {
+ FormsAuthentication.SignOut ();
+ }
+ }
+}
Added:
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ProxyGenerator.cs
===================================================================
---
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ProxyGenerator.cs
2008-01-30 11:12:53 UTC (rev 94366)
+++
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ProxyGenerator.cs
2008-01-30 12:28:32 UTC (rev 94367)
@@ -0,0 +1,42 @@
+//
+// ProxyGenerator.cs
+//
+// Author:
+// Konstantin Triger <[EMAIL PROTECTED]>
+//
+// (C) 2008 Mainsoft, Inc. http://www.mainsoft.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;
+using System.Collections.Generic;
+using System.Text;
+
+namespace System.Web.Script.Services
+{
+ public static class ProxyGenerator
+ {
+ public static string GetClientProxyScript (Type type, string
path, bool debug) {
+ return LogicalTypeInfo.GetLogicalTypeInfo (type,
path).Proxy;
+ }
+ }
+}
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
===================================================================
---
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
2008-01-30 11:12:53 UTC (rev 94366)
+++
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
2008-01-30 12:28:32 UTC (rev 94367)
@@ -43,15 +43,17 @@
}
#region IHttpHandlerFactory Members
- static readonly Type TypeOfProfileService = typeof
(ProfileService);
public IHttpHandler GetHandler (HttpContext context, string
requestType, string url, string pathTranslated) {
HttpRequest request = context.Request;
string contentType = request.ContentType;
if (!String.IsNullOrEmpty (contentType) &&
contentType.StartsWith ("application/json",
StringComparison.OrdinalIgnoreCase)) {
Type handlerType;
- if (url.EndsWith
(ProfileService.DefaultWebServicePath, StringComparison.Ordinal))
- handlerType = TypeOfProfileService;
+ if (url.EndsWith
(ProfileService.DefaultWebServicePath, StringComparison.Ordinal))
+ handlerType = typeof (ProfileService);
else
+ if (url.EndsWith
(AuthenticationService.DefaultWebServicePath, StringComparison.Ordinal))
+ handlerType =
typeof(AuthenticationService);
+ else
handlerType =
WebServiceParser.GetCompiledType (url, context);
return RestHandler.GetHandler (context,
handlerType, url);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches