Skip to content

Commit f7284f9

Browse files
committed
Merge branch 'main' into v16/poc/dashboard-apps
2 parents 32694ca + a2cc6a0 commit f7284f9

File tree

1,072 files changed

+16661
-7276
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,072 files changed

+16661
-7276
lines changed

.github/contributing-backoffice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ To declare the Published Cache Status Dashboard as a new manifest, we need to ad
114114
},
115115
conditions: [
116116
{
117-
alias: 'Umb.Condition.SectionAlias',
117+
alias: UMB_SECTION_ALIAS_CONDITION_ALIAS,
118118
match: 'Umb.Section.Settings',
119119
},
120120
],

.github/workflows/azure-backoffice.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020

2121
jobs:
2222
build_and_deploy_job:
23-
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed' && (contains(github.event.pull_request.labels.*.name, 'preview/backoffice')))
23+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'preview/backoffice') && github.repository == github.event.pull_request.head.repo.full_name)
2424
runs-on: ubuntu-latest
2525
name: Build and Deploy Job
2626
steps:
@@ -44,7 +44,7 @@ jobs:
4444
###### End of Repository/Build Configurations ######
4545

4646
close_pull_request_job:
47-
if: github.event_name == 'pull_request' && github.event.action == 'closed'
47+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'preview/backoffice') && github.repository == github.event.pull_request.head.repo.full_name
4848
runs-on: ubuntu-latest
4949
name: Close Pull Request Job
5050
steps:

.github/workflows/azure-storybook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323

2424
jobs:
2525
build_and_deploy_job:
26-
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed' && (contains(github.event.pull_request.labels.*.name, 'preview/storybook')))
26+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'preview/storybook') && github.repository == github.event.pull_request.head.repo.full_name)
2727
runs-on: ubuntu-latest
2828
name: Build and Deploy Job
2929
steps:
@@ -45,7 +45,7 @@ jobs:
4545
###### End of Repository/Build Configurations ######
4646

4747
close_pull_request_job:
48-
if: github.event_name == 'pull_request' && github.event.action == 'closed'
48+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'preview/storybook') && github.repository == github.event.pull_request.head.repo.full_name
4949
runs-on: ubuntu-latest
5050
name: Close Pull Request Job
5151
steps:

src/Umbraco.Cms.Api.Common/Configuration/ConfigureOpenIddict.cs

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

55
namespace Umbraco.Cms.Api.Common.Configuration;
66

7-
internal class ConfigureOpenIddict : IConfigureOptions<OpenIddictServerAspNetCoreOptions>
7+
internal sealed class ConfigureOpenIddict : IConfigureOptions<OpenIddictServerAspNetCoreOptions>
88
{
99
private readonly IOptions<GlobalSettings> _globalSettings;
1010

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public ProcessRequestContextHandler(IHttpContextAccessor httpContextAccessor)
1818
var backOfficePathSegment = Constants.System.DefaultUmbracoPath.TrimStart(Constants.CharArrays.Tilde)
1919
.EnsureStartsWith('/')
2020
.EnsureEndsWith('/');
21-
_pathsToHandle = [backOfficePathSegment, "/.well-known/openid-configuration"];
21+
_pathsToHandle = [backOfficePathSegment, "/.well-known/openid-configuration", "/.well-known/jwks"];
2222
}
2323

2424
public ValueTask HandleAsync(OpenIddictServerEvents.ProcessRequestContext context)

src/Umbraco.Cms.Api.Common/Json/NamedSystemTextJsonInputFormatter.cs

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

55
namespace Umbraco.Cms.Api.Common.Json;
66

7-
internal class NamedSystemTextJsonInputFormatter : SystemTextJsonInputFormatter
7+
internal sealed class NamedSystemTextJsonInputFormatter : SystemTextJsonInputFormatter
88
{
99
private readonly string _jsonOptionsName;
1010

src/Umbraco.Cms.Api.Common/Json/NamedSystemTextJsonOutputFormatter.cs

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

44
namespace Umbraco.Cms.Api.Common.Json;
55

6-
7-
internal class NamedSystemTextJsonOutputFormatter : SystemTextJsonOutputFormatter
6+
internal sealed class NamedSystemTextJsonOutputFormatter : SystemTextJsonOutputFormatter
87
{
98
private readonly string _jsonOptionsName;
109

src/Umbraco.Cms.Api.Delivery/Caching/DeliveryApiOutputCachePolicy.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
using Microsoft.AspNetCore.OutputCaching;
1+
using Microsoft.AspNetCore.OutputCaching;
22
using Microsoft.Extensions.DependencyInjection;
3+
using Microsoft.Extensions.Primitives;
34
using Umbraco.Cms.Core.DeliveryApi;
45

56
namespace Umbraco.Cms.Api.Delivery.Caching;
67

78
internal sealed class DeliveryApiOutputCachePolicy : IOutputCachePolicy
89
{
910
private readonly TimeSpan _duration;
11+
private readonly StringValues _varyByHeaderNames;
1012

11-
public DeliveryApiOutputCachePolicy(TimeSpan duration)
12-
=> _duration = duration;
13+
public DeliveryApiOutputCachePolicy(TimeSpan duration, StringValues varyByHeaderNames)
14+
{
15+
_duration = duration;
16+
_varyByHeaderNames = varyByHeaderNames;
17+
}
1318

1419
ValueTask IOutputCachePolicy.CacheRequestAsync(OutputCacheContext context, CancellationToken cancellationToken)
1520
{
@@ -20,6 +25,7 @@ ValueTask IOutputCachePolicy.CacheRequestAsync(OutputCacheContext context, Cance
2025

2126
context.EnableOutputCaching = requestPreviewService.IsPreview() is false;
2227
context.ResponseExpirationTimeSpan = _duration;
28+
context.CacheVaryByRules.HeaderNames = _varyByHeaderNames;
2329

2430
return ValueTask.CompletedTask;
2531
}

src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void Configure(SwaggerGenOptions options)
2626
options.OperationFilter<DeliveryApiSecurityFilter>();
2727
}
2828

29-
private class DeliveryApiSecurityFilter : SwaggerFilterBase<ContentApiControllerBase>, IOperationFilter, IDocumentFilter
29+
private sealed class DeliveryApiSecurityFilter : SwaggerFilterBase<ContentApiControllerBase>, IOperationFilter, IDocumentFilter
3030
{
3131
public void Apply(OpenApiOperation operation, OperationFilterContext context)
3232
{

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.AspNetCore.Routing;
66
using Microsoft.Extensions.Configuration;
77
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.Extensions.Primitives;
89
using Umbraco.Cms.Api.Common.DependencyInjection;
910
using Umbraco.Cms.Api.Delivery.Accessors;
1011
using Umbraco.Cms.Api.Delivery.Caching;
@@ -110,12 +111,20 @@ private static IUmbracoBuilder AddOutputCache(this IUmbracoBuilder builder)
110111

111112
if (outputCacheSettings.ContentDuration.TotalSeconds > 0)
112113
{
113-
options.AddPolicy(Constants.DeliveryApi.OutputCache.ContentCachePolicy, new DeliveryApiOutputCachePolicy(outputCacheSettings.ContentDuration));
114+
options.AddPolicy(
115+
Constants.DeliveryApi.OutputCache.ContentCachePolicy,
116+
new DeliveryApiOutputCachePolicy(
117+
outputCacheSettings.ContentDuration,
118+
new StringValues([Constants.DeliveryApi.HeaderNames.AcceptLanguage, Constants.DeliveryApi.HeaderNames.AcceptSegment, Constants.DeliveryApi.HeaderNames.StartItem])));
114119
}
115120

116121
if (outputCacheSettings.MediaDuration.TotalSeconds > 0)
117122
{
118-
options.AddPolicy(Constants.DeliveryApi.OutputCache.MediaCachePolicy, new DeliveryApiOutputCachePolicy(outputCacheSettings.MediaDuration));
123+
options.AddPolicy(
124+
Constants.DeliveryApi.OutputCache.MediaCachePolicy,
125+
new DeliveryApiOutputCachePolicy(
126+
outputCacheSettings.MediaDuration,
127+
Constants.DeliveryApi.HeaderNames.StartItem));
119128
}
120129
});
121130

0 commit comments

Comments
 (0)