V17 - Removing obsoleted code from Umbraco.Web (#19983)
* Removing obsoleted code from AspNetCoreCookieManager.cs & Dependencies * Removing obosoleted code from AspNetCoreBackOfficeInfo.cs * Removing obosoleted code from PublishedContentExtensions.cs * Removing obosoleted code from UmbracoMvcConfigureOptions.cs * Removing obosoleted code from UmbracoVirtualPageRoute.cs * Removing obsoleted constructor from BasicAuthenticationMiddleware.cs * Removing obsoleted constructors from UmbLoginController.cs * Removing unused constructor
This commit is contained in:
@@ -17,23 +17,6 @@ public interface ICookieManager
|
||||
/// <param name="cookieName">The cookie name.</param>
|
||||
string? GetCookieValue(string cookieName);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of a cookie with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="cookieName">The cookie name.</param>
|
||||
/// <param name="value">The cookie value.</param>
|
||||
[Obsolete("Use overload with the httpOnly parameter instead. Scheduled for removal in V16.")]
|
||||
void SetCookieValue(string cookieName, string value) => SetCookieValue(cookieName, value, false);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of a cookie with the specified name.
|
||||
/// </summary>
|
||||
/// <param name="cookieName">The cookie name.</param>
|
||||
/// <param name="value">The cookie value.</param>
|
||||
/// <param name="httpOnly">Indicates whether the created cookie should be marked as HTTP only.</param>
|
||||
[Obsolete("Use overload with the secure and sameSiteMode parameters instead. Scheduled for removal in V17.")]
|
||||
void SetCookieValue(string cookieName, string value, bool httpOnly);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of a cookie with the specified name.
|
||||
/// </summary>
|
||||
@@ -48,10 +31,7 @@ public interface ICookieManager
|
||||
/// This hasn't been used as the parameter directly to avoid a dependency on Microsoft.AspNetCore.Http in
|
||||
/// the core project.
|
||||
/// </remarks>
|
||||
void SetCookieValue(string cookieName, string value, bool httpOnly, bool secure, string sameSiteMode)
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
=> SetCookieValue(cookieName, value, httpOnly);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
void SetCookieValue(string cookieName, string value, bool httpOnly, bool secure, string sameSiteMode);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a cookie with the specified name exists.
|
||||
|
||||
@@ -14,11 +14,6 @@ public class AspNetCoreBackOfficeInfo : IBackOfficeInfo
|
||||
public AspNetCoreBackOfficeInfo(IHostingEnvironment hostingEnviroment)
|
||||
=> _hostingEnvironment = hostingEnviroment;
|
||||
|
||||
[Obsolete("The globalSettings parameter is not required anymore, use the other constructor instead. Scheduled for removal in Umbraco 17.")]
|
||||
public AspNetCoreBackOfficeInfo(IOptionsMonitor<GlobalSettings> globalSettings, IHostingEnvironment hostingEnviroment)
|
||||
: this(hostingEnviroment)
|
||||
{ }
|
||||
|
||||
public string GetAbsoluteUrl
|
||||
{
|
||||
get
|
||||
|
||||
@@ -41,11 +41,6 @@ public class AspNetCoreCookieManager : ICookieManager
|
||||
/// <inheritdoc/>
|
||||
public string? GetCookieValue(string cookieName) => _httpContextAccessor.HttpContext?.Request.Cookies[cookieName];
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Obsolete("Use overload with the secure and sameSiteMode parameters instead. Scheduled for removal in V17.")]
|
||||
public void SetCookieValue(string cookieName, string value, bool httpOnly) =>
|
||||
SetCookieValue(cookieName, value, httpOnly, false, SameSiteMode.Unspecified.ToString());
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void SetCookieValue(string cookieName, string value, bool httpOnly, bool secure, string sameSiteMode)
|
||||
{
|
||||
|
||||
@@ -17,17 +17,6 @@ public static class PublishedContentExtensions
|
||||
{
|
||||
#region Variations
|
||||
|
||||
[Obsolete("Use the overload with IPublishedStatusFilteringService, scheduled for removal in v17")]
|
||||
public static string? GetCultureFromDomains(
|
||||
this IPublishedContent content,
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
ISiteDomainMapper siteDomainHelper,
|
||||
Uri? current = null)
|
||||
{
|
||||
IUmbracoContext umbracoContext = umbracoContextAccessor.GetRequiredUmbracoContext();
|
||||
return DomainUtilities.GetCultureFromDomains(content.Id, content.Path, current, umbracoContext, siteDomainHelper);
|
||||
}
|
||||
|
||||
public static string? GetCultureFromDomains(
|
||||
this IPublishedContent content,
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
|
||||
@@ -16,13 +16,6 @@ namespace Umbraco.Cms.Web.Common.Mvc;
|
||||
/// </remarks>
|
||||
public class UmbracoMvcConfigureOptions : IConfigureOptions<MvcOptions>
|
||||
{
|
||||
public UmbracoMvcConfigureOptions()
|
||||
{ }
|
||||
|
||||
[Obsolete("The global settings is not required anymore, use the default constructor instead. Scheduled for removal in Umbraco 17.")]
|
||||
public UmbracoMvcConfigureOptions(IOptions<GlobalSettings> globalSettings)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Configure(MvcOptions options)
|
||||
{
|
||||
|
||||
@@ -47,16 +47,6 @@ public class UmbracoVirtualPageRoute : IUmbracoVirtualPageRoute
|
||||
_umbracoContextAccessor = umbracoContextAccessor;
|
||||
}
|
||||
|
||||
[Obsolete("Please use constructor that takes an IUmbracoContextAccessor instead, scheduled for removal in v17")]
|
||||
public UmbracoVirtualPageRoute(
|
||||
EndpointDataSource endpointDataSource,
|
||||
LinkParser linkParser,
|
||||
UriUtility uriUtility,
|
||||
IPublishedRouter publishedRouter)
|
||||
: this(endpointDataSource, linkParser, uriUtility, publishedRouter, StaticServiceProvider.Instance.GetRequiredService<IUmbracoContextAccessor>())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This sets up the virtual page route for the current request if a mtahcing endpoint is found.
|
||||
/// </summary>
|
||||
|
||||
@@ -26,7 +26,6 @@ public class UmbLoginController : SurfaceController
|
||||
private readonly IDocumentNavigationQueryService _navigationQueryService;
|
||||
private readonly IPublishedContentStatusFilteringService _publishedContentStatusFilteringService;
|
||||
|
||||
[ActivatorUtilitiesConstructor]
|
||||
public UmbLoginController(
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
IUmbracoDatabaseFactory databaseFactory,
|
||||
@@ -48,89 +47,6 @@ public class UmbLoginController : SurfaceController
|
||||
_publishedContentStatusFilteringService = publishedContentStatusFilteringService;
|
||||
}
|
||||
|
||||
[Obsolete("Use the non-obsolete constructor. Scheduled for removal in V17.")]
|
||||
public UmbLoginController(
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
IUmbracoDatabaseFactory databaseFactory,
|
||||
ServiceContext services,
|
||||
AppCaches appCaches,
|
||||
IProfilingLogger profilingLogger,
|
||||
IPublishedUrlProvider publishedUrlProvider,
|
||||
IMemberSignInManager signInManager,
|
||||
IMemberManager memberManager,
|
||||
ITwoFactorLoginService twoFactorLoginService,
|
||||
IPublishedContentCache contentCache,
|
||||
IDocumentNavigationQueryService navigationQueryService,
|
||||
IPublishedContentStatusFilteringService publishedContentStatusFilteringService)
|
||||
: this(
|
||||
umbracoContextAccessor,
|
||||
databaseFactory,
|
||||
services,
|
||||
appCaches,
|
||||
profilingLogger,
|
||||
publishedUrlProvider,
|
||||
signInManager,
|
||||
memberManager,
|
||||
twoFactorLoginService,
|
||||
navigationQueryService,
|
||||
publishedContentStatusFilteringService)
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("Use the non-obsolete constructor. Scheduled for removal in V17.")]
|
||||
public UmbLoginController(
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
IUmbracoDatabaseFactory databaseFactory,
|
||||
ServiceContext services,
|
||||
AppCaches appCaches,
|
||||
IProfilingLogger profilingLogger,
|
||||
IPublishedUrlProvider publishedUrlProvider,
|
||||
IMemberSignInManager signInManager,
|
||||
IMemberManager memberManager,
|
||||
ITwoFactorLoginService twoFactorLoginService,
|
||||
IPublishedContentCache contentCache,
|
||||
IDocumentNavigationQueryService navigationQueryService)
|
||||
: this(
|
||||
umbracoContextAccessor,
|
||||
databaseFactory,
|
||||
services,
|
||||
appCaches,
|
||||
profilingLogger,
|
||||
publishedUrlProvider,
|
||||
signInManager,
|
||||
memberManager,
|
||||
twoFactorLoginService,
|
||||
navigationQueryService,
|
||||
StaticServiceProvider.Instance.GetRequiredService<IPublishedContentStatusFilteringService>())
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("Use the non-obsolete constructor. Scheduled for removal in V17.")]
|
||||
public UmbLoginController(
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
IUmbracoDatabaseFactory databaseFactory,
|
||||
ServiceContext services,
|
||||
AppCaches appCaches,
|
||||
IProfilingLogger profilingLogger,
|
||||
IPublishedUrlProvider publishedUrlProvider,
|
||||
IMemberSignInManager signInManager,
|
||||
IMemberManager memberManager,
|
||||
ITwoFactorLoginService twoFactorLoginService)
|
||||
: this(
|
||||
umbracoContextAccessor,
|
||||
databaseFactory,
|
||||
services,
|
||||
appCaches,
|
||||
profilingLogger,
|
||||
publishedUrlProvider,
|
||||
signInManager,
|
||||
memberManager,
|
||||
twoFactorLoginService,
|
||||
StaticServiceProvider.Instance.GetRequiredService<IDocumentNavigationQueryService>(),
|
||||
StaticServiceProvider.Instance.GetRequiredService<IPublishedContentStatusFilteringService>())
|
||||
{
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
[ValidateUmbracoFormRouteString]
|
||||
|
||||
@@ -34,15 +34,6 @@ public class BasicAuthenticationMiddleware : IMiddleware
|
||||
_backOfficePath = hostingEnvironment.GetBackOfficePath();
|
||||
}
|
||||
|
||||
[Obsolete("The globalSettings parameter is not required anymore, use the other constructor instead. Scheduled for removal in Umbraco 17.")]
|
||||
public BasicAuthenticationMiddleware(
|
||||
IRuntimeState runtimeState,
|
||||
IBasicAuthService basicAuthService,
|
||||
IOptionsMonitor<GlobalSettings> globalSettings,
|
||||
IHostingEnvironment hostingEnvironment)
|
||||
: this(runtimeState, basicAuthService, hostingEnvironment)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user