Skip to content

Commit 568dc19

Browse files
committed
Merge remote-tracking branch 'origin/v9/9.1' into v9/dev
# Conflicts: # build/templates/UmbracoPackage/.template.config/template.json # build/templates/UmbracoProject/.template.config/template.json # src/Directory.Build.props
2 parents dd78055 + 915f1cb commit 568dc19

File tree

45 files changed

+1577
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1577
-191
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/js/*
8484
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/lib/*
8585
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/views/*
8686
src/Umbraco.Web.UI/wwwroot/Media/*
87+
src/Umbraco.Web.UI/Smidge/
8788

8889
# Tests
8990
cypress.env.json

src/JsonSchema/AppSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class CmsDefinition
8282
public BasicAuthSettings BasicAuth { get; set; }
8383

8484
public PackageMigrationSettings PackageMigration { get; set; }
85+
public LegacyPasswordMigrationSettings LegacyPasswordMigration { get; set; }
8586
}
8687

8788
/// <summary>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Reflection;
2+
3+
namespace Umbraco.Cms.Core.Configuration
4+
{
5+
internal class EntryAssemblyMetadata : IEntryAssemblyMetadata
6+
{
7+
public EntryAssemblyMetadata()
8+
{
9+
var entryAssembly = Assembly.GetEntryAssembly();
10+
11+
Name = entryAssembly
12+
?.GetName()
13+
?.Name ?? string.Empty;
14+
15+
InformationalVersion = entryAssembly
16+
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
17+
?.InformationalVersion ?? string.Empty;
18+
}
19+
20+
public string Name { get; }
21+
22+
public string InformationalVersion { get; }
23+
}
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace Umbraco.Cms.Core.Configuration
2+
{
3+
/// <summary>
4+
/// Provides metadata about the entry assembly.
5+
/// </summary>
6+
public interface IEntryAssemblyMetadata
7+
{
8+
/// <summary>
9+
/// Gets the Name of entry assembly.
10+
/// </summary>
11+
public string Name { get; }
12+
13+
/// <summary>
14+
/// Gets the InformationalVersion string for entry assembly.
15+
/// </summary>
16+
public string InformationalVersion { get; }
17+
}
18+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) Umbraco.
2+
// See LICENSE for more details.
3+
4+
using System.ComponentModel;
5+
6+
namespace Umbraco.Cms.Core.Configuration.Models
7+
{
8+
/// <summary>
9+
/// Typed configuration options for legacy machine key settings used for migration of members from a v8 solution.
10+
/// </summary>
11+
[UmbracoOptions(Constants.Configuration.ConfigLegacyPasswordMigration)]
12+
public class LegacyPasswordMigrationSettings
13+
{
14+
private const string StaticDecryptionKey = "";
15+
16+
/// <summary>
17+
/// Gets the decryption algorithm.
18+
/// </summary>
19+
/// <remarks>
20+
/// Currently only AES is supported. This should include all machine keys generated by Umbraco.
21+
/// </remarks>
22+
public string MachineKeyDecryption => "AES";
23+
24+
/// <summary>
25+
/// Gets or sets the decryption hex-formatted string key found in legacy web.config machineKey configuration-element.
26+
/// </summary>
27+
[DefaultValue(StaticDecryptionKey)]
28+
public string MachineKeyDecryptionKey { get; set; } = StaticDecryptionKey;
29+
}
30+
}

src/Umbraco.Core/Constants-Configuration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public static class Configuration
2626
public const string ConfigHostingDebug = ConfigHostingPrefix + "Debug";
2727
public const string ConfigCustomErrorsMode = ConfigCustomErrorsPrefix + "Mode";
2828
public const string ConfigActiveDirectory = ConfigPrefix + "ActiveDirectory";
29+
public const string ConfigLegacyPasswordMigration = ConfigPrefix + "LegacyPasswordMigration";
2930
public const string ConfigContent = ConfigPrefix + "Content";
3031
public const string ConfigCoreDebug = ConfigCorePrefix + "Debug";
3132
public const string ConfigExceptionFilter = ConfigPrefix + "ExceptionFilter";
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace Umbraco.Cms.Core
2+
{
3+
public static partial class Constants
4+
{
5+
public static class HttpContext
6+
{
7+
/// <summary>
8+
/// Defines keys for items stored in HttpContext.Items
9+
/// </summary>
10+
public static class Items
11+
{
12+
/// <summary>
13+
/// Key for current requests body deserialized as JObject.
14+
/// </summary>
15+
public const string RequestBodyAsJObject = "RequestBodyAsJObject";
16+
}
17+
}
18+
}
19+
}

src/Umbraco.Core/Constants-Security.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public static class Security
6666
public const string AspNetCoreV2PasswordHashAlgorithmName = "PBKDF2.ASPNETCORE.V2";
6767
public const string AspNetUmbraco8PasswordHashAlgorithmName = "HMACSHA256";
6868
public const string AspNetUmbraco4PasswordHashAlgorithmName = "HMACSHA1";
69+
public const string UnknownPasswordConfigJson = "{\"hashAlgorithm\":\"Unknown\"}";
6970
}
7071
}
7172
}

src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public static IUmbracoBuilder AddConfiguration(this IUmbracoBuilder builder)
7373
.AddUmbracoOptions<RichTextEditorSettings>()
7474
.AddUmbracoOptions<BasicAuthSettings>()
7575
.AddUmbracoOptions<RuntimeMinificationSettings>()
76+
.AddUmbracoOptions<LegacyPasswordMigrationSettings>()
7677
.AddUmbracoOptions<PackageMigrationSettings>();
7778

7879
return builder;

src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ private void AddCoreServices()
163163
Services.AddUnique(factory => factory.GetRequiredService<AppCaches>().RequestCache);
164164
Services.AddUnique<IProfilingLogger, ProfilingLogger>();
165165
Services.AddUnique<IUmbracoVersion, UmbracoVersion>();
166+
Services.AddUnique<IEntryAssemblyMetadata, EntryAssemblyMetadata>();
166167

167168
this.AddAllCoreCollectionBuilders();
168169
this.AddNotificationHandler<UmbracoApplicationStartingNotification, EssentialDirectoryCreator>();

0 commit comments

Comments
 (0)