Releases: saaskit/saaskit
1.1.4
- Fixed #27 Memory Cache eviction issue. All cache entries for the same tenant instance will be evicted when any of the entries expire. This behaviour can be configured by providing
MemoryCacheTenantResolverOptions
. - Added
ITenant<TTenant>
wrapper to handle cases where the current tenant instance be null (similar toIOptions<TOptions>
in ASP.NET Core).
Thanks to @Rdefreitas for his contributions to this release.
1.1.3
Upgrade to ASP.NET Core 1.0 RTM. Contributed by @joeaudette.
1.1.3-rc2
1.1.2-rc2
1.1.1-alpha
SaasKit.Multitenancy
- Added unique
TenantContext<T>.Id
for easier debugging. MemoryCacheTenantResolver
now includes tenant context Id in all debug messages.- Changed default memory cache options to use sliding expiration of 1 hour instead of absolute expiration.
- Added
TenantContext<T>.Dispose()
which is called byMemoryCacheTenantResolver
when cache entries are evicted.
SaasKit.Multitenancy.StructureMap
Adds support for tenant-scoped dependencies. See this blog post for full details.
1.1.0-alpha
Added support for tenant middleware pipelines.
The main purpose of this feature is to enable ASP.NET Authentication middleware to be used in multi-tenant applications. As described in this GitHub issue, most of the ASP.NET Auth middleware components require their options to be specified at the time the middleware is registered. This is a problem in multi-tenant applications since it means every tenant must have the same configuration e.g. all tenants use the same Google API keys.
This release adds the UsePerTenant
extension to IApplicationBuilder
which enables forked middleware pipelines to be created per tenant, thus allowing the authentication middleware to be configured per tenant:
app.UsePerTenant<AppTenant>((ctx, builder) =>
{
builder.UseCookieAuthentication(options =>
{
options.AuthenticationScheme = "Cookies";
options.LoginPath = new PathString("/account/login");
options.AccessDeniedPath = new PathString("/account/forbidden");
options.AutomaticAuthenticate = true;
options.AutomaticChallenge = true;
options.CookieName = $"{ctx.Tenant.Id}.AspNet.Cookies";
});
builder.UseGoogleAuthentication(options =>
{
options.AuthenticationScheme = "Google";
options.SignInScheme = "Cookies";
options.ClientId = Configuration[$"{ctx.Tenant.Id}:GoogleClientId"];
options.ClientSecret = Configuration[$"{ctx.Tenant.Id}:GoogleClientSecret"];
});
});
It's highly recommended that your tenant class implements IEquatable<TTenant>
to avoid potential possible race conditions when resolving tenants, as per https://github.com/saaskit/saaskit/blob/master/samples/AspNetMvcAuthDemo/AppTenant.cs.
For more details please see this blog post.
1.0.0-alpha
Multitenant support for ASP.NET 5.
Breaking Changes
The existing OWIN-based middleware and libraries for MVC 5 and Web API 2 have been removed from the main development branch as they will no longer be actively developed.
You can continue to install these packages from nuget.