Skip to content

Commit 5c197cf

Browse files
committed
Merge remote-tracking branch 'origin/v14/dev' into release/14.0
2 parents 0ed1d68 + 782c009 commit 5c197cf

File tree

1,181 files changed

+31864
-30416
lines changed

Some content is hidden

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

1,181 files changed

+31864
-30416
lines changed

Directory.Packages.props

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@
66
<!-- Global packages (private, build-time packages for all projects) -->
77
<ItemGroup>
88
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
9-
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
9+
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
1010
<GlobalPackageReference Include="Umbraco.Code" Version="2.1.0" />
1111
<GlobalPackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" />
1212
</ItemGroup>
1313
<!-- Microsoft packages -->
1414
<ItemGroup>
15-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.1" />
15+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.4" />
1616
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
17-
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.1" />
18-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.1" />
19-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
20-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1" />
17+
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.4" />
18+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
19+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
20+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4" />
2121
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
2222
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
2323
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
2424
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
2525
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
26-
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.1" />
26+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.4" />
2727
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0" />
2828
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
2929
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
30-
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.1" />
31-
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.1" />
30+
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.4" />
31+
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
3232
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
33-
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.1" />
33+
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
3434
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
3535
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
3636
</ItemGroup>
@@ -41,25 +41,25 @@
4141
</ItemGroup>
4242
<!-- Third-party packages -->
4343
<ItemGroup>
44-
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.0.0" />
45-
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.0.0" />
44+
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
45+
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
4646
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
4747
<PackageVersion Include="Examine" Version="3.2.0" />
4848
<PackageVersion Include="Examine.Core" Version="3.2.0" />
49-
<PackageVersion Include="HtmlAgilityPack" Version="1.11.57" />
50-
<PackageVersion Include="JsonPatch.Net" Version="2.1.0" />
51-
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.6" />
52-
<PackageVersion Include="MailKit" Version="4.3.0" />
49+
<PackageVersion Include="HtmlAgilityPack" Version="1.11.60" />
50+
<PackageVersion Include="JsonPatch.Net" Version="3.0.0" />
51+
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.8" />
52+
<PackageVersion Include="MailKit" Version="4.4.0" />
5353
<PackageVersion Include="Markdown" Version="2.2.1" />
5454
<PackageVersion Include="MessagePack" Version="2.5.140" />
5555
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
5656
<PackageVersion Include="MiniProfiler.Shared" Version="4.3.8" />
5757
<PackageVersion Include="ncrontab" Version="3.3.3" />
5858
<PackageVersion Include="NPoco" Version="5.7.1" />
5959
<PackageVersion Include="NPoco.SqlServer" Version="5.7.1" />
60-
<PackageVersion Include="OpenIddict.Abstractions" Version="4.10.1" />
61-
<PackageVersion Include="OpenIddict.AspNetCore" Version="4.10.1" />
62-
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="4.10.1" />
60+
<PackageVersion Include="OpenIddict.Abstractions" Version="5.4.0" />
61+
<PackageVersion Include="OpenIddict.AspNetCore" Version="5.4.0" />
62+
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="5.4.0" />
6363
<PackageVersion Include="Serilog" Version="3.1.1" />
6464
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
6565
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
@@ -73,13 +73,13 @@
7373
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
7474
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
7575
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.3" />
76-
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.0" />
76+
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.1" />
7777
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
7878
</ItemGroup>
7979
<!-- Transitive pinned versions (only required because our direct dependencies have vulnerable versions of transitive dependencies) -->
8080
<ItemGroup>
8181
<!-- Both Microsoft.EntityFrameworkCore.SqlServer and NPoco.SqlServer bring in a vulnerable version of Azure.Identity -->
82-
<PackageVersion Include="Azure.Identity" Version="1.10.4" />
82+
<PackageVersion Include="Azure.Identity" Version="1.11.0" />
8383
<!-- Dazinator.Extensions.FileProviders brings in a vulnerable version of System.Net.Http -->
8484
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
8585
<!-- Examine brings in a vulnerable version of System.Security.Cryptography.Xml -->

build/azure-pipelines.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ stages:
8585
retryCountOnTaskFailure: 3
8686
inputs:
8787
versionSpec: $(nodeVersion)
88-
- script: npm ci --no-fund --no-audit --prefer-offline
89-
displayName: Run npm ci (Login)
90-
workingDirectory: src/Umbraco.Web.UI.Login
91-
- script: npm run build
92-
displayName: Run npm build (Login)
93-
workingDirectory: src/Umbraco.Web.UI.Login
9488
- script: npm ci --no-fund --no-audit --prefer-offline
9589
displayName: Run npm ci (Bellissima)
9690
workingDirectory: src/Umbraco.Web.UI.Client
@@ -101,9 +95,12 @@ stages:
10195
- script: npm run build:for:cms
10296
displayName: Run build (Bellissima)
10397
workingDirectory: src/Umbraco.Web.UI.Client
98+
- script: npm ci --no-fund --no-audit --prefer-offline
99+
displayName: Run npm ci (Login)
100+
workingDirectory: src/Umbraco.Web.UI.Login
104101
- script: npm run build
105-
displayName: Run Login Build (Bellissima)
106-
workingDirectory: src/Umbraco.Web.UI.Client/apps/auth
102+
displayName: Run npm build (Login)
103+
workingDirectory: src/Umbraco.Web.UI.Login
107104
- task: UseDotNet@2
108105
displayName: Use .NET SDK from global.json
109106
inputs:

src/Umbraco.Cms.Api.Common/Attributes/ShortGenericSchemaNameAttribute.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ private static void ConfigureOpenIddict(IUmbracoBuilder builder)
3030
{
3131
// Enable the authorization and token endpoints.
3232
// - important: member endpoints MUST be added before backoffice endpoints to ensure that auto-discovery works for members
33-
// FIXME: swap paths here so member API is first (see comment above)
3433
options
3534
.SetAuthorizationEndpointUris(
3635
Paths.MemberApi.AuthorizationEndpoint.TrimStart(Constants.CharArrays.ForwardSlash),

src/Umbraco.Cms.Api.Common/OpenApi/SchemaIdSelector.cs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,7 @@ private string HandleGenerics(string name, Type type)
3939
return name;
4040
}
4141

42-
// find all types that implement this type and have an matching attribute
43-
var assignableTypesWithAttributeInfo = AppDomain.CurrentDomain.GetAssemblies()
44-
.Where(assembly => assembly.FullName?.StartsWith("Umbraco") == true)
45-
.SelectMany(assembly => assembly.GetTypes())
46-
.Where(t => t.IsAssignableTo(type))
47-
.Select(t =>
48-
{
49-
var attribute = System.Attribute.GetCustomAttributes(t)
50-
.FirstOrDefault(attribute => attribute is ShortGenericSchemaNameAttribute) as
51-
ShortGenericSchemaNameAttribute;
52-
return attribute == null
53-
? new ShortSchemaNameAttributeInfo(t)
54-
: new ShortSchemaNameAttributeInfo(t, attribute.GenericTypes, attribute.SchemaName);
55-
})
56-
.Where(info => info.GenericTypes != null);
57-
58-
var matchingType = assignableTypesWithAttributeInfo
59-
.SingleOrDefault(t => t.GenericTypes!.Length == type.GenericTypeArguments.Length
60-
&& t.GenericTypes.Intersect(type.GenericTypeArguments).Count() ==
61-
type.GenericTypeArguments.Length && t.SchemaName.IsNullOrWhiteSpace() == false);
62-
6342
// use attribute custom name or append the generic type names, ultimately turning i.e. "PagedViewModel<RelationItemViewModel>" into "PagedRelationItem"
64-
return matchingType != null
65-
? matchingType.SchemaName!
66-
: $"{name}{string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName))}";
67-
}
68-
69-
private class ShortSchemaNameAttributeInfo
70-
{
71-
public Type Type { get; set; }
72-
public Type[]? GenericTypes { get; set; }
73-
public string? SchemaName { get; set; }
74-
75-
public ShortSchemaNameAttributeInfo(Type type, Type[]? genericTypes = null, string? schemaName = null)
76-
{
77-
Type = type;
78-
GenericTypes = genericTypes;
79-
SchemaName = schemaName;
80-
}
43+
return $"{name}{string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName))}";
8144
}
8245
}

src/Umbraco.Cms.Api.Common/Security/Paths.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Umbraco.Cms.Core;
2+
13
namespace Umbraco.Cms.Api.Common.Security;
24

35
public static class Paths
@@ -14,7 +16,7 @@ public static class BackOfficeApi
1416

1517
public static readonly string RevokeEndpoint = EndpointPath($"{EndpointTemplate}/revoke");
1618

17-
private static string EndpointPath(string relativePath) => $"/umbraco/management/api/v1/{relativePath}";
19+
private static string EndpointPath(string relativePath) => $"/umbraco{Constants.Web.ManagementApiPath}v1/{relativePath}";
1820
}
1921

2022
public static class MemberApi

src/Umbraco.Cms.Api.Common/Serialization/UmbracoJsonTypeInfoResolver.cs

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ public sealed class UmbracoJsonTypeInfoResolver : DefaultJsonTypeInfoResolver, I
1111
private readonly ConcurrentDictionary<Type, ISet<Type>> _subTypesCache = new ConcurrentDictionary<Type, ISet<Type>>();
1212

1313
public UmbracoJsonTypeInfoResolver(ITypeFinder typeFinder)
14-
{
15-
_typeFinder = typeFinder;
16-
}
14+
=> _typeFinder = typeFinder;
1715

1816
public IEnumerable<Type> FindSubTypes(Type type)
1917
{
18+
if (type.IsInterface is false)
19+
{
20+
// IMPORTANT: do NOT return an empty enumerable here. it will cause nullability to fail on reference
21+
// properties, because "$ref" does not mix and match well with "nullable" in OpenAPI.
22+
// see also https://github.com/OAI/OpenAPI-Specification/issues/1368
23+
return new[] { type };
24+
}
25+
2026
if (_subTypesCache.TryGetValue(type, out ISet<Type>? cachedResult))
2127
{
2228
return cachedResult;
@@ -30,32 +36,9 @@ public IEnumerable<Type> FindSubTypes(Type type)
3036
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
3137
{
3238
JsonTypeInfo result = base.GetTypeInfo(type, options);
33-
34-
if (type.IsInterface)
35-
{
36-
return GetTypeInfoForInterface(result, type, options);
37-
}
38-
else
39-
{
40-
return GetTypeInfoForClass(result, type, options);
41-
}
42-
43-
}
44-
45-
private JsonTypeInfo GetTypeInfoForClass(JsonTypeInfo result, Type type, JsonSerializerOptions options)
46-
{
47-
if (result.Kind != JsonTypeInfoKind.Object || !type.GetInterfaces().Any())
48-
{
49-
return result;
50-
}
51-
52-
JsonPolymorphismOptions jsonPolymorphismOptions = result.PolymorphismOptions ?? new JsonPolymorphismOptions();
53-
54-
jsonPolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(type, type.Name));
55-
56-
result.PolymorphismOptions = jsonPolymorphismOptions;
57-
58-
return result;
39+
return type.IsInterface
40+
? GetTypeInfoForInterface(result, type, options)
41+
: result;
5942
}
6043

6144
private JsonTypeInfo GetTypeInfoForInterface(JsonTypeInfo result, Type type, JsonSerializerOptions options)

src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdContentApiController.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
using Asp.Versioning;
22
using Microsoft.AspNetCore.Http;
33
using Microsoft.AspNetCore.Mvc;
4-
using Microsoft.Extensions.DependencyInjection;
54
using Umbraco.Cms.Core.DeliveryApi;
6-
using Umbraco.Cms.Core.DependencyInjection;
75
using Umbraco.Cms.Core.Models.DeliveryApi;
86
using Umbraco.Cms.Core.Models.PublishedContent;
9-
using Umbraco.Cms.Core.Services;
107

118
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
129

@@ -16,32 +13,6 @@ public class ByIdContentApiController : ContentApiItemControllerBase
1613
{
1714
private readonly IRequestMemberAccessService _requestMemberAccessService;
1815

19-
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
20-
public ByIdContentApiController(
21-
IApiPublishedContentCache apiPublishedContentCache,
22-
IApiContentResponseBuilder apiContentResponseBuilder,
23-
IPublicAccessService publicAccessService)
24-
: this(
25-
apiPublishedContentCache,
26-
apiContentResponseBuilder,
27-
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
28-
{
29-
}
30-
31-
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
32-
public ByIdContentApiController(
33-
IApiPublishedContentCache apiPublishedContentCache,
34-
IApiContentResponseBuilder apiContentResponseBuilder,
35-
IPublicAccessService publicAccessService,
36-
IRequestMemberAccessService requestMemberAccessService)
37-
: this(
38-
apiPublishedContentCache,
39-
apiContentResponseBuilder,
40-
requestMemberAccessService)
41-
{
42-
}
43-
44-
[ActivatorUtilitiesConstructor]
4516
public ByIdContentApiController(
4617
IApiPublishedContentCache apiPublishedContentCache,
4718
IApiContentResponseBuilder apiContentResponseBuilder,

src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdsContentApiController.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
using Asp.Versioning;
22
using Microsoft.AspNetCore.Http;
33
using Microsoft.AspNetCore.Mvc;
4-
using Microsoft.Extensions.DependencyInjection;
54
using Umbraco.Cms.Core.DeliveryApi;
6-
using Umbraco.Cms.Core.DependencyInjection;
75
using Umbraco.Cms.Core.Models.DeliveryApi;
86
using Umbraco.Cms.Core.Models.PublishedContent;
9-
using Umbraco.Cms.Core.Services;
107
using Umbraco.Extensions;
118

129
namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
@@ -17,32 +14,6 @@ public class ByIdsContentApiController : ContentApiItemControllerBase
1714
{
1815
private readonly IRequestMemberAccessService _requestMemberAccessService;
1916

20-
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
21-
public ByIdsContentApiController(
22-
IApiPublishedContentCache apiPublishedContentCache,
23-
IApiContentResponseBuilder apiContentResponseBuilder,
24-
IPublicAccessService publicAccessService)
25-
: this(
26-
apiPublishedContentCache,
27-
apiContentResponseBuilder,
28-
StaticServiceProvider.Instance.GetRequiredService<IRequestMemberAccessService>())
29-
{
30-
}
31-
32-
[Obsolete($"Please use the constructor that does not accept {nameof(IPublicAccessService)}. Will be removed in V14.")]
33-
public ByIdsContentApiController(
34-
IApiPublishedContentCache apiPublishedContentCache,
35-
IApiContentResponseBuilder apiContentResponseBuilder,
36-
IPublicAccessService publicAccessService,
37-
IRequestMemberAccessService requestMemberAccessService)
38-
: this(
39-
apiPublishedContentCache,
40-
apiContentResponseBuilder,
41-
requestMemberAccessService)
42-
{
43-
}
44-
45-
[ActivatorUtilitiesConstructor]
4617
public ByIdsContentApiController(
4718
IApiPublishedContentCache apiPublishedContentCache,
4819
IApiContentResponseBuilder apiContentResponseBuilder,

0 commit comments

Comments
 (0)