V9: Allowlisting remote URLs for displaying content on the content dashboard (#11825)

* Fixing ContentDashboardSettings to work when set in the config

* Moving file in Models folder and adding ContentDashboardUrlAllowlist setting

* Implementing allowlist for content dashboard base url

* Cleanup

* Error msg vs log msg
This commit is contained in:
Elitsa Marinovska
2022-01-18 15:37:31 +01:00
committed by GitHub
parent 1b5830a9d7
commit 229ca989eb
5 changed files with 67 additions and 10 deletions

View File

@@ -1,6 +1,11 @@

namespace Umbraco.Cms.Core.Configuration
using System.ComponentModel;
namespace Umbraco.Cms.Core.Configuration.Models
{
/// <summary>
/// Typed configuration options for content dashboard settings.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigContentDashboard)]
public class ContentDashboardSettings
{
private const string DefaultContentDashboardPath = "cms";
@@ -18,6 +23,13 @@ namespace Umbraco.Cms.Core.Configuration
/// Gets the path to use when constructing the URL for retrieving data for the content dashboard.
/// </summary>
/// <value>The URL path.</value>
public string ContentDashboardPath { get; set; } = DefaultContentDashboardPath;
[DefaultValue(DefaultContentDashboardPath)]
public string ContentDashboardPath { get; set; } = DefaultContentDashboardPath;
/// <summary>
/// Gets the allowed addresses to retrieve data for the content dashboard.
/// </summary>
/// <value>The URLs.</value>
public string[] ContentDashboardUrlAllowlist { get; set; }
}
}