Amended injection of further settings to use IOptionsSnapshot.

This commit is contained in:
Andy Butland
2020-08-21 14:52:47 +01:00
parent e3a44c6717
commit 510bd92e78
157 changed files with 774 additions and 550 deletions

View File

@@ -45,7 +45,7 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly IUserService _userService;
private readonly ILocalizedTextService _textService;
private readonly UmbracoMapper _umbracoMapper;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly SecuritySettings _securitySettings;
private readonly ILogger _logger;
private readonly IIpResolver _ipResolver;
@@ -64,7 +64,7 @@ namespace Umbraco.Web.BackOffice.Controllers
IUserService userService,
ILocalizedTextService textService,
UmbracoMapper umbracoMapper,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
IOptionsSnapshot<SecuritySettings> securitySettings,
ILogger logger,
IIpResolver ipResolver,
@@ -79,7 +79,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_userService = userService;
_textService = textService;
_umbracoMapper = umbracoMapper;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_securitySettings = securitySettings.Value;
_logger = logger;
_ipResolver = ipResolver;

View File

@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Hosting;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
@@ -17,9 +19,9 @@ namespace Umbraco.Web.BackOffice.Controllers
{
private readonly IFileSystem _jsLibFileSystem;
public BackOfficeAssetsController(IIOHelper ioHelper, IHostingEnvironment hostingEnvironment, ILogger logger, IGlobalSettings globalSettings)
public BackOfficeAssetsController(IIOHelper ioHelper, IHostingEnvironment hostingEnvironment, ILogger logger, IOptionsSnapshot<GlobalSettings> globalSettings)
{
_jsLibFileSystem = new PhysicalFileSystem(ioHelper, hostingEnvironment, logger, globalSettings.UmbracoPath + Path.DirectorySeparatorChar + "lib");
_jsLibFileSystem = new PhysicalFileSystem(ioHelper, hostingEnvironment, logger, globalSettings.Value.UmbracoPath + Path.DirectorySeparatorChar + "lib");
}
[HttpGet]

View File

@@ -5,13 +5,14 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.BackOffice;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Grid;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Hosting;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
@@ -35,7 +36,7 @@ namespace Umbraco.Web.BackOffice.Controllers
{
private readonly BackOfficeUserManager _userManager;
private readonly IRuntimeMinifier _runtimeMinifier;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly ILocalizedTextService _textService;
@@ -49,7 +50,7 @@ namespace Umbraco.Web.BackOffice.Controllers
public BackOfficeController(
BackOfficeUserManager userManager,
IRuntimeMinifier runtimeMinifier,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
IHostingEnvironment hostingEnvironment,
IUmbracoContextAccessor umbracoContextAccessor,
ILocalizedTextService textService,
@@ -59,11 +60,10 @@ namespace Umbraco.Web.BackOffice.Controllers
BackOfficeSignInManager signInManager,
IWebSecurity webSecurity,
ILogger logger)
{
_userManager = userManager;
_runtimeMinifier = runtimeMinifier;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_hostingEnvironment = hostingEnvironment;
_umbracoContextAccessor = umbracoContextAccessor;
_textService = textService;

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly LinkGenerator _linkGenerator;
private readonly IRuntimeState _runtimeState;
private readonly UmbracoFeatures _features;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly IUmbracoVersion _umbracoVersion;
private readonly ContentSettings _contentSettings;
private readonly TreeCollection _treeCollection;
@@ -46,7 +46,7 @@ namespace Umbraco.Web.BackOffice.Controllers
LinkGenerator linkGenerator,
IRuntimeState runtimeState,
UmbracoFeatures features,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
IUmbracoVersion umbracoVersion,
IOptionsSnapshot<ContentSettings> contentSettings,
IHttpContextAccessor httpContextAccessor,
@@ -60,7 +60,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_linkGenerator = linkGenerator;
_runtimeState = runtimeState;
_features = features;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_umbracoVersion = umbracoVersion;
_contentSettings = contentSettings.Value ?? throw new ArgumentNullException(nameof(contentSettings));
_httpContextAccessor = httpContextAccessor;

View File

@@ -3,11 +3,10 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Legacy;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.IO;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
@@ -15,15 +14,13 @@ using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Strings.Css;
using Umbraco.Extensions;
using Umbraco.Web.Models.ContentEditing;
using Stylesheet = Umbraco.Core.Models.Stylesheet;
using StylesheetRule = Umbraco.Web.Models.ContentEditing.StylesheetRule;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.Common.ActionsResults;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Editors;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Models.ContentEditing;
using Stylesheet = Umbraco.Core.Models.Stylesheet;
using StylesheetRule = Umbraco.Web.Models.ContentEditing.StylesheetRule;
namespace Umbraco.Web.BackOffice.Controllers
{
@@ -41,7 +38,7 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly ILocalizedTextService _localizedTextService;
private readonly UmbracoMapper _umbracoMapper;
private readonly IShortStringHelper _shortStringHelper;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
public CodeFileController(
IIOHelper ioHelper,
@@ -51,9 +48,8 @@ namespace Umbraco.Web.BackOffice.Controllers
ILocalizedTextService localizedTextService,
UmbracoMapper umbracoMapper,
IShortStringHelper shortStringHelper,
IGlobalSettings globalSettings)
IOptionsSnapshot<GlobalSettings> globalSettings)
{
_ioHelper = ioHelper;
_fileSystems = fileSystems;
_fileService = fileService;
@@ -61,7 +57,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_localizedTextService = localizedTextService;
_umbracoMapper = umbracoMapper;
_shortStringHelper = shortStringHelper;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
}
/// <summary>

View File

@@ -39,6 +39,8 @@ using Umbraco.Web.Editors;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
using ContentType = Umbraco.Core.Models.ContentType;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
namespace Umbraco.Web.BackOffice.Controllers
{
@@ -55,7 +57,7 @@ namespace Umbraco.Web.BackOffice.Controllers
public class ContentTypeController : ContentTypeControllerBase<IContentType>
{
private readonly IEntityXmlSerializer _serializer;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly PropertyEditorCollection _propertyEditors;
private readonly IScopeProvider _scopeProvider;
private readonly IIOHelper _ioHelper;
@@ -74,7 +76,6 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly IEntityService _entityService;
private readonly IHostingEnvironment _hostingEnvironment;
public ContentTypeController(
ICultureDictionary cultureDictionary,
EditorValidatorCollection editorValidatorCollection,
@@ -84,7 +85,7 @@ namespace Umbraco.Web.BackOffice.Controllers
UmbracoMapper umbracoMapper,
ILocalizedTextService localizedTextService,
IEntityXmlSerializer serializer,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
PropertyEditorCollection propertyEditors,
IScopeProvider scopeProvider,
IIOHelper ioHelper,
@@ -108,7 +109,7 @@ namespace Umbraco.Web.BackOffice.Controllers
localizedTextService)
{
_serializer = serializer;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_propertyEditors = propertyEditors;
_scopeProvider = scopeProvider;
_ioHelper = ioHelper;

View File

@@ -43,7 +43,6 @@ namespace Umbraco.Web.BackOffice.Controllers
/// Initializes a new instance of the <see cref="DashboardController"/> with all its dependencies.
/// </summary>
public DashboardController(
IGlobalSettings globalSettings,
IUmbracoContextAccessor umbracoContextAccessor,
ISqlContext sqlContext,
ServiceContext services,

View File

@@ -15,6 +15,8 @@ using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Security;
using Constants = Umbraco.Core.Constants;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
namespace Umbraco.Web.BackOffice.Controllers
{
@@ -33,7 +35,7 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly ILogger _logger;
private readonly ILocalizationService _localizationService;
private readonly IWebSecurity _webSecurity;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly ILocalizedTextService _localizedTextService;
private readonly UmbracoMapper _umbracoMapper;
@@ -41,7 +43,7 @@ namespace Umbraco.Web.BackOffice.Controllers
ILogger logger,
ILocalizationService localizationService,
IWebSecurity webSecurity,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
ILocalizedTextService localizedTextService,
UmbracoMapper umbracoMapper
)
@@ -49,7 +51,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
_webSecurity = webSecurity ?? throw new ArgumentNullException(nameof(webSecurity));
_globalSettings = globalSettings ?? throw new ArgumentNullException(nameof(globalSettings));
_globalSettings = globalSettings.Value ?? throw new ArgumentNullException(nameof(globalSettings));
_localizedTextService = localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
_umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));
}

View File

@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
@@ -25,15 +27,15 @@ namespace Umbraco.Web.BackOffice.Controllers
{
private readonly ILocalizationService _localizationService;
private readonly UmbracoMapper _umbracoMapper;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
public LanguageController(ILocalizationService localizationService,
UmbracoMapper umbracoMapper,
IGlobalSettings globalSettings)
IOptionsSnapshot<GlobalSettings> globalSettings)
{
_localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
_umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));
_globalSettings = globalSettings ?? throw new ArgumentNullException(nameof(globalSettings));
_globalSettings = globalSettings.Value ?? throw new ArgumentNullException(nameof(globalSettings));
}
/// <summary>

View File

@@ -1,11 +1,13 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ViewEngines;
using Microsoft.Extensions.Options;
using System;
using System.IO;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Hosting;
using Umbraco.Core.Services;
@@ -28,7 +30,7 @@ namespace Umbraco.Web.BackOffice.Controllers
public class PreviewController : Controller
{
private readonly UmbracoFeatures _features;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly IPublishedSnapshotService _publishedSnapshotService;
private readonly IWebSecurity _webSecurity;
private readonly ILocalizationService _localizationService;
@@ -39,7 +41,7 @@ namespace Umbraco.Web.BackOffice.Controllers
public PreviewController(
UmbracoFeatures features,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
IPublishedSnapshotService publishedSnapshotService,
IWebSecurity webSecurity,
ILocalizationService localizationService,
@@ -49,7 +51,7 @@ namespace Umbraco.Web.BackOffice.Controllers
ICompositeViewEngine viewEngines)
{
_features = features;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_publishedSnapshotService = publishedSnapshotService;
_webSecurity = webSecurity;
_localizationService = localizationService;

View File

@@ -12,6 +12,8 @@ using Umbraco.Core.Mapping;
using Umbraco.Core.Services;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Security;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
namespace Umbraco.Web.BackOffice.Controllers
{
@@ -19,21 +21,21 @@ namespace Umbraco.Web.BackOffice.Controllers
public class RedirectUrlManagementController : UmbracoAuthorizedApiController
{
private readonly ILogger _logger;
private readonly IWebRoutingSettings _webRoutingSettings;
private readonly WebRoutingSettings _webRoutingSettings;
private readonly IWebSecurity _webSecurity;
private readonly IRedirectUrlService _redirectUrlService;
private readonly UmbracoMapper _umbracoMapper;
private readonly IHostingEnvironment _hostingEnvironment;
public RedirectUrlManagementController(ILogger logger,
IWebRoutingSettings webRoutingSettings,
IOptionsSnapshot<WebRoutingSettings> webRoutingSettings,
IWebSecurity webSecurity,
IRedirectUrlService redirectUrlService,
UmbracoMapper umbracoMapper,
IHostingEnvironment hostingEnvironment)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_webRoutingSettings = webRoutingSettings ?? throw new ArgumentNullException(nameof(webRoutingSettings));
_webRoutingSettings = webRoutingSettings.Value ?? throw new ArgumentNullException(nameof(webRoutingSettings));
_webSecurity = webSecurity ?? throw new ArgumentNullException(nameof(webSecurity));
_redirectUrlService = redirectUrlService ?? throw new ArgumentNullException(nameof(redirectUrlService));
_umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));

View File

@@ -3,10 +3,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Options;
using Semver;
using Umbraco.Composing;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Common.Attributes;
@@ -22,20 +24,20 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly IUmbracoVersion _umbracoVersion;
private readonly ICookieManager _cookieManager;
private readonly IWebSecurity _webSecurity;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
public UpdateCheckController(
IUpgradeService upgradeService,
IUmbracoVersion umbracoVersion,
ICookieManager cookieManager,
IWebSecurity webSecurity,
IGlobalSettings globalSettings)
IOptionsSnapshot<GlobalSettings> globalSettings)
{
_upgradeService = upgradeService ?? throw new ArgumentNullException(nameof(upgradeService));
_umbracoVersion = umbracoVersion ?? throw new ArgumentNullException(nameof(umbracoVersion));
_cookieManager = cookieManager ?? throw new ArgumentNullException(nameof(cookieManager));
_webSecurity = webSecurity ?? throw new ArgumentNullException(nameof(webSecurity));
_globalSettings = globalSettings ?? throw new ArgumentNullException(nameof(globalSettings));
_globalSettings = globalSettings.Value ?? throw new ArgumentNullException(nameof(globalSettings));
}
[UpdateCheckResponseFilter]
@@ -77,11 +79,11 @@ namespace Umbraco.Web.BackOffice.Controllers
private class UpdateCheckResponseFilter : IActionFilter
{
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
public UpdateCheckResponseFilter(IGlobalSettings globalSettings)
public UpdateCheckResponseFilter(IOptionsSnapshot<GlobalSettings> globalSettings)
{
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
}
public void OnActionExecuted(ActionExecutedContext context)

View File

@@ -66,7 +66,7 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly IEntityService _entityService;
private readonly IMediaService _mediaService;
private readonly IContentService _contentService;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly BackOfficeUserManager _backOfficeUserManager;
private readonly ILogger _logger;
private readonly LinkGenerator _linkGenerator;
@@ -89,7 +89,7 @@ namespace Umbraco.Web.BackOffice.Controllers
IEntityService entityService,
IMediaService mediaService,
IContentService contentService,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
BackOfficeUserManager backOfficeUserManager,
ILogger logger,
LinkGenerator linkGenerator)
@@ -111,7 +111,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_entityService = entityService;
_mediaService = mediaService;
_contentService = contentService;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_backOfficeUserManager = backOfficeUserManager;
_logger = logger;
_linkGenerator = linkGenerator;

View File

@@ -2,8 +2,9 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Web.BackOffice.Security;
namespace Umbraco.Extensions
@@ -20,12 +21,12 @@ namespace Umbraco.Extensions
private class SetAngularAntiForgeryTokensFilter : IAsyncActionFilter
{
private readonly IBackOfficeAntiforgery _antiforgery;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
public SetAngularAntiForgeryTokensFilter(IBackOfficeAntiforgery antiforgery, IGlobalSettings globalSettings)
public SetAngularAntiForgeryTokensFilter(IBackOfficeAntiforgery antiforgery, IOptionsSnapshot<GlobalSettings> globalSettings)
{
_antiforgery = antiforgery;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
}
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)

View File

@@ -3,7 +3,8 @@ using System.Net;
using System.Net.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Core.Configuration;
using Microsoft.Extensions.Options;
using Umbraco.Core.Configuration.Models;
namespace Umbraco.Web.BackOffice.Filters
{
@@ -27,11 +28,11 @@ namespace Umbraco.Web.BackOffice.Filters
public class UmbracoWebApiRequireHttpsFilter: IAuthorizationFilter
{
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
public UmbracoWebApiRequireHttpsFilter(IGlobalSettings globalSettings)
public UmbracoWebApiRequireHttpsFilter(IOptionsSnapshot<GlobalSettings> globalSettings)
{
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
}
public void OnAuthorization(AuthorizationFilterContext context)

View File

@@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Hosting;
using Umbraco.Web.BackOffice.Controllers;
using Umbraco.Web.Common.Controllers;
@@ -14,19 +16,19 @@ namespace Umbraco.Web.BackOffice.Routing
/// </summary>
public class BackOfficeAreaRoutes : IAreaRoutes
{
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IRuntimeState _runtimeState;
private readonly UmbracoApiControllerTypeCollection _apiControllers;
private readonly string _umbracoPathSegment;
public BackOfficeAreaRoutes(
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState,
UmbracoApiControllerTypeCollection apiControllers)
{
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_hostingEnvironment = hostingEnvironment;
_runtimeState = runtimeState;
_apiControllers = apiControllers;

View File

@@ -1,16 +1,15 @@
using Microsoft.AspNetCore.Authentication.Cookies;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Routing;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Extensions;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Hosting;
using Umbraco.Web.BackOffice.Controllers;
using Umbraco.Extensions;
namespace Umbraco.Web.BackOffice.Security
{
@@ -28,7 +27,7 @@ namespace Umbraco.Web.BackOffice.Security
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly IRuntimeState _runtime;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly IRequestCache _requestCache;
private readonly string[] _explicitPaths;
@@ -36,7 +35,7 @@ namespace Umbraco.Web.BackOffice.Security
IUmbracoContextAccessor umbracoContextAccessor,
IRuntimeState runtime,
IHostingEnvironment hostingEnvironment,
IGlobalSettings globalSettings,
GlobalSettings globalSettings,
IRequestCache requestCache,
LinkGenerator linkGenerator)
: this(umbracoContextAccessor, runtime, hostingEnvironment, globalSettings, requestCache, linkGenerator, null)
@@ -46,7 +45,7 @@ namespace Umbraco.Web.BackOffice.Security
IUmbracoContextAccessor umbracoContextAccessor,
IRuntimeState runtime,
IHostingEnvironment hostingEnvironment,
IGlobalSettings globalSettings,
GlobalSettings globalSettings,
IRequestCache requestCache,
LinkGenerator linkGenerator,
IEnumerable<string> explicitPaths)

View File

@@ -29,7 +29,7 @@ namespace Umbraco.Web.BackOffice.Security
{
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly SecuritySettings _securitySettings;
private readonly IGlobalSettings _globalSettings;
private readonly GlobalSettings _globalSettings;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IRuntimeState _runtimeState;
private readonly IDataProtectionProvider _dataProtection;
@@ -43,7 +43,7 @@ namespace Umbraco.Web.BackOffice.Security
public ConfigureBackOfficeCookieOptions(
IUmbracoContextAccessor umbracoContextAccessor,
IOptionsSnapshot<SecuritySettings> securitySettings,
IGlobalSettings globalSettings,
IOptionsSnapshot<GlobalSettings> globalSettings,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState,
IDataProtectionProvider dataProtection,
@@ -56,7 +56,7 @@ namespace Umbraco.Web.BackOffice.Security
{
_umbracoContextAccessor = umbracoContextAccessor;
_securitySettings = securitySettings.Value;
_globalSettings = globalSettings;
_globalSettings = globalSettings.Value;
_hostingEnvironment = hostingEnvironment;
_runtimeState = runtimeState;
_dataProtection = dataProtection;