Skip to content

Commit cf2452d

Browse files
authored
Merge branch 'v17/dev' into v17/feature/preview-urls
2 parents 6eb1071 + dd01a56 commit cf2452d

File tree

211 files changed

+7962
-1208
lines changed

Some content is hidden

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

211 files changed

+7962
-1208
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ This guide describes each step to make your first contribution:
6161
## Further contribution guides
6262

6363
- [Before you start](contributing-before-you-start.md)
64-
- [Finding your first issue: Up for grabs](contributing-first-issue.md)
64+
- [Finding your first issue](contributing-first-issue.md)
6565
- [Contributing to the new backoffice](https://docs.umbraco.com/umbraco-backoffice/)
6666
- [Unwanted changes](contributing-unwanted-changes.md)
6767
- [Other ways to contribute](contributing-other-ways-to-contribute.md)

.github/contributing-first-issue.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
## Finding your first issue: Up for grabs
1+
## Finding your first issue
22

3-
Umbraco HQ will regularly mark newly created issues on the issue tracker with [the `community/up-for-grabs` tag][up for grabs issues]. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. We encourage anyone to pick them up and help out.
3+
Umbraco HQ will regularly mark newly created issues on the issue tracker with [the `community/up-for-grabs` tag][up for grabs issues]. This means that the proposed changes are wanted in Umbraco but the HQ does not have the time to make them at this time. In adding the label we will endeavour to provide some guidelines on how to go about the implementation, such that it aligns with the project. We encourage anyone to pick them up and help out.
4+
5+
You don't need to restrict yourselves to issues that are specifically marked as "up for grabs" though. If you are running into a bug you have reported or found on the [issue tracker][issue tracker], it's not necessary to wait for HQ response. Feel free to dive in and try to provide a fix, raising questions as you need if you have concerns about the modifications necessary to resolve the problem.
46

57
If you do start working on something, make sure to leave a small comment on the issue saying something like: "I'm working on this". That way other people stumbling upon the issue know they don't need to pick it up, someone already has.
68

@@ -11,15 +13,15 @@ Great question! The short version goes like this:
1113
1. **Fork**
1214

1315
Create a fork of [`Umbraco-CMS` on GitHub][Umbraco CMS repo]
14-
16+
1517
![Fork the repository](img/forkrepository.png)
16-
18+
1719
1. **Clone**
1820

1921
When GitHub has created your fork, you can clone it in your favorite Git tool
20-
21-
![Clone the fork](img/clonefork.png)
22-
22+
23+
![Clone the fork](img/clonefork.png)
24+
2325
1. **Switch to the correct branch**
2426

2527
Switch to the `contrib` branch
@@ -90,4 +92,5 @@ You can get in touch with [the core contributors team][core collabs] in multiple
9092
[draft prs]: https://github.blog/2019-02-14-introducing-draft-pull-requests/ "Github's blog post providing details on draft pull requests"
9193
[contrib forum]: https://our.umbraco.com/forum/contributing-to-umbraco-cms/
9294
[Umbraco CMS repo]: https://github.com/umbraco/Umbraco-CMS
93-
[up for grabs issues]: https://github.com/umbraco/Umbraco-CMS/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs
95+
[up for grabs issues]: https://github.com/umbraco/Umbraco-CMS/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs
96+
[issue tracker]: https://github.com/umbraco/Umbraco-CMS/issues

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Company>Umbraco HQ</Company>
66
<Authors>Umbraco</Authors>
77
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>

Directory.Packages.props

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,38 @@
77
<ItemGroup>
88
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" />
99
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
10-
<GlobalPackageReference Include="Umbraco.Code" Version="2.3.0" />
10+
<GlobalPackageReference Include="Umbraco.Code" Version="2.4.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="9.0.4" />
16-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
17-
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.13.0" />
18-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0" />
19-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0" />
20-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0" />
21-
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.4" />
22-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
23-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.4" />
24-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.4" />
25-
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.4" />
26-
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.4" />
27-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.4" />
28-
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.4" />
29-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
30-
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.4" />
31-
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.4" />
32-
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.4" />
33-
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.4" />
34-
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="9.0.4" />
35-
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="9.0.4" />
36-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.4" />
37-
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.4" />
38-
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.4" />
39-
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.4" />
40-
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="9.4.0" />
15+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.0-preview.7.25380.108" />
16+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
17+
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
18+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
19+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0" />
20+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" />
21+
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.0-preview.7.25380.108" />
22+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0-preview.7.25380.108" />
23+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0-preview.7.25380.108" />
24+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0-preview.7.25380.108" />
25+
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.0-preview.7.25380.108" />
26+
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0-preview.7.25380.108" />
27+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0-preview.7.25380.108" />
28+
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0-preview.7.25380.108" />
29+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0-preview.7.25380.108" />
30+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.0-preview.7.25380.108" />
31+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="10.0.0-preview.7.25380.108" />
32+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0-preview.7.25380.108" />
33+
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.0-preview.7.25380.108" />
34+
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="10.0.0-preview.7.25380.108" />
35+
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="10.0.0-preview.7.25380.108" />
36+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0-preview.7.25380.108" />
37+
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.0-preview.7.25380.108" />
38+
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.0-preview.7.25380.108" />
39+
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="10.0.0-preview.7.25380.108" />
40+
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="9.8.0" />
41+
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
4142
</ItemGroup>
4243
<!-- Umbraco packages -->
4344
<ItemGroup>
@@ -86,18 +87,18 @@
8687
<!-- Take top-level depedendency on Azure.Identity, because Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
8788
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
8889
<!-- Microsoft.EntityFrameworkCore.SqlServer brings in a vulnerable version of System.Runtime.Caching -->
89-
<PackageVersion Include="System.Runtime.Caching" Version="9.0.4" />
90+
<PackageVersion Include="System.Runtime.Caching" Version="10.0.0-preview.7.25380.108" />
9091
<!-- Dazinator.Extensions.FileProviders brings in a vulnerable version of System.Net.Http -->
9192
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
9293
<!-- Examine brings in a vulnerable version of System.Security.Cryptography.Xml -->
93-
<PackageVersion Include="System.Security.Cryptography.Xml" Version="9.0.4" />
94+
<PackageVersion Include="System.Security.Cryptography.Xml" Version="10.0.0-preview.7.25380.108" />
9495
<!-- Dazinator.Extensions.FileProviders and MiniProfiler.AspNetCore.Mvc brings in a vulnerable version of System.Text.RegularExpressions -->
9596
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
9697
<!-- OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer brings in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
9798
<!-- Take top-level depedendency on Microsoft.IdentityModel.JsonWebTokens, because OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer depends on a vulnerable version -->
9899
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.8.0" />
99100
<!-- Azure.Identity, Microsoft.EntityFrameworkCore.SqlServer and Dazinator.Extensions.FileProviders brings in a legacy version of System.Text.Encodings.Web -->
100-
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.4" />
101+
<PackageVersion Include="System.Text.Encodings.Web" Version="10.0.0-preview.7.25380.108" />
101102
<!-- NPoco.SqlServer brings in a vulnerable version of Microsoft.Data.SqlClient -->
102103
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.0.1" />
103104
<!-- Examine.Lucene brings in a vulnerable version of Lucene.Net.Replicator -->

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.100",
3+
"version": "10.0.100-preview.7.25380.108",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

src/Umbraco.Cms.Api.Delivery/DependencyInjection/UmbracoBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static IUmbracoBuilder AddDeliveryApi(this IUmbracoBuilder builder)
5151
});
5252
builder.Services.AddSingleton<IRequestCultureService, RequestCultureService>();
5353
builder.Services.AddSingleton<IRequestSegmmentService, RequestSegmentService>();
54+
builder.Services.AddSingleton<IRequestSegmentService, RequestSegmentService>();
5455
builder.Services.AddSingleton<IRequestRoutingService, RequestRoutingService>();
5556
builder.Services.AddSingleton<IRequestRedirectService, RequestRedirectService>();
5657
builder.Services.AddSingleton<IRequestPreviewService, RequestPreviewService>();

src/Umbraco.Cms.Api.Delivery/Filters/ContextualizeFromAcceptHeadersAttribute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.AspNetCore.Mvc;
1+
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.AspNetCore.Mvc.Filters;
33
using Umbraco.Cms.Core.DeliveryApi;
44
using Umbraco.Cms.Core.Models.PublishedContent;
@@ -16,12 +16,12 @@ public ContextualizeFromAcceptHeadersAttribute()
1616
private sealed class LocalizeFromAcceptLanguageHeaderAttributeFilter : IActionFilter
1717
{
1818
private readonly IRequestCultureService _requestCultureService;
19-
private readonly IRequestSegmmentService _requestSegmentService;
19+
private readonly IRequestSegmentService _requestSegmentService;
2020
private readonly IVariationContextAccessor _variationContextAccessor;
2121

2222
public LocalizeFromAcceptLanguageHeaderAttributeFilter(
2323
IRequestCultureService requestCultureService,
24-
IRequestSegmmentService requestSegmentService,
24+
IRequestSegmentService requestSegmentService,
2525
IVariationContextAccessor variationContextAccessor)
2626
{
2727
_requestCultureService = requestCultureService;

src/Umbraco.Cms.Api.Delivery/Services/RequestSegmentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Umbraco.Cms.Api.Delivery.Services;
55

6-
internal sealed class RequestSegmentService : RequestHeaderHandler, IRequestSegmmentService
6+
internal sealed class RequestSegmentService : RequestHeaderHandler, IRequestSegmentService, IRequestSegmmentService
77
{
88
public RequestSegmentService(IHttpContextAccessor httpContextAccessor)
99
: base(httpContextAccessor)

src/Umbraco.Cms.Api.Delivery/Umbraco.Cms.Api.Delivery.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Title>Umbraco CMS - Delivery API</Title>
44
<Description>Contains the presentation layer for the Umbraco CMS Delivery API.</Description>
55
</PropertyGroup>
6-
6+
77
<PropertyGroup>
88
<!--
99
TODO: Fix and remove overrides:
@@ -12,12 +12,18 @@
1212
-->
1313
<WarningsNotAsErrors>$(WarningsNotAsErrors),ASP0019,CS0618,CS0612</WarningsNotAsErrors>
1414
</PropertyGroup>
15-
15+
1616
<ItemGroup>
1717
<ProjectReference Include="..\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
1818
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<PackageReference Include="System.Linq.Async">
23+
<ExcludeAssets>compile</ExcludeAssets>
24+
</PackageReference>
25+
</ItemGroup>
26+
2127
<ItemGroup>
2228
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
2329
<_Parameter1>Umbraco.Tests.UnitTests</_Parameter1>

src/Umbraco.Cms.Api.Management/Configuration/ConfigureBackOfficeCookieOptions.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.AspNetCore.Http;
66
using Microsoft.Extensions.DependencyInjection;
77
using Microsoft.Extensions.Options;
8+
using Microsoft.Net.Http.Headers;
89
using Umbraco.Cms.Api.Management.Security;
910
using Umbraco.Cms.Core;
1011
using Umbraco.Cms.Core.Configuration.Models;
@@ -219,10 +220,44 @@ public void Configure(CookieAuthenticationOptions options)
219220
}
220221

221222
return Task.CompletedTask;
222-
}
223+
},
224+
// FIXME: We want to change this over to using an attribute on the backoffice controllers
225+
// See this for more: https://github.com/dotnet/aspnetcore/issues/63093#issuecomment-3201530217
226+
OnRedirectToLogin = context =>
227+
{
228+
if (IsXhr(context.Request))
229+
{
230+
context.Response.Headers.Location = context.RedirectUri;
231+
context.Response.StatusCode = 401;
232+
}
233+
else
234+
{
235+
context.Response.Redirect(context.RedirectUri);
236+
}
237+
238+
return Task.CompletedTask;
239+
},
240+
OnRedirectToAccessDenied = context =>
241+
{
242+
if (IsXhr(context.Request))
243+
{
244+
context.Response.Headers.Location = context.RedirectUri;
245+
context.Response.StatusCode = 403;
246+
}
247+
else
248+
{
249+
context.Response.Redirect(context.RedirectUri);
250+
}
251+
252+
return Task.CompletedTask;
253+
},
223254
};
224255
}
225256

257+
private bool IsXhr(HttpRequest request) =>
258+
string.Equals(request.Query[HeaderNames.XRequestedWith], "XMLHttpRequest", StringComparison.Ordinal) ||
259+
string.Equals(request.Headers.XRequestedWith, "XMLHttpRequest", StringComparison.Ordinal);
260+
226261
/// <summary>
227262
/// Ensures the ticket is renewed if the <see cref="SecuritySettings.KeepUserLoggedIn" /> is set to true
228263
/// and the current request is for the get user seconds endpoint

0 commit comments

Comments
 (0)