Permalink
Browse files

Dropped the old version of SaasKit and added new Multitenant libs.

  • Loading branch information...
benfoster committed Jul 7, 2015
1 parent 1f912cd commit da8175451757a347eca958535c036272ce723be5
Showing with 803 additions and 1,223 deletions.
  1. 0 {src → }/.nuget/NuGet.Config
  2. BIN .nuget/NuGet.exe
  3. +7 −14 {src → }/.nuget/NuGet.targets
  4. 0 LICENSE → LICENSE.md
  5. +41 −0 SaasKit.sln
  6. BIN src/.nuget/NuGet.exe
  7. +0 −17 src/Demos/SaasKit.Demos.AspNet/Default.aspx
  8. +0 −14 src/Demos/SaasKit.Demos.AspNet/Default.aspx.cs
  9. +0 −33 src/Demos/SaasKit.Demos.AspNet/Default.aspx.designer.cs
  10. +0 −35 src/Demos/SaasKit.Demos.AspNet/Properties/AssemblyInfo.cs
  11. +0 −133 src/Demos/SaasKit.Demos.AspNet/SaasKit.Demos.AspNet.csproj
  12. +0 −32 src/Demos/SaasKit.Demos.AspNet/Startup.cs
  13. +0 −30 src/Demos/SaasKit.Demos.AspNet/Web.Debug.config
  14. +0 −31 src/Demos/SaasKit.Demos.AspNet/Web.Release.config
  15. +0 −11 src/Demos/SaasKit.Demos.AspNet/Web.config
  16. +0 −14 src/Demos/SaasKit.Demos.Nancy/App.config
  17. +0 −21 src/Demos/SaasKit.Demos.Nancy/Bootstrapper.cs
  18. +0 −14 src/Demos/SaasKit.Demos.Nancy/Controllers/HomeController.cs
  19. +0 −21 src/Demos/SaasKit.Demos.Nancy/Modules/HomeModule.cs
  20. +0 −24 src/Demos/SaasKit.Demos.Nancy/Program.cs
  21. +0 −57 src/Demos/SaasKit.Demos.Nancy/Startup.cs
  22. +0 −11 src/Demos/SaasKit.Demos.Nancy/Views/Tenant1/Home.html
  23. +0 −11 src/Demos/SaasKit.Demos.Nancy/Views/Tenant2/Home.html
  24. +0 −13 src/Demos/SaasKit.Demos.Nancy/packages.config
  25. +0 −15 src/SaasKit.Integration.Nancy/NancyContextExtensions.cs
  26. +0 −6 src/SaasKit.Integration.Nancy/packages.config
  27. +19 −0 src/SaasKit.Multitenancy.Mvc/HttpContextBaseExtensions.cs
  28. +4 −4 src/{SaasKit → SaasKit.Multitenancy.Mvc}/Properties/AssemblyInfo.cs
  29. +20 −13 ...ancy/SaasKit.Integration.Nancy.csproj → SaasKit.Multitenancy.Mvc/SaasKit.Multitenancy.Mvc.csproj}
  30. +2 −2 src/{Demos/SaasKit.Demos.AspNet → SaasKit.Multitenancy.Mvc}/packages.config
  31. +19 −0 src/SaasKit.Multitenancy.WebApi/HttpRequestMessageExtensions.cs
  32. +4 −4 src/{SaasKit.Integration.Nancy → SaasKit.Multitenancy.WebApi}/Properties/AssemblyInfo.cs
  33. +23 −48 ...ancy/SaasKit.Demos.Nancy.csproj → SaasKit.Multitenancy.WebApi/SaasKit.Multitenancy.WebApi.csproj}
  34. +9 −0 src/SaasKit.Multitenancy.WebApi/packages.config
  35. +45 −0 src/SaasKit.Multitenancy/AppBuilderExtensions.cs
  36. +59 −0 src/SaasKit.Multitenancy/CachedTenantResolver.cs
  37. +21 −0 src/SaasKit.Multitenancy/CurrentUserTenantResolver.cs
  38. +210 −0 src/SaasKit.Multitenancy/Ensure.cs
  39. +10 −0 src/SaasKit.Multitenancy/ITenantResolver.cs
  40. +67 −0 src/SaasKit.Multitenancy/Middleware/PrimaryHostnameRedirectMiddleware.cs
  41. +51 −0 src/SaasKit.Multitenancy/Middleware/TenantNotFoundRedirectMiddleware.cs
  42. +39 −0 src/SaasKit.Multitenancy/Middleware/TenantResolutionMiddleware.cs
  43. +45 −0 src/SaasKit.Multitenancy/OwinEnvironmentExtensions.cs
  44. +4 −4 src/{Demos/SaasKit.Demos.Nancy → SaasKit.Multitenancy}/Properties/AssemblyInfo.cs
  45. +12 −0 src/SaasKit.Multitenancy/RequestIdentification.cs
  46. +6 −0 src/SaasKit.Multitenancy/RequestIdentificationStrategy.cs
  47. +24 −26 src/{SaasKit/SaasKit.csproj → SaasKit.Multitenancy/SaasKit.Multitenancy.csproj}
  48. +41 −0 src/SaasKit.Multitenancy/TenantContext.cs
  49. +20 −0 src/SaasKit.Multitenancy/UriTenantResolver.cs
  50. +1 −1 src/{SaasKit → SaasKit.Multitenancy}/packages.config
  51. +0 −53 src/SaasKit.sln
  52. +0 −23 src/SaasKit/AppBuilderExtensions.cs
  53. +0 −8 src/SaasKit/Constants.cs
  54. +0 −11 src/SaasKit/IBootstrapper.cs
  55. +0 −11 src/SaasKit/IInstanceStore.cs
  56. +0 −11 src/SaasKit/ISaasKitEngine.cs
  57. +0 −11 src/SaasKit/ITenant.cs
  58. +0 −9 src/SaasKit/ITenantResolver.cs
  59. +0 −22 src/SaasKit/InstanceLifetimeOptions.cs
  60. +0 −99 src/SaasKit/MemoryCacheInstanceStore.cs
  61. +0 −18 src/SaasKit/OwinContextExtensions.cs
  62. +0 −14 src/SaasKit/RequestIdentificationStrategies.cs
  63. +0 −11 src/SaasKit/RequestIdentificationStrategy.cs
  64. +0 −29 src/SaasKit/SaasKitConfiguration.cs
  65. +0 −133 src/SaasKit/SaasKitEngine.cs
  66. +0 −28 src/SaasKit/SaasKitOwinAdapter.cs
  67. +0 −10 src/SaasKit/Tenant.cs
  68. +0 −63 src/SaasKit/TenantInstance.cs
File renamed without changes.
View
Binary file not shown.
@@ -36,29 +36,22 @@
</PropertyGroup>
<PropertyGroup>
- <PackagesProjectConfig>packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
+ <PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
+ <PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
</PropertyGroup>
- <Choose>
- <When Condition="Exists('$(PackagesProjectConfig)')">
- <PropertyGroup>
- <PackagesConfig>$(PackagesProjectConfig)</PackagesConfig>
- </PropertyGroup>
- </When>
- <When Condition="Exists('packages.config')">
- <PropertyGroup>
- <PackagesConfig>packages.config</PackagesConfig>
- </PropertyGroup>
- </When>
- </Choose>
+ <PropertyGroup>
+ <PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
+ <PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
+ </PropertyGroup>
<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
- <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
+ <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
View
File renamed without changes.
View
@@ -0,0 +1,41 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaasKit.Multitenancy", "src\SaasKit.Multitenancy\SaasKit.Multitenancy.csproj", "{75649D57-67F8-42FF-9751-F1E76127F64E}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{78843526-43BB-49AD-A0DD-5C1630F57D4F}"
+ ProjectSection(SolutionItems) = preProject
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.exe = .nuget\NuGet.exe
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaasKit.Multitenancy.Mvc", "src\SaasKit.Multitenancy.Mvc\SaasKit.Multitenancy.Mvc.csproj", "{F07816BE-1844-48DF-AF87-4A3B772C26A3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaasKit.Multitenancy.WebApi", "src\SaasKit.Multitenancy.WebApi\SaasKit.Multitenancy.WebApi.csproj", "{D969FF03-03A9-4DF4-9042-BB00F09CCA50}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {75649D57-67F8-42FF-9751-F1E76127F64E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {75649D57-67F8-42FF-9751-F1E76127F64E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {75649D57-67F8-42FF-9751-F1E76127F64E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {75649D57-67F8-42FF-9751-F1E76127F64E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F07816BE-1844-48DF-AF87-4A3B772C26A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F07816BE-1844-48DF-AF87-4A3B772C26A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F07816BE-1844-48DF-AF87-4A3B772C26A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F07816BE-1844-48DF-AF87-4A3B772C26A3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D969FF03-03A9-4DF4-9042-BB00F09CCA50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D969FF03-03A9-4DF4-9042-BB00F09CCA50}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D969FF03-03A9-4DF4-9042-BB00F09CCA50}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D969FF03-03A9-4DF4-9042-BB00F09CCA50}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
Binary file not shown.
@@ -1,17 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SaasKit.Demos.AspNet.Default" %>
-
-<!DOCTYPE html>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head runat="server">
- <title></title>
-</head>
-<body>
- <form id="form1" runat="server">
- <div>
- <h1>Hello Web Forms!</h1>
- </div>
- <asp:Label runat="server" ID="lblTenant" />
- </form>
-</body>
-</html>
@@ -1,14 +0,0 @@
-using System;
-using System.Web;
-
-namespace SaasKit.Demos.AspNet
-{
- public partial class Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- var currentTenant = Request.GetOwinContext().GetTenantInstance();
- lblTenant.Text = "Current Tenant: " + currentTenant;
- }
- }
-}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SaasKit.Demos.AspNet")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SaasKit.Demos.AspNet")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("007a4c28-e133-4258-bf11-8170ef0de142")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{2502D64D-EBB0-4DD4-8D69-FD2228CE87A1}</ProjectGuid>
- <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>SaasKit.Demos.AspNet</RootNamespace>
- <AssemblyName>SaasKit.Demos.AspNet</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <UseIISExpress>true</UseIISExpress>
- <IISExpressSSLPort />
- <IISExpressAnonymousAuthentication />
- <IISExpressWindowsAuthentication />
- <IISExpressUseClassicPipelineMode />
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="Microsoft.Owin">
- <HintPath>..\..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Owin.Host.SystemWeb">
- <HintPath>..\..\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
- </Reference>
- <Reference Include="Owin">
- <HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.DynamicData" />
- <Reference Include="System.Web.Entity" />
- <Reference Include="System.Web.ApplicationServices" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Core" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Web" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Web.Services" />
- <Reference Include="System.EnterpriseServices" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="packages.config" />
- <None Include="Web.Debug.config">
- <DependentUpon>Web.config</DependentUpon>
- </None>
- <None Include="Web.Release.config">
- <DependentUpon>Web.config</DependentUpon>
- </None>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Default.aspx" />
- <Content Include="Web.config" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Default.aspx.cs">
- <DependentUpon>Default.aspx</DependentUpon>
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="Default.aspx.designer.cs">
- <DependentUpon>Default.aspx</DependentUpon>
- </Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Startup.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\SaasKit\SaasKit.csproj">
- <Project>{c1c0a207-e53c-4fb4-a410-6254cfee30a6}</Project>
- <Name>SaasKit</Name>
- </ProjectReference>
- </ItemGroup>
- <PropertyGroup>
- <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
- <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
- <ProjectExtensions>
- <VisualStudio>
- <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
- <WebProjectProperties>
- <UseIIS>True</UseIIS>
- <AutoAssignPort>True</AutoAssignPort>
- <DevelopmentServerPort>1668</DevelopmentServerPort>
- <DevelopmentServerVPath>/</DevelopmentServerVPath>
- <IISUrl>http://localhost:1668/</IISUrl>
- <NTLMAuthentication>False</NTLMAuthentication>
- <UseCustomServer>False</UseCustomServer>
- <CustomServerUrl>
- </CustomServerUrl>
- <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
- </WebProjectProperties>
- </FlavorProperties>
- </VisualStudio>
- </ProjectExtensions>
- <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
@@ -1,32 +0,0 @@
-using Owin;
-using System.Threading.Tasks;
-
-namespace SaasKit.Demos.AspNet
-{
- public class Startup
- {
- public void Configuration(IAppBuilder app)
- {
- var engine = new SaasKitEngine(new SaasKitConfiguration
- {
- TenantResolver = new MyResolver()
- });
-
- app.UseSaasKit(engine);
- }
- }
-
- public class MyResolver : ITenantResolver
- {
- public Task<ITenant> Resolve(string tenantIdentifier)
- {
- var tenant = new Tenant
- {
- Name = "Tenant1",
- RequestIdentifiers = new[] { "localhost", "dev.local" }
- };
-
- return Task.FromResult<ITenant>(tenant);
- }
- }
-}
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
-
-<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
- <!--
- In the example below, the "SetAttributes" transform will change the value of
- "connectionString" to use "ReleaseSQLServer" only when the "Match" locator
- finds an attribute "name" that has a value of "MyDB".
-
- <connectionStrings>
- <add name="MyDB"
- connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
- xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
- </connectionStrings>
- -->
- <system.web>
- <!--
- In the example below, the "Replace" transform will replace the entire
- <customErrors> section of your web.config file.
- Note that because there is only one customErrors section under the
- <system.web> node, there is no need to use the "xdt:Locator" attribute.
-
- <customErrors defaultRedirect="GenericError.htm"
- mode="RemoteOnly" xdt:Transform="Replace">
- <error statusCode="500" redirect="InternalError.htm"/>
- </customErrors>
- -->
- </system.web>
-</configuration>
Oops, something went wrong.

0 comments on commit da81754

Please sign in to comment.