Fix merge conflict
This commit is contained in:
parent
126024991c
commit
7c181b65cd
|
@ -45,6 +45,8 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.AddScoped<ISystemService, SystemService>();
|
services.AddScoped<ISystemService, SystemService>();
|
||||||
services.AddScoped<ILocalizationService, LocalizationService>();
|
services.AddScoped<ILocalizationService, LocalizationService>();
|
||||||
services.AddScoped<ILanguageService, LanguageService>();
|
services.AddScoped<ILanguageService, LanguageService>();
|
||||||
|
services.AddScoped<IDatabaseService, DatabaseService>();
|
||||||
|
services.AddScoped<ISyncService, SyncService>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,6 @@ namespace Oqtane.Client
|
||||||
// dynamically register module services
|
// dynamically register module services
|
||||||
RegisterModuleServices(assembly, builder.Services);
|
RegisterModuleServices(assembly, builder.Services);
|
||||||
|
|
||||||
// dynamically register database providers
|
|
||||||
RegisterDatabaseProviders(assembly, builder.Services);
|
|
||||||
|
|
||||||
// register client startup services
|
// register client startup services
|
||||||
RegisterClientStartups(assembly, builder.Services);
|
RegisterClientStartups(assembly, builder.Services);
|
||||||
}
|
}
|
||||||
|
@ -126,19 +123,6 @@ namespace Oqtane.Client
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RegisterDatabaseProviders(Assembly assembly, IServiceCollection services)
|
|
||||||
{
|
|
||||||
var databaseTypes = assembly.GetInterfaces<IOqtaneDatabase>();
|
|
||||||
foreach (var databaseType in databaseTypes)
|
|
||||||
{
|
|
||||||
if (databaseType.AssemblyQualifiedName != null)
|
|
||||||
{
|
|
||||||
var serviceType = Type.GetType("Oqtane.Interfaces.IDatabase, Oqtane.Shared");
|
|
||||||
services.AddScoped(serviceType ?? databaseType, databaseType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void RegisterClientStartups(Assembly assembly, IServiceCollection services)
|
private static void RegisterClientStartups(Assembly assembly, IServiceCollection services)
|
||||||
{
|
{
|
||||||
var startUps = assembly.GetInstances<IClientStartup>();
|
var startUps = assembly.GetInstances<IClientStartup>();
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.Loader;
|
using System.Runtime.Loader;
|
||||||
|
@ -34,7 +35,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
|
|
||||||
public static IServiceCollection AddOqtaneDbContext(this IServiceCollection services)
|
public static IServiceCollection AddOqtaneDbContext(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddScoped<IDbConfig, DbConfig>();
|
|
||||||
services.AddDbContext<MasterDBContext>(options => { });
|
services.AddDbContext<MasterDBContext>(options => { });
|
||||||
services.AddDbContext<TenantDBContext>(options => { });
|
services.AddDbContext<TenantDBContext>(options => { });
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.AddSingleton<IInstallationManager, InstallationManager>();
|
services.AddSingleton<IInstallationManager, InstallationManager>();
|
||||||
services.AddSingleton<ISyncManager, SyncManager>();
|
services.AddSingleton<ISyncManager, SyncManager>();
|
||||||
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
||||||
|
services.AddSingleton<IConfigManager, ConfigManager>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +97,8 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.AddTransient<ISqlRepository, SqlRepository>();
|
services.AddTransient<ISqlRepository, SqlRepository>();
|
||||||
services.AddTransient<IUpgradeManager, UpgradeManager>();
|
services.AddTransient<IUpgradeManager, UpgradeManager>();
|
||||||
services.AddTransient<ILanguageRepository, LanguageRepository>();
|
services.AddTransient<ILanguageRepository, LanguageRepository>();
|
||||||
|
// obsolete - replaced by ITenantManager
|
||||||
|
services.AddTransient<ITenantResolver, TenantResolver>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
@ -105,12 +108,19 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.ConfigureApplicationCookie(options =>
|
services.ConfigureApplicationCookie(options =>
|
||||||
{
|
{
|
||||||
options.Cookie.HttpOnly = false;
|
options.Cookie.HttpOnly = false;
|
||||||
|
options.Cookie.SameSite = SameSiteMode.Strict;
|
||||||
|
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
|
||||||
options.Events.OnRedirectToLogin = context =>
|
options.Events.OnRedirectToLogin = context =>
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 401;
|
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
};
|
};
|
||||||
|
options.Events.OnRedirectToAccessDenied = context =>
|
||||||
|
{
|
||||||
|
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
|
return Task.CompletedTask;
|
||||||
|
};
|
||||||
|
options.Events.OnValidatePrincipal = PrincipalValidator.ValidateAsync;
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
@ -56,6 +52,8 @@ namespace Oqtane
|
||||||
// Register localization services
|
// Register localization services
|
||||||
services.AddLocalization(options => options.ResourcesPath = "Resources");
|
services.AddLocalization(options => options.ResourcesPath = "Resources");
|
||||||
|
|
||||||
|
services.AddOptions<List<Database>>().Bind(Configuration.GetSection(SettingKeys.AvailableDatabasesSection));
|
||||||
|
|
||||||
services.AddServerSideBlazor()
|
services.AddServerSideBlazor()
|
||||||
.AddCircuitOptions(options =>
|
.AddCircuitOptions(options =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user