Permalink
Browse files

Moved old UserSession into a deprecated namespace to let users know t…

…here's a new supported Session/OAuth forthcoming.

ServiceBase now implements IServiceBase to allow for additional functionality to be added to via extension methods instead of inheritance.

Allow Adhoc Services to be defined/registered in Configure()

All Session/OAuth functionality are added via extension methods.
Merged Twitter OAuth service (based on @migueldeicaza's OAuthAuthorizer) into ServicesInterface project.
Added SessionFeature.Register() to ensure permanent and browser based session cookies are always set.
Added an Extensible IOAuthSession which supports being implemented by a custom user-defined type.
OAuth/Session uses any ICacheClient if defined, falls back to IRedisClientsManager which then fallsback to MemoryCacheClient.
  • Loading branch information...
1 parent e2ab673 commit 8fb8cc6437f0e23a566ba9afbd6a7ec675dade90 @mythz mythz committed Nov 2, 2011
Showing with 910 additions and 48 deletions.
  1. BIN NuGet/ServiceStack/lib/ServiceStack.Text.dll
  2. +1 −1 build/build.bat
  3. BIN lib/ServiceStack.Text.dll
  4. +2 −0 src/ServiceStack.Common/Web/HttpResult.cs
  5. +8 −0 src/ServiceStack.ServiceInterface/AuthenticateAttribute.cs
  6. +1 −1 src/ServiceStack.ServiceInterface/{Session → Deprecated.Session}/CachedUserSessionManager.cs
  7. +1 −1 src/ServiceStack.ServiceInterface/{Session → Deprecated.Session}/IUserSessionManager.cs
  8. +1 −1 src/ServiceStack.ServiceInterface/{Session → Deprecated.Session}/PublicAndPrivateClientSessions.cs
  9. +1 −1 src/ServiceStack.ServiceInterface/{Session → Deprecated.Session}/UserClientSession.cs
  10. +1 −1 src/ServiceStack.ServiceInterface/{Session → Deprecated.Session}/UserSession.cs
  11. +21 −0 src/ServiceStack.ServiceInterface/IServiceBase.cs
  12. +21 −0 src/ServiceStack.ServiceInterface/OAuth/IOAuthSession.cs
  13. +332 −0 src/ServiceStack.ServiceInterface/OAuth/OAuthAuthorizer.cs
  14. +32 −0 src/ServiceStack.ServiceInterface/OAuth/OAuthConfig.cs
  15. +122 −0 src/ServiceStack.ServiceInterface/OAuth/OAuthService.cs
  16. +58 −0 src/ServiceStack.ServiceInterface/OAuth/OAuthUserSession.cs
  17. +2 −3 src/ServiceStack.ServiceInterface/ServiceBase.cs
  18. +106 −0 src/ServiceStack.ServiceInterface/ServiceExtensions.cs
  19. +14 −5 src/ServiceStack.ServiceInterface/ServiceStack.ServiceInterface.csproj
  20. +33 −0 src/ServiceStack.ServiceInterface/SessionFeature.cs
  21. +5 −0 src/ServiceStack.ServiceInterface/Testing/BasicAppHost.cs
  22. +5 −0 src/ServiceStack.ServiceInterface/Testing/TestAppHost.cs
  23. +12 −0 src/ServiceStack/AppHostExtensions.cs
  24. +4 −0 src/ServiceStack/CacheAccess.Providers/MemoryCacheClient.cs
  25. +30 −0 src/ServiceStack/Configuration/ConfigurationResourceManager.cs
  26. +27 −22 src/ServiceStack/ServiceHost/ServiceController.cs
  27. +22 −2 src/ServiceStack/ServiceHost/ServiceManager.cs
  28. +1 −0 src/ServiceStack/ServiceStack.csproj
  29. +14 −5 src/ServiceStack/WebHost.EndPoints/AppHostBase.cs
  30. +2 −0 src/ServiceStack/WebHost.EndPoints/IAppHost.cs
  31. +14 −5 src/ServiceStack/WebHost.EndPoints/Support/HttpListenerBase.cs
  32. +8 −0 tests/ServiceStack.Common.Tests/MessagingTests.cs
  33. +4 −0 tests/ServiceStack.Common.Tests/ServiceStack.Common.Tests.csproj
  34. +5 −0 tests/ServiceStack.ServiceHost.Tests/Formats/ViewTests.cs
Binary file not shown.
View
@@ -7,12 +7,12 @@ SET BUILD=Release
COPY ..\src\RazorEngine\bin\%BUILD%\*.* ..\NuGet\ServiceStack\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\NuGet\ServiceStack\lib
+COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\chaweet\api\lib
COPY ..\src\RazorEngine\bin\%BUILD%\*.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\*.* ..\..\ServiceStack.Examples\lib
COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\ServiceStack.Contrib\lib
COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\ServiceStack.RedisWebServices\lib
-COPY ..\src\ServiceStack\bin\%BUILD%\*.* ..\..\chaweet\api\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Interfaces.dll ..\..\ServiceStack.Redis\lib
COPY ..\src\ServiceStack\bin\%BUILD%\ServiceStack.Text.dll ..\..\ServiceStack.Redis\lib
View
Binary file not shown.
@@ -200,5 +200,7 @@ public static HttpResult Status201Created(object response, string newLocationUri
}
};
}
+
+
}
}
@@ -0,0 +1,8 @@
+using System;
+
+namespace ServiceStack.ServiceInterface
+{
+ public class AuthenticateAttribute : Attribute
+ {
+ }
+}
@@ -14,7 +14,7 @@
using ServiceStack.CacheAccess;
using ServiceStack.Logging;
-namespace ServiceStack.ServiceInterface.Session
+namespace ServiceStack.ServiceInterface.Deprecated.Session
{
/// <summary>
/// Manages all the User Sessions into the ICacheClient provided
@@ -11,7 +11,7 @@
using System;
using System.Collections.Generic;
-namespace ServiceStack.ServiceInterface.Session
+namespace ServiceStack.ServiceInterface.Deprecated.Session
{
/// <summary>
/// Manager Interface listing all the methods required to manage a users session.
@@ -9,7 +9,7 @@
*/
-namespace ServiceStack.ServiceInterface.Session
+namespace ServiceStack.ServiceInterface.Deprecated.Session
{
/// <summary>
/// Holds a 'Secure' and 'Unsecure' client session for the user.
@@ -11,7 +11,7 @@
using System;
using ServiceStack.DesignPatterns.Model;
-namespace ServiceStack.ServiceInterface.Session
+namespace ServiceStack.ServiceInterface.Deprecated.Session
{
/// <summary>
/// Holds information on a single 'User Client' session.
@@ -12,7 +12,7 @@
using System.Collections.Generic;
using ServiceStack.Common;
-namespace ServiceStack.ServiceInterface.Session
+namespace ServiceStack.ServiceInterface.Deprecated.Session
{
/// <summary>
/// Holds all the data required for a User Session
@@ -0,0 +1,21 @@
+using ServiceStack.ServiceHost;
+using ServiceStack.WebHost.Endpoints;
+
+namespace ServiceStack.ServiceInterface
+{
+ public interface IServiceBase
+ {
+ IAppHost AppHost { get; set; }
+
+ /// <summary>
+ /// Resolve an alternate Web Service from ServiceStack's IOC container.
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
+ T ResolveService<T>();
+
+ T TryResolve<T>();
+
+ IRequestContext RequestContext { get; }
+ }
+}
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+namespace ServiceStack.ServiceInterface.OAuth
+{
+ public interface IOAuthSession
+ {
+ string ReferrerUrl { get; set; }
+ string Id { get; set; }
+ string OAuthToken { get; set; }
+ string AccessToken { get; set; }
+ string RequestToken { get; set; }
+ string RequestTokenSecret { get; set; }
+ DateTime CreatedAt { get; set; }
+ DateTime LastModified { get; set; }
+ bool IsAuthorized();
+ Dictionary<string, string> Items { get; }
+
+ void OnAuthenticated(OAuthService oAuthService, Dictionary<string, string> authInfo);
+ }
+}
Oops, something went wrong.

0 comments on commit 8fb8cc6

Please sign in to comment.