Merge remote-tracking branch 'origin/v9/dev' into v9/update-all-the-things
This commit is contained in:
27
src/Umbraco.Core/Configuration/Models/BasicAuthSettings.cs
Normal file
27
src/Umbraco.Core/Configuration/Models/BasicAuthSettings.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Net;
|
||||
|
||||
namespace Umbraco.Cms.Core.Configuration.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Typed configuration options for basic authentication settings.
|
||||
/// </summary>
|
||||
[UmbracoOptions(Constants.Configuration.ConfigBasicAuth)]
|
||||
public class BasicAuthSettings
|
||||
{
|
||||
private const bool StaticEnabled = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to keep the user logged in.
|
||||
/// </summary>
|
||||
[DefaultValue(StaticEnabled)]
|
||||
public bool Enabled { get; set; } = StaticEnabled;
|
||||
|
||||
|
||||
public string[] AllowedIPs { get; set; } = Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
public const string ConfigRuntimeMinification = ConfigPrefix + "RuntimeMinification";
|
||||
public const string ConfigRuntimeMinificationVersion = ConfigRuntimeMinification + ":Version";
|
||||
public const string ConfigSecurity = ConfigPrefix + "Security";
|
||||
public const string ConfigBasicAuth = ConfigPrefix + "BasicAuth";
|
||||
public const string ConfigTours = ConfigPrefix + "Tours";
|
||||
public const string ConfigTypeFinder = ConfigPrefix + "TypeFinder";
|
||||
public const string ConfigWebRouting = ConfigPrefix + "WebRouting";
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
|
||||
.AddUmbracoOptions<UmbracoPluginSettings>()
|
||||
.AddUmbracoOptions<UnattendedSettings>()
|
||||
.AddUmbracoOptions<RichTextEditorSettings>()
|
||||
.AddUmbracoOptions<BasicAuthSettings>()
|
||||
.AddUmbracoOptions<RuntimeMinificationSettings>();
|
||||
|
||||
return builder;
|
||||
|
||||
10
src/Umbraco.Core/Services/IBasicAuthService.cs
Normal file
10
src/Umbraco.Core/Services/IBasicAuthService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Net;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
public interface IBasicAuthService
|
||||
{
|
||||
bool IsBasicAuthEnabled();
|
||||
bool IsIpAllowListed(IPAddress clientIpAddress);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user