Compare commits

..
453 Commits
Author SHA1 Message Date
Andreas ZerbstandGitHub 9ab0abca99 E2E: Stop running version 14 on nightly test pipeline (#20558)
Stops 14 from running on our nightly test pipeline
2025-10-20 12:05:42 +02:00
Andy Butland 009a999e22 Merge branch 'release/14.3.4' into v14/dev 2025-04-08 07:15:06 +02:00
Andy ButlandandGitHub d3c1443b14 Merge commit from fork
* Prevent path traveral vulnerability with upload of temporary files.

* Used BadRequest instead of NotFound for invalid file name response.
2025-04-08 05:03:40 +02:00
Andy Butland 8a9db11422 Merge branch 'release/14.3.3' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	version.json
2025-03-11 09:28:52 +01:00
Andy ButlandandGitHub d9fb6df16e Merge commit from fork
* Bumped version to 15.2.1.

# Conflicts:
#	version.json

* Tighten management API endpoint access rules.
2025-03-11 05:11:35 +01:00
Andy Butland 14ed3348bf bumped imagesharp to prevent CVE-2025-27598 (#18602)
# Conflicts:
#	Directory.Packages.props
2025-03-09 08:54:03 +01:00
Sven Geusens 9e7a36865a Merge branch 'v13/dev' into v14/dev
Revert #18249 as it is reimplemented for v15
Revert #18320 as the new architecture explictly throws an error

# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Core/Models/ContentEditing/ContentSaveAction.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/IContentService.cs
#	src/Umbraco.Core/Services/MemberService.cs
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/MemberUserStore.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.BackOfficeAuth.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs
#	src/Umbraco.Web.Common/RuntimeMinification/SmidgeOptionsSetup.cs
#	src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs
#	src/Umbraco.Web.Common/Views/UmbracoViewPage.cs
#	src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/publicaccess.resource.js
#	src/Umbraco.Web.UI.Client/src/common/resources/users.resource.js
#	src/Umbraco.Web.UI.Client/src/common/services/assets.service.js
#	src/Umbraco.Web.UI.Client/src/views/common/drawers/help/help.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediaentryeditor/mediaentryeditor.controller.js
#	src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html
#	src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html
#	src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client/src/views/users/views/user/details.html
#	src/Umbraco.Web.UI.Client/src/views/webhooks/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/webhooks/edit.html
#	src/Umbraco.Web.UI.Client/test/unit/app/content/create-content-controller.spec.js
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/src/auth.element.ts
#	tests/Umbraco.TestData/UmbracoTestDataController.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs
#	version.json
2025-02-17 19:25:45 +01:00
Andy ButlandandGitHub db1d999721 Avoid exception when attempting to find member by Id when Id is not an expected Guid or integer, as can be the case with external member providers. (#18320) 2025-02-17 12:47:52 +01:00
Andy ButlandandGitHub 18047a7cfb Only filter post retrieval of entities for start nodes if working with entities that support start nodes. (#18287) 2025-02-17 12:45:51 +01:00
Andy ButlandandGitHub def7ebd48c Html encodes the user's name in the invite email. (#18343) 2025-02-17 12:25:12 +01:00
8c2b1ebdc5 V13: Introduce publishNotifications method on IMembershipMemberService (#18207)
* Introduce publishNotifications method on IMembershipMemberService.cs

* Fix test

* Add PublishNotificationSaveOptions

* Fix up according to comments

* Use numeric values for flag enum

* Update src/Umbraco.Core/Services/MemberService.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Update src/Umbraco.Core/Services/MemberService.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-12 13:30:41 +01:00
Andy ButlandandGitHub 9227517a50 Split force for publish descendants into separate options for publish unpublish and re-publish unedited (13) (#18249)
* Split force for publish descendents into separate options for publish unpublish and re-publish unedited.

* Added integration task verifying updated behaviour.

* Variant integration test.

* Update test data controller.

* Remove usued function parameters.

* Refactor to enum.

* Fixed flags enum.

* Variable name refactor.

* Applied changes from code review.

* Refactored method name.

* Aligned js boolean checks.
2025-02-12 11:30:27 +00:00
Andy Butland 5322d0f7b5 Bumped version to 13.8.0-rc. 2025-02-12 08:13:58 +01:00
Andy ButlandandGitHub a282cc5691 Backport use of thread delay over sleep and handle dispose in FileSystemMainDomLock (#18151)
* Backport use of thread delay over sleep and handle dispose in FileSystemMainDomLock (from PRs #18119 and #18147)

* Applied suggestion from code review.
2025-02-12 08:06:50 +01:00
Andy ButlandandGitHub 048f8bcdf9 Fixed userResource request to get all users. (#18105) 2025-02-11 17:06:18 +01:00
Andy ButlandandGitHub 7bcbc748d4 URL encodes member user names when passing information for public access setting such that those with user names as emails containing a plus will be included in the rule. (#18142) 2025-02-11 13:36:19 +01:00
Andy ButlandandGitHub f30e6cfe7f Prevents folder selection in media picker when used from the multi URL picker. (#18288) 2025-02-11 09:18:01 +01:00
Andy ButlandandGitHub 026e80e026 Avoid an exception on sign out when the principal is populated from an incomplete external login (#18078)
* Avoid an exception on signout when the principal is populated from an incomplete external login.

* Tidied up comment.
2025-02-10 12:51:35 +01:00
Andy ButlandandGitHub a3b77cff63 Add validation to prevent update of a user or member to an invalid username (13) (#18261)
* Add validation to prevent update of a user or member to an invalid username.

* Avoid password manager updates of user name field on user details screen.
2025-02-10 10:40:53 +01:00
Niels LyngsøandGitHub 4ca68d6995 Add client-side validation for RTE (#18257) 2025-02-07 11:43:04 +00:00
Sven GeusensandGitHub 280cb7f2b1 Fix issues in newly added buttongroup localization (#18254)
* Fix #18253 nullref exception

* Fix #18239 by listening to broader scope changes
2025-02-07 07:00:34 +01:00
095a73132c Review: Allow Duplicate Email for Members (#16202)
* init

* Aligned default values on security settings.

* Added validator for security settings.

* Provide default implementation for get members by email.

* Refactored constructor of MemberController.

* Validate on unique member email only when configured to do so.

* Further code tidy and use of DI in constructor.

* Used new constructor in tests.

* Add unit test for modified behaviour.

* Removed validator for security settings (it's not necessary, I got confused with users and members).

* Spelling.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-05 12:38:40 +01:00
Andy Butland cfb0fc23ac Merge branch 'v13/dev' into v13/contrib 2025-02-04 12:35:49 +01:00
6620aca9fe Cache null dictionary values by key (#15576)
* Add CacheNullValues option to RepositoryCachePolicy

* Cache null values in DictionaryByKeyRepository

* Fixed issue with nullable reference.

* Updated logic for caching of null values.

* Update src/Umbraco.Infrastructure/Cache/DefaultRepositoryCachePolicy.cs

Co-authored-by: Sven Geusens <geusens@gmail.com>

* Made the NullValueRepresentation overwritable in a generic manner

* Improve generic NullValueCachePolicyResolver

* Revert Commits and clarify logic with comment

This reverts commit 8befb43792 "Improve generic NullValueCachePolicyResolver"
Also reverts 8adf0a2 - Made the NullValueRepresentation overwritable in a generic manner
And 8adf0a2 - Made the NullValueRepresentation overwritable in a generic manner

* Update src/Umbraco.Infrastructure/Cache/DefaultRepositoryCachePolicy.cs

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Sven Geusens <geusens@gmail.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-02-04 12:29:21 +01:00
2422a02b23 Set Smidge cachebuster type (#18198)
* Set Smidge cachebuster type

* Amend exception and fix typo

* Minor tweak to comment and exception message.

---------

Co-authored-by: Simon Hartfield <simon.hartfield@googlemail.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-04 11:00:44 +00:00
b4a9dc0770 V13: Fix members while using basic auth. (#18206)
* Flow additional identities to new principal

* Add extension to more easily get member identity

* Ensure the member is used instead of the backoffice user in `MemberManager`

* Update snippet

* Fix the comment that I broke

* Update src/Umbraco.Web.Common/Extensions/MemberClaimsPrincipalExtensions.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-02-03 19:48:08 +01:00
Andy ButlandandGitHub e7411244fd Show notifications menu only to users with permission for the feature. (#18184) 2025-02-03 13:24:58 +01:00
Kenn JacobsenandGitHub 9f357173c3 Enforce user start nodes for media uploads through the RTE (#18204) 2025-02-03 12:50:23 +01:00
Andy Butland 7dc6e3ed5b Merge branch 'v13/dev' into v13/contrib 2025-01-31 16:16:22 +01:00
Gareth WrightandGitHub 5dfff212d0 Update auth.element.ts (#18192)
auth_username => general_username
2025-01-31 14:59:25 +01:00
17615f966b Fix out of memory of 2gb+ (max 4gb) error introduced by #14657 SVG xss security fix (#17421)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-31 13:46:56 +00:00
Kenn JacobsenandGitHub 7a2d6b6c63 More robust resolving of Delivery API redirects (#18160) 2025-01-31 14:26:07 +01:00
Sven Geusens 343867f6ee Merge branch 'release/13.6' into v13/dev and version bump
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	version.json
2025-01-30 16:27:49 +01:00
Bjarke BergandSven Geusens b9837ac77c Optimize Azure pipeline (#17674)
* Only fetch single commit

* Hopefully fixes Nerdbank.GitVersioning.GitException: Shallow clone lacks the objects required to calculate version height. Use full clones or clones with a history at least as deep as the last version height resetting change.

* Do not checkout again

* More test pipeline

* Another attempt

* yet another attempt

* more attempts

* Revert "more attempts"

This reverts commit 5694d97ba6.

* Test without building backoffice and login explicitly

* Fix mem leak in integration tests

* Fixes sqlserver lock test
# Conflicts:
#	build/azure-pipelines.yml
2025-01-30 14:10:05 +01:00
Sven Geusens bb73ec6c68 Set release version 2025-01-30 09:52:50 +01:00
Andy ButlandandGitHub ee2d7bbb1b Excluded tags from trashed content (#18164) 2025-01-29 21:10:11 +01:00
Andy ButlandandGitHub 5d48bc7371 Provides an option to remove the inessential version number from the generated models (#18081)
* Provides an option to remove the inessential version number from the generated models.

* Clarified comment.
2025-01-29 13:33:49 +01:00
Kenn JacobsenandGitHub 59a4649528 Do not allow editing read-only properties by clicking their labels (#18152)
* Do not allow editing read-only properties by clicking their labels

* Simplify the fix :)

* Fix linting issue
2025-01-29 10:29:58 +01:00
Andy ButlandandGitHub f54b6033ab Added Resharper test assemblies to exclude list on TypeFinder. (#18145) 2025-01-29 10:27:17 +01:00
Jacob OvergaardandGitHub bf340cd7d4 fix: remove unused parameters and documentation (#18095)
this fixes an issue where unused parameters were published as supported, but they were in fact never supported.
2025-01-28 10:53:00 +00:00
Andy Butland 313417cb91 Tidied up XML header comment in ITagQuery. 2025-01-28 10:52:21 +01:00
7850078623 Redirect to the published URL when exiting preview (#18114)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-24 18:46:28 +00:00
44bf3b77b3 Make it possible to reset media picker crops (#18110)
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-01-24 13:41:30 +00:00
Kenn JacobsenandGitHub 8485458896 Add clientside validation to webhook events (#18089) 2025-01-23 17:01:55 +01:00
Nikolaj Geisle 3d253f5f06 bump version 2025-01-23 11:15:26 +01:00
Nikolaj Geisle 64287d7e1a Merge branch 'release/13.5.3' into release/13.6
# Conflicts:
#	version.json
2025-01-23 11:14:47 +01:00
Andy ButlandandGitHub edc78a5a4c Handles migration case where an expected constraint is renamed but the constraint does not exist. (#18063) 2025-01-22 12:26:06 +01:00
Andy Butland 8056a59a10 Fix schema defined in JSON schema tool definition after merge from 13. 2025-01-21 15:52:31 +01:00
1a18d6c035 Replaced deprecated navigator.platform with navigator.userAgent for platform detection. (#17373)
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-01-21 13:56:40 +01:00
Andy Butland 3e877182b5 Merge branch 'v13/contrib' into v13/dev 2025-01-21 09:47:20 +01:00
Martin VennevoldandGitHub 0e4f883bc1 Fix create child issue in list view with infinite editor (#13355). (#17637) 2025-01-21 09:44:22 +01:00
Andy Butland 265cc62ab8 Merge branch 'release/13.6' into v13/dev 2025-01-21 09:21:36 +01:00
Andy Butland 800c16970e Merge branch 'release/13.6' of https://github.com/umbraco/Umbraco-CMS into release/13.6 2025-01-21 09:20:11 +01:00
Andy Butland 6bd11bf233 Fixes failing front-end unit test to align with new behaviour from PR #17818 (
Allow skipSelect blueprints only when one blueprint exists).
2025-01-21 09:19:31 +01:00
Kenn Jacobsen a2fd82a3f3 Add NoopCurrentMemberClaimsProvider so Umbraco can boot without the Delivery API enabled (#18049) 2025-01-21 09:13:31 +01:00
Kenn JacobsenandSven Geusens 56c0aebd76 Add NoopCurrentMemberClaimsProvider so Umbraco can boot without the Delivery API enabled (#18049) 2025-01-21 09:12:20 +01:00
Kenn JacobsenandGitHub 7567990da1 Add NoopCurrentMemberClaimsProvider so Umbraco can boot without the Delivery API enabled (#18049) 2025-01-21 09:10:43 +01:00
Zeegaan c7d157bbfd build on ubuntu 2025-01-21 09:02:00 +01:00
Sven Geusens 4b9771c0eb Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderAuthExtensions.cs
#	src/Umbraco.Cms.Persistence.EFCore/Locking/SqlServerEFCoreDistributedLockingMechanism.cs
#	src/Umbraco.Core/Configuration/Models/RichTextEditorSettings.cs
#	src/Umbraco.Core/EmbeddedResources/Lang/da.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandler.cs
#	src/Umbraco.Web.BackOffice/Authorization/ContentPermissionsResourceHandler.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Trees/StaticFilesTreeController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js
#	src/Umbraco.Web.UI.Client/src/common/filters/simpleMarkdown.filter.js.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediaentryeditor/mediaentryeditor.less
#	src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/propertysettings/propertysettings.html
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/ysod/ysod.html
#	src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/sendtopublish.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/prevalue/blockgrid.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/package-lock.json
#	src/Umbraco.Web.UI.Login/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/BlockGridEditor/Content/blockGridEditorContent.spec.ts
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs
#	tools/Umbraco.JsonSchema/UmbracoCmsSchema.cs
#	version.json
2025-01-21 08:47:38 +01:00
Jacob Overgaard abc312c9b4 update backoffice submodule to 14.3.2 2025-01-21 08:44:10 +01:00
Nikolaj Geisle 2161edb871 Bump version 2025-01-21 07:41:06 +01:00
Nikolaj Geisle e77e9c5691 Format sql statement (#17354)
(cherry picked from commit aa9f194d76)
2025-01-20 18:27:54 +01:00
Nikolaj Geisle e934a943b5 build on windows 2025-01-20 17:37:04 +01:00
Ronald BarendseandNikolaj Geisle 65bb2801b0 Merge commit from fork
* Add TimedScope

* Use TimedScope in login endpoint

* Use seperate default duration and only calculate average of actual successful responses

* Only return detailed error responses if credentials are valid

* Cancel timed scope when credentials are valid

* Add UserDefaultFailedLoginDuration and UserMinimumFailedLoginDuration settings
2025-01-20 16:44:28 +01:00
Andy ButlandandGitHub a0a4af6a0c Merge commit from fork 2025-01-20 14:54:14 +01:00
Jacob Overgaard e8d6cded2b update backoffice submodule to 14.3.2 2025-01-20 14:42:17 +01:00
Bjarke BergandJacob Overgaard c65204a146 update backoffice submodule to 14.3.2 2025-01-20 14:34:03 +01:00
Andy ButlandandGitHub 95eb58587b Merge commit from fork 2025-01-20 14:14:28 +01:00
Andy ButlandandGitHub 86f3033334 Merge commit from fork 2025-01-20 14:14:28 +01:00
25628a8b76 Lucene Package Update to Address CVE-2024-43383 (#17942)
* Update Lucene Package to 4.8.0-beta00017

* Add Package Reference

---------

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2025-01-20 11:45:35 +01:00
Callum WhyteandAndy Butland 7552e315fb Allow skipSelect blueprints only when one blueprint exists (#17818) 2025-01-20 11:45:26 +01:00
Callum WhyteandGitHub d15b5b221e Allow skipSelect blueprints only when one blueprint exists (#17818) 2025-01-20 10:27:54 +01:00
60e3fa97a9 Lucene Package Update to Address CVE-2024-43383 (#17942)
* Update Lucene Package to 4.8.0-beta00017

* Add Package Reference

---------

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2025-01-20 10:04:02 +01:00
Sven Geusens fd1bd51aff bump version 2025-01-16 10:10:04 +01:00
Sven Geusens b12620af9c Merge branch 'release/13.6' into v13/dev 2025-01-16 10:08:43 +01:00
Sven Geusens d1af59fdf0 Merge branch 'v13/dev' into release/13.6 2025-01-15 22:13:42 +01:00
Andreas ZerbstandGitHub 1b050ebc47 V13 QA added parallelization for E2E tests (#17995)
* Added script for running tests

* Added parallelization for our E2E tests

* Removed line

* Removed condition
2025-01-15 22:12:45 +01:00
Sven Geusens ff3e457c58 Merge branch 'v13/dev' into release/13.6 2025-01-15 20:55:41 +01:00
Andy ButlandandGitHub 2ffaede07b Added a maxlength setting to the regular expression pattern field. (#17982) 2025-01-15 20:54:54 +01:00
Sven GeusensandGitHub 2a83f57262 Do not re-map schedule modal on error as it leads to broken bindings (#17990) 2025-01-15 17:35:23 +01:00
Kenn JacobsenandGitHub 5be9193978 Do not show "Save and preview" by default (#17986) 2025-01-15 15:42:37 +01:00
Niels LyngsøandSven Geusens d3f264fc54 Fix: only fire event when instance is available (issue 17847) (#17987)
* only fire event when instance is available

* avoid js issue when no markup
2025-01-15 14:01:33 +01:00
Niels LyngsøandGitHub 04ea002bf3 Fix: only fire event when instance is available (issue 17847) (#17987)
* only fire event when instance is available

* avoid js issue when no markup
2025-01-15 13:56:53 +01:00
Kenn JacobsenandGitHub 8f42a3a0ea Make the RTE handle inline elements gracefully for JSON (#17983) 2025-01-15 11:26:03 +01:00
Kenn JacobsenandGitHub 4dd8fbe25d Enforce the "Save and preview" button after when switching content app (#17985) 2025-01-15 09:55:00 +01:00
Sven GeusensandGitHub ee727c43e1 Added localizations for composite key of missing New (media) Audit item (#17981) 2025-01-14 21:08:47 +01:00
Jacob OvergaardandGitHub 395213946b build(deps): update @microsoft/signalr from 7.0.12 to 8.0.7 (#17973) 2025-01-14 15:44:52 +00:00
Andy ButlandandGitHub ed0b236208 Resets send to approval dialog on close such that when re-opening the selection and operation can still be triggered. (#17956) 2025-01-14 16:25:26 +01:00
Kenn JacobsenandGitHub 8d56e75257 Add Vary header to all content API operations (#17962)
* Add Vary header to all content API operations

* Make attribute sealed
2025-01-14 15:54:19 +01:00
Jacob OvergaardandGitHub b3c27415d1 build(deps): bump @umbraco-ui/uui from 1.11.0 to 1.12.2 (#17972) 2025-01-14 15:48:34 +01:00
Justin NevilleandNikolaj Geisle 9839b0ee66 Fixes issue with the IVirtualPageController not setting PublishedRequest content via FindContent (#15121)
* Fixes issue https://github.com/umbraco/Umbraco-CMS/issues/12834

* Re-worked based on feedback

* Use dependency injection

* Only call new constructor

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
(cherry picked from commit fd9c1a0e9c)
2025-01-14 13:57:00 +01:00
f3f57f9748 Improve YSOD rendering in the client (#17940)
* Conditionally render error details and make sure something is rendered

* V13 QA updated locator for failing E2E test (#17825)

* Added timeouts

* Nullcheck user in Content permission handlers (#17846)

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>

---------

Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-01-14 13:38:07 +01:00
Nikolaj GeisleandGitHub 85d16a4354 V13: Show validation error, when saving invalid media (#17961)
* Don't save invalid media

* Revert "Don't save invalid media"

This reverts commit c4b6acf542.

* Still allow save, but show validation error, not popup error

* Add clarifying comment
2025-01-14 11:18:36 +01:00
Kenn JacobsenandGitHub c0517c3562 Allow filtering for multiple content types (#17960) 2025-01-14 10:40:45 +01:00
92e535a1c9 V13 QA updated locator for failing E2E test (#17825)
* Added timeouts

* Nullcheck user in Content permission handlers (#17846)

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-01-14 09:12:41 +01:00
Kenn JacobsenandGitHub 7411c2552b Added integration test to verify the Delivery API contract (#17949) 2025-01-13 15:15:37 +01:00
Andy ButlandandGitHub f2410f376e Corrected property names and structure used in JSON schema generation for configuration of default data to install. (#17946) 2025-01-13 11:05:51 +01:00
Kenn JacobsenandGitHub a9313c1367 Make the Delivery API "ancestors" selector work with preview (#17938) 2025-01-13 07:47:14 +01:00
Nikolaj GeisleandGitHub 58d6404ec8 V14: Reintroduce BackOfficeUserManagerAuditer (#17349)
* Reintroduce BackOfficeUserManagerAuditer

* Cleanup legacy code

* Notify user logout on logout
2025-01-09 21:14:24 +01:00
Nikolaj GeisleandJacob Overgaard 53a5813189 V15: Dont create invalid media (#17534)
* Don't allow create when there is validation errors

* Fix tests

* Add tests

* Fix last test

* Fix more tests

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-01-09 12:21:54 +01:00
Nikolaj Geisleandkjac 5b3b9d770a V13: Add rcl files to static files tree (#17671)
* Refactor to use IWebhostEnvironment for wwwroot files.

* Obsolete ctor

* Add ActivatorUtiiliesConstructor

* Refactor logic to include folders

* Fix so we can see files in wwwroot/App_Plugins

* Cosmetic: Use invariant comparison for the "umbraco" folder".

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-01-09 10:02:34 +01:00
4a54215fa1 V13: Add rcl files to static files tree (#17671)
* Refactor to use IWebhostEnvironment for wwwroot files.

* Obsolete ctor

* Add ActivatorUtiiliesConstructor

* Refactor logic to include folders

* Fix so we can see files in wwwroot/App_Plugins

* Cosmetic: Use invariant comparison for the "umbraco" folder".

---------

Co-authored-by: kjac <kja@umbraco.dk>
2025-01-09 09:36:32 +01:00
Sven Geusensandnikolajlauridsen 52fbb34ddd Nullcheck user in Content permission handlers (#17846) 2025-01-07 15:07:42 +01:00
Sven GeusensandGitHub c96dc7eaa1 Nullcheck user in Content permission handlers (#17846) 2025-01-07 14:52:40 +01:00
Andy Butland 0166727eee Bumped version to 14.3.2. 2025-01-07 10:13:02 +01:00
Jacob Overgaard f19409ba5b Revert "bump version"
This reverts commit 679c42ef90.
2025-01-06 12:51:10 +01:00
Jacob Overgaard 679c42ef90 bump version 2025-01-06 12:46:03 +01:00
Nikolaj GeisleandGitHub 77b6e6e6d9 override PerformGetAll (#17822) 2024-12-16 13:35:02 +01:00
Elitsa MarinovskaandGitHub 32d0cb477e V14: Adding the ability to conditionally serialize version bound properties for the Delivery API (#16731)
* Property level versioning for the Delivery API using a custom System.Text.Json resolver

* Adding a converter base class that custom converters can implement

* Revert resolver

* Use IHttpContextAccessor for the API version

* Fix attribute and checks in ShouldIncludeProperty

* Fix enumeration

* Fix comment

* Unit tests

* Refactoring

* Remove Assert.Multiple where no needed
2024-12-16 11:34:55 +01:00
Nikolaj GeisleandElitsa d451390d78 V13: Clear username cache (#17815)
* Clear member username cache on delete

* Also refresh cache on update
2024-12-16 09:56:54 +02:00
Elitsa MarinovskaandGitHub 3304c6f472 Enable anonymous calls to HandleLogout action (#17807) 2024-12-16 07:26:12 +01:00
Nikolaj GeisleandGitHub 34f09fa260 V13: Clear username cache (#17815)
* Clear member username cache on delete

* Also refresh cache on update
2024-12-16 08:18:30 +02:00
Jacob Overgaard fd4efd38cd Merge branch 'v13/dev' into release/13.6 2024-12-13 10:07:46 +01:00
Jacob Overgaard e4e9bfc3e9 bump version to 13.6.0-rc2 2024-12-13 09:58:13 +01:00
Jacob Overgaard 3774dbe38c Merge remote-tracking branch 'origin/v13/contrib' into v13/dev 2024-12-13 09:56:46 +01:00
Dan ListerandJacob Overgaard 4ef50642ad Fixed an issue where bold markdown would not work inside a property description 2024-12-13 09:53:36 +01:00
Bjarke BergandGitHub cb88cbba43 Merge pull request #17761 from umbraco/v14/task/media-picker-min-max-validation
V14 min/max validator for mediapicker
2024-12-13 08:28:13 +01:00
Bjarke BergandGitHub f95fb78022 Merge pull request #17800 from umbraco/v13/bugfix/corrupt-examine-dashboard
Make sure Examine dashboard still functions when an index is corrupt
2024-12-12 12:07:06 +01:00
Sven Geusens 0f9a8bde61 Broadend the error catching when building the examine dashboard 2024-12-12 09:38:35 +01:00
Sven Geusens 129d369c1a Version bump to release 2024-12-11 13:46:38 +01:00
Sven Geusens dd2c591a5b Merge branch 'release/13.6' into v13/dev 2024-12-11 13:45:35 +01:00
Nhu DinhandGitHub e9758321ce V14 Added Content tests with Approved Color (#16725)
* Added Content tests with Approved Color

* Bumped version of test helper

* Make Content tests run in the pipeline

* Using custom datatype builder instead of changing the default approved color data type

* Updated variables

* Fixed comment

* Make all Content tests run in the pipeline

* Reverted
2024-12-10 14:52:46 +07:00
Nikolaj GeisleandGitHub 82e58eae3e V14: cherry pick #17656 (#17763)
* V15: Fix webhook RTE serialization (#17656)

* Make base type resolver class

* Add new webhook serializer

* fix comment

* Update src/Umbraco.Infrastructure/Serialization/ContentJsonTypeResolverBase.cs

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Update src/Umbraco.Core/Services/WebhookRequestService.cs

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
(cherry picked from commit 6f081785e6)

* Add back missing usings
2024-12-09 16:09:54 +01:00
Sven Geusens de78560343 Fix unit test mocks 2024-12-09 15:08:22 +01:00
Sven Geusens f569553d79 Added min/max validator for mediapicker3 2024-12-09 14:26:14 +01:00
Kenn JacobsenandNikolaj Geisle 16749a724d Add (un)publishing details to TreeChange notifications (#17757)
(cherry picked from commit 404a62aa0b)
2024-12-09 11:42:53 +01:00
Kenn JacobsenandNikolaj Geisle a627930b58 Warn about un-routable content at publish time (#17705)
(cherry picked from commit 2d9cfc880b)
2024-12-09 11:42:46 +01:00
Kenn JacobsenandGitHub 404a62aa0b Add (un)publishing details to TreeChange notifications (#17757) 2024-12-09 11:36:48 +01:00
Kenn JacobsenandGitHub 2d9cfc880b Warn about un-routable content at publish time (#17705) 2024-12-09 11:07:32 +01:00
Kenn JacobsenandGitHub ee8bdfc4ac Add "user info" endpoint for the Delivery API (#17719)
* Add "user info" endpoint for the Delivery API

* Add comment about public and unsealed class
2024-12-09 09:57:21 +01:00
f048cfe62d v14: DecimalConverter - add check for integer (#17679)
* Add check for integer

* Fix typo

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-12-04 15:18:12 +01:00
Nikolaj GeisleandElitsa 9cab0e8bb1 Add content to TreeAccessTemplate (#17694) 2024-12-04 11:08:57 +01:00
Bjarke BergandGitHub b55d484863 Updated NuGet Packages for v13 (#17704)
* Update nuget packages

* Cherry pick fixes from v15

* Fixed: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items

* rollback update in tool
2024-12-03 08:51:23 +01:00
Ronald BarendseandGitHub ed0058a503 Fix PanicException: failed to get child with id= after updating content types (#17702)
* Remove tree node from hierarchy after clearing branch

* Refactor ClearBranchLocked to split clearing child and siblings
2024-12-03 08:00:18 +01:00
21e3518a69 Fix copy document with descendants onto self (#17661)
* Filter self out of descedants for self onto self copy

* Optimized code

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-12-01 13:02:47 +01:00
Jacob OvergaardandGitHub b0aed393d6 fix: keep the lead char when editing an existing link (#17667) 2024-11-28 14:04:59 +00:00
Sven Geusens 28756d449b Rectify v13 in v14 merge 2024-11-27 14:35:22 +01:00
Sven Geusens 38a96db369 Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs
#	src/Umbraco.Core/Models/AuditItem.cs
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/AuditRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbtabbedcontent.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/rte-blockeditor-clipboard.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
#	src/Umbraco.Web.UI.Client/src/common/services/user.service.js
#	src/Umbraco.Web.UI.Client/src/less/components/umb-media-grid.less
#	src/Umbraco.Web.UI.Client/src/views/components/media/umbimagepreview/umb-image-preview.html
#	src/Umbraco.Web.UI.Client/src/views/components/media/umbimagepreview/umbimagepreview.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.component.js
#	src/Umbraco.Web.UI.Client/src/views/templates/edit.html
#	src/Umbraco.Web.UI.Client~HEAD
#	src/Umbraco.Web.UI.Login/package-lock.json
#	src/Umbraco.Web.UI.Login/package.json
#	src/Umbraco.Web.UI.Login/src/auth.element.ts
#	src/Umbraco.Web.UI.Login/src/components/pages/login.page.element.ts
#	src/Umbraco.Web.UI.Login/src/index.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs
2024-11-27 14:04:41 +01:00
Sven Geusens a1ea203281 Merge branch 'v10/dev' into v13/dev
# Conflicts:
#	src/Directory.Packages.props
#	src/Umbraco.Infrastructure/Manifest/ManifestParser.cs
2024-11-26 21:08:22 +01:00
Kenn JacobsenandGitHub 4590739fa5 Add ASCII file name conversion (#17580) 2024-11-26 11:26:44 +01:00
7c617f2976 Revert #14234 add update error message for DB connection failures (#17612)
* Revert #14234

* Make the boot failure message more descriptive when unable to connect to DB

* Update src/Umbraco.Infrastructure/Runtime/RuntimeState.cs

Co-authored-by: Ronald Barendse <ronald@barend.se>

* Revert changes

* Obsolete InstallMissingDatabase from V16

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-11-26 11:06:40 +01:00
Lee KelleherandGitHub 9141f61708 V13: Dropzone, upload complete callback with processed file array (#17631)
* Dropzone, upload complete callback with processed file array

* Media card: cosmetic fix for image border-radius

The image's square corners were poking out.
2024-11-25 15:51:16 +01:00
ba4120050f Add cache key to GetByUserName (#17350)
* Add cache key to GetByUserName

* Remove constants

* create new cache policy for member repository

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-11-25 15:27:22 +01:00
Nikolaj Geisle 772c523a23 Validate email for member models (#17532)
* Validate email for member models

* Add null check or more test cases

* return invalid when not a valid email

* Cleanup

* remove private method in favor of extension

* Remove non used, using statement

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
(cherry picked from commit 6b0f8e7b7c)
2024-11-25 13:56:45 +01:00
Kenn JacobsenandGitHub cbd4dc6e0d Handle "all slashes" routes (#17596) 2024-11-22 09:06:10 +01:00
c7014e159b Sort manifest file paths alphabetically (#14466)
* Sort manifest file paths alphabetically

* Update src/Umbraco.Infrastructure/Manifest/ManifestParser.cs

Co-authored-by: Ronald Barendse <ronald@barend.se>

---------

Co-authored-by: Ronald Barendse <ronald@barend.se>
2024-11-21 16:19:48 +01:00
Sven Geusensandnikolajlauridsen 9febbc7db1 Distinguish between default zero and intentional zero sort order for new documents (#17517)
* Distinguish between default value and initial zero

* Update special value comment documentation

* Redid solution with dirty/new entity tracking

* rework copy branch sortorder fix

* Change == false to is false

---------

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2024-11-21 09:09:25 +01:00
Kenn JacobsenandGitHub ec8e10f406 Fix RTE console error when blocks are not available (#17582) 2024-11-21 08:53:59 +01:00
EalseandJacob Overgaard 3233b24a4e fix: infinite editor stuck in create action (#15945) 2024-11-20 10:00:50 +01:00
Anders BjernerandJacob Overgaard 5775e9cb18 Added fix for <umb-button-group /> label issues 2024-11-20 09:59:27 +01:00
MoleandGitHub 570005f5e1 Run both cms and package migrations in upgrader (#17575)
* Run both cms and package migrations in upgrader

* Use correct setting
2024-11-20 08:38:33 +01:00
1e9182cfa4 V14: Use decimal in slider property editor (#17568)
* Allow SliderPropertyEditor to use decimals

* Add tests

* Boyscout unittest update

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-11-19 11:14:53 +01:00
Bjarne FyrstenborgandLaura Neto fbaa3440f2 Don't shrink crops container on right side 2024-11-18 20:11:48 +01:00
Bjarne FyrstenborgandJacob Overgaard e662468ecc Set TinyMCE to readonly 2024-11-18 08:51:04 +01:00
Andreas ZerbstandGitHub 33eb4dd5a4 V14 QA updated playwright config (#17544)
* Only run windows SQL Server

* Updated timeout and retry count

* Updated condition

* Fixed indentation

* Skipped
2024-11-18 08:30:50 +01:00
Bjarne FyrstenborgandMatthew-Wise c8efc30654 Fallback value when setttings element type doesn't exists as it can have reference, but no available element type 2024-11-17 17:05:28 +00:00
Bjarke Berg d7b98a2f00 Use catch all for urls what ends with a path (#17468)
(cherry picked from commit 3c0f7a03ba)
2024-11-14 12:29:40 +01:00
Sven Geusensandnikolajlauridsen 9edd21a3b0 Made some membertype endpoints available for member related actions (#17440)
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2024-11-13 13:47:37 +01:00
Andreas ZerbstandGitHub 7010ff1d26 V14 QA added rich text editor with stylesheet test (#17449)
* Rte tests

* Cleaned up

* Bumped version

* Added ensure not exists
2024-11-11 10:47:41 +01:00
Andreas ZerbstandGitHub 6acdf21eab V14 QA user groups permissions tests (#17429)
* Added tests for userGroup

* Clean up

* Updated userGroup tests

* Updated tests

* Updated tests

* Cleane up

* Cleaned up

* Bumped versions

* Run user tests

* Cleaned up

* Added permission tests

* Added tests, not done

* Updated tests

* Fixed tests

* Cleaned up

* Bumped version

* More cleanup

* Run user tests

* Added wait

* Added tests and cleaned up naming

* Bumped versions

* Reverted smokeTest command
2024-11-11 09:45:22 +01:00
Andreas ZerbstandGitHub a5479bc96e V14 QA members section user tests (#17448)
* Added tests for the members

* Cleaned up tests

* Bumped version

* Removed skip
2024-11-11 09:43:57 +01:00
marwaldvandJacob Overgaard 79d117026f Add swiss languages as backoffice languages
Add missing backoffice languages as properties etc. are translated via translation section (e.g. with "#Backoffice Settings"). At the moment the swiss languages always need to be added via the umbraco/Config folder.
2024-11-09 12:29:44 +01:00
Casper LundgreenandGitHub 2709054bdb Fix NameIdentifier is not an integer. (TryParse implemented) (#17414)
Issue: 17383
2024-11-08 13:27:53 +01:00
Sven Geusensandnikolajlauridsen 0acdd26850 Made some stylesheet endpoints available for document/media/member related actions (#17442) 2024-11-08 12:19:10 +01:00
MoleandGitHub 2d4230c001 Include create date in audit item (#17447) 2024-11-08 08:58:38 +01:00
Nhu DinhandGitHub 2d027ce9a1 V14 QA Added acceptance tests for rendering content with content picker (#17378)
* Added tests for rendering content with content picker

* Bumped version

* Make all the tests for rendering content run in the pipeline

* Reverted
2024-11-06 16:09:37 +07:00
Andreas ZerbstandGitHub b1d9085c83 V14 QA Added user groups acceptance tests (#17344)
* Added tests for userGroup

* Clean up

* Updated userGroup tests

* Updated tests

* Updated tests

* Cleane up

* Cleaned up

* Bumped versions

* Run user tests

* Cleaned up

* Added method for checking if the document tree is empty

* Bumped version

* Reverted
2024-10-28 11:11:28 +01:00
Nhu DinhandGitHub 41da2e2cf3 V14 Added acceptance tests for the List View Media and custom data type in Content section (#17025)
* Added Content tests with custom data type

* Added tests for List View Media data type in Media section

* Updated method name due to api helper changes

* Updated the assertion of Content tests with custom data type

* Bumped version of test helper

* Make all Content tests run in the pipeline

* Skipped test for code editor as it is removed

* Fixed comment

* Make Media tests running in the pipeline

* Bumped version

* Updated code due to ui helper changes

* Bumped version of test helper

* Updated tests for bulk trash in the media section

* Fixed notification message

* Make Content tests and Media tests run in the pipeline

* Added more waits

* Reverted
2024-10-28 10:53:33 +07:00
Nhu DinhandGitHub 76fcf19b15 V14 QA Added acceptance tests for rendering content with Dropdown, Radiobutton and ImageCropper (#17357)
* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Added tests for rendering content with approved color

* Added tests for rendering content with numeric

* Added tests for rendering content with tags

* Added tests for rendering content with textarea

* Updated tests for rendering content with textstring due to test helper changes

* Added tests for rendering content with truefalse

* Bumped version of test helper

* Make all tests for rendering content run in the pipeline

* Fixed comments

* Removed blank lines

* Fixed name

* Make all smoke tests run in the pipeline

* Added tests for rendering content with dropdown

* Added tests for rendering content with Image Cropper - not done

* Updated tests for rendering content due to ui helper changes

* Updated tests for rendering content with image cropper

* Updated tests due to the api helper changes

* Bumped version of test helper

* Make all the tests for rendering content run in the pipeline

* Removed blank lines

* Format code

* Fixed test name

* Reverted
2024-10-25 18:19:53 +07:00
Nhu DinhandGitHub 11ccafeb97 V14 QA Added tests for rendering content with checkboxlist and date picker (#17332)
* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Added tests for rendering content with approved color

* Added tests for rendering content with numeric

* Added tests for rendering content with tags

* Added tests for rendering content with textarea

* Updated tests for rendering content with textstring due to test helper changes

* Added tests for rendering content with truefalse

* Added tests for rendering content with checkbox list

* Added tests for rendering content with date picker - not done

* Updated tests for rendering content with date picker

* Updated tests for rendering content due to ui helper changes

* Bumped version

* Removed blank lines

* Make Rendering Content tests run in the pipeline

* Changed method name due to test helper changes

* Reverted
2024-10-25 15:16:28 +07:00
Nikolaj GeisleandGitHub aa9f194d76 Format sql statement (#17354) 2024-10-24 14:45:23 +02:00
Nikolaj GeisleandZeegaan 73d70ba9fc Swap to windows vm for build (#17348)
(cherry picked from commit 199a2f4619)
2024-10-24 09:47:59 +02:00
Zeegaan 6435ff0bb3 Merge remote-tracking branch 'origin/release/14.3' into v14/dev
# Conflicts:
#	version.json
2024-10-23 09:03:05 +02:00
Zeegaan f7729508cf Merge branch 'release/13.5' into v13/dev
# Conflicts:
#	version.json
2024-10-23 08:57:30 +02:00
Zeegaan 31e1acce67 Merge remote-tracking branch 'origin/release/10.8.7' into v10/dev
# Conflicts:
#	version.json
2024-10-23 08:48:08 +02:00
Andreas ZerbstandGitHub aa1f3df76b Updated to match locator (#17334) 2024-10-23 08:37:24 +02:00
Andreas ZerbstandGitHub 728dc89909 V14 QA Skip Users tests on Sqlite (#17330)
* Split sqlite test because we run into db locks

* Uses the new command
2024-10-22 13:12:42 +02:00
Nhu DinhandGitHub e36dc1f554 V14 QA Added the acceptance tests for rendering content with different value (#17293)
* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Added tests for rendering content with approved color

* Added tests for rendering content with numeric

* Added tests for rendering content with tags

* Added tests for rendering content with textarea

* Updated tests for rendering content with textstring due to test helper changes

* Added tests for rendering content with truefalse

* Bumped version of test helper

* Make all tests for rendering content run in the pipeline

* Fixed comments

* Removed blank lines

* Fixed name

* Make all smoke tests run in the pipeline
2024-10-22 10:26:59 +07:00
Sven GeusensandNikolaj Geisle 3431f76320 Prevents XSS when viewing an uploaded SVG
from the media-info and image-preview components.
2024-10-21 12:50:12 +02:00
ElitsaandNikolaj Geisle 1bc5466a8d Update the HttpContext's user with the authenticated user's principal 2024-10-21 12:45:38 +02:00
ElitsaandNikolaj Geisle d83daf44d3 Reduce the time when getRemainingTimeoutSeconds request is made from 30s to 20s, so fewer calls are made 2024-10-21 12:44:40 +02:00
ElitsaandNikolaj Geisle 2ad5ecd5d5 Make sure that the client shows the login screen as close to the server's timout time as possible 2024-10-21 12:44:39 +02:00
Sven GeusensandNikolaj Geisle 35c51a029a Prevents XSS when viewing an uploaded SVG
from the media-info and image-preview components.
2024-10-21 12:42:06 +02:00
ElitsaandNikolaj Geisle 8c1128c85b Update the HttpContext's user with the authenticated user's principal 2024-10-21 12:41:42 +02:00
ElitsaandNikolaj Geisle c9021ab2d2 Reduce the time when getRemainingTimeoutSeconds request is made from 30s to 20s, so fewer calls are made 2024-10-21 12:41:18 +02:00
ElitsaandNikolaj Geisle 67a71f8f82 Make sure that the client shows the login screen as close to the server's timout time as possible 2024-10-21 12:41:17 +02:00
Andreas ZerbstandAndreas Zerbst 6caf53ed2e Updated version of messagepack (#17321)
(cherry picked from commit 8a22672c7f)
(cherry picked from commit 6399f235f2)
2024-10-21 11:54:26 +02:00
Andreas ZerbstandAndreas Zerbst 97d74f39e7 Updated version of messagepack (#17321)
(cherry picked from commit 8a22672c7f)
2024-10-21 11:49:13 +02:00
Andreas ZerbstandAndreas Zerbst edd0a4a4a9 Updated message pack (#17320)
(cherry picked from commit 11270eaaf5)
2024-10-21 11:46:43 +02:00
Andreas ZerbstandAndreas Zerbst 6399f235f2 Updated version of messagepack (#17321)
(cherry picked from commit 8a22672c7f)
2024-10-21 11:17:50 +02:00
Andreas ZerbstandGitHub 8a22672c7f Updated version of messagepack (#17321) 2024-10-21 11:15:59 +02:00
Andreas ZerbstandGitHub 11270eaaf5 Updated message pack (#17320) 2024-10-21 11:00:47 +02:00
Justin NevilleandGitHub 1e32d59ecb Query for media using the full file path as well as the original file path for files that contain the sizes in the file name (i.e. image_200x200.jpg) (#17314) 2024-10-21 09:53:17 +02:00
Bjarke BergandGitHub 4be183a20d Do not rely on NuCache to do key/id lookups (#17291)
* Fixes #17182

* Ensure wait-on is installed
2024-10-21 09:49:34 +02:00
Kenn JacobsenandGitHub eab27123dd MNTP: Re-initialize contextual dialog options upon content creation (#17301) 2024-10-18 09:39:29 +02:00
Kenn JacobsenandGitHub a6253957c8 MNTP: Improve site and root context for dynamic root (#17303) 2024-10-18 09:17:17 +02:00
Jacob OvergaardandGitHub a8f5631144 V13: Update @umbraco-ui/uui to 1.11.0 (#17281)
* build(deps): update @umbraco-ui/uui from 1.7.1 to 1.11.0

* fix: umb-login-element no attributes

Cherry-picked a fix from V14 where the custom login input component was no longer needed, which was fixed because it errors out. This simplifies the login form.

* cherry-pick code to handle 'enter' click from v14
2024-10-17 10:25:02 +01:00
Andreas ZerbstandGitHub ba1080541b Updated to string.empty (#17294) 2024-10-17 09:59:41 +02:00
Jacob Overgaard 1581eb61d3 V15: Rich Text Editor links do not work with query strings and anchors (#17288)
* fix: anchors and query strings do not work

Since the change from UDIs to localLinks in href, the pattern matched a little too much in the href section completely ignoring any "extras" such as querystrings and anchors after the locallink, which meant that the locallink did not get replaced at all if they were present. This is fixed by limiting the regexp a bit.

* fix: legacy links do not follow the same regexp as new links

Because we are no longer matching the whole `href` attribute but only some of its contents, we need to fix up the old pattern. It has been extended with matching groups that follow the same pattern as the new links.

* feat: allow a-tags to be multiline

example:

```html
<a
  type="document"
  href="/{localLink:<GUID>}">
Test
</a>
```

* fix: split regex into two parts: first a tokenizer for a-tags and then a type-finder

* fix: ensure only "document" and "media" are matching to speed up the pattern

* feat: allow a-tags to be multiline

(cherry picked from commit 35e8f2e460)
2024-10-17 09:06:48 +02:00
Jason ElkinandNikolaj Geisle 6d98162e19 Unlock form after unsuccessful save and publish. (#17285)
(cherry picked from commit ee37ad0f4b)
2024-10-16 15:09:31 +02:00
Jason ElkinandGitHub ee37ad0f4b Unlock form after unsuccessful save and publish. (#17285) 2024-10-16 15:08:37 +02:00
Andreas ZerbstandGitHub 2b3a91757d V14 QA added user permission tests (#17226)
* Added test

* Small changes

* Added content start node tests

* Added media start node tests

* Cleaned up

* More updates

* Cleaned up

* Added wait

* Cleaned up

* Bumped helpers

* Updated to run user tests

* Fixed user tests

* Bumped helpers

* Added missing semicolon

* Fixes based on comments

* Run smoke tests
2024-10-16 13:26:36 +02:00
Andreas ZerbstandGitHub 00563013b6 V14 QA Updated package E2E tests (#17236)
* Updated tests

* Cleaned package tests

* Updated package test file

* Bumped version

* Added missing semicolons

* Run all smoke tests

* Run smoke tests
2024-10-16 12:46:24 +02:00
Ronald BarendseandBjarke Berg 378d4ecfef Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock

(cherry picked from commit c3db3457e7)
2024-10-16 12:34:44 +02:00
Andreas ZerbstandBjarke Berg a497f3f4dd Updated nuget package (#17286)
(cherry picked from commit 5183391a86)
2024-10-16 12:24:31 +02:00
Bjarke BergandGitHub 2d71b5a63b Updated image sharp to a non vulnerable version (#17290) 2024-10-16 12:16:38 +02:00
Bjarke BergandGitHub f4f83bccbe Added an explicit dependency to Microsoft.Extensions.Caching.Memory to force it to use a non-vulnerable version (#17287) 2024-10-16 10:25:17 +02:00
Andreas ZerbstandGitHub 5183391a86 Updated nuget package (#17286) 2024-10-16 10:07:25 +02:00
Nhu DinhandGitHub 0551976126 V14 QA Added acceptance tests for notification message (#17195)
* Updated step to verify the notification message

* Added tests for notification message

* Bumped version

* Updated expected notification message

* Bumped version
2024-10-14 13:26:55 +07:00
Nhu DinhandGitHub da2a4d1713 V14 QA Added the acceptance tests for rendering content with textstring (#17247)
* Added tests for textstring in the rendered content

* Updated tests for rendering content with textstring

* Added tests for rendering content with numeric

* Added tests for rendering content with textarea

* Removed tests

* Bumped version

* Make all tests for rendering content run in the pipeline

* Make all smoke tests run in the pipeline
2024-10-14 11:57:52 +07:00
Nhu DinhandGitHub 9f5867bdf8 V14 QA Fixing the failing acceptance tests in the pipeline v14 (#17214)
* Added more waits

* Updated assert steps

* Fixed api method name

* Added more waits to avoid the failing test in window

* Updated tests due to business changes

* Added more waits to avoid the failing tests in window

* Updated test due to Ui changes

* Bumped version

* Bumped version of test helper

* Bumped version
2024-10-11 12:15:49 +02:00
Ronald BarendseandBjarke Berg 30b114d538 Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock

(cherry picked from commit c3db3457e7)
2024-10-11 09:47:31 +02:00
Ronald BarendseandGitHub c3db3457e7 Fix ContentStore locking exceptions in async code (#17246)
* Add ContentCache test

* Use SemaphoreSlim as write lock

* Apply lock imrpovements to SnapDictionary

* Obsolete unused MonitorLock
2024-10-11 09:45:01 +02:00
Sven GeusensandGitHub 7787af2df1 Fix install url detection (#17241) 2024-10-10 18:09:11 +02:00
Wojciech WróbelandJacob Overgaard 3730109cce Fixed issue #17225. The 'code' html element added as valid to RTE configuration 2024-10-09 14:19:38 +02:00
Nikolaj Geisle b814608c06 Bump version 2024-10-08 12:34:23 +02:00
Jacob Overgaard ed63b51e46 update backoffice submodule 2024-10-07 15:46:21 +02:00
Jacob Overgaard ea608cc630 update backoffice submodule 2024-10-07 15:46:06 +02:00
Jacob Overgaard 4cfe498628 update backoffice submodule 2024-10-07 13:45:04 +02:00
Jacob Overgaard 42912dd5c9 update backoffice submodule 2024-10-07 13:44:18 +02:00
Nikolaj Geisle 9bab74d30e Bump version.json 2024-10-07 11:55:34 +02:00
Nikolaj Geisle 865787db1d Bump version.json 2024-10-07 11:48:41 +02:00
Bjarke Berg c58a7b7b23 Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-10-03 07:50:18 +02:00
Bjarke Berg 32c00f9a09 Merge remote-tracking branch 'origin/release/14.3' into release/14.3 2024-10-01 17:40:35 +02:00
Bjarke Berg 348f1f2bae Change webhook permissions to require webhook tree access for all endpoints 2024-10-01 07:58:41 +02:00
Jacob Overgaard 73c8d8e0f9 Merge remote-tracking branch 'origin/release/14.3' into release/14.3 2024-09-30 10:24:17 +02:00
Jacob Overgaard 2d7c00f27f update backoffice submodule 2024-09-30 10:24:03 +02:00
Andreas ZerbstandGitHub 4fae91d55c V14 QA added content tests with list view content (#17115)
* Added tests for List view

* More tests

* Added rest of test

* Bumped version

* Fixed failing tests

* Added tests and fixed comments

* Cleaned up tests

* Bumped testhelpers

* Bumped again

* Set condition to only run sql server when enabled

* Run all content test

* Reverted changes
2024-09-27 17:32:44 +02:00
Sebastiaan Janssen 6c08f69801 Merge branch 'contrib' into v14/dev 2024-09-27 09:04:32 +02:00
Sebastiaan Janssen 910fb4062b Merge branch 'v14/dev' into contrib 2024-09-27 08:54:49 +02:00
Bjarke Berg f2e4e44db1 Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-09-27 07:47:59 +02:00
Bjarke Berg d57d12d54d Fixed imagesharp 2 also 2024-09-27 07:43:12 +02:00
NguyenThuyLanandBjarke Berg 46604909be Fix error format code (#17146)
* update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>

* Fix issue format parameters

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>

(cherry picked from commit 9a12eea495)
2024-09-27 07:42:30 +02:00
9a12eea495 Fix error format code (#17146)
* update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>

* Fix issue format parameters

---------

Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
2024-09-27 07:41:55 +02:00
NguyenThuyLanandBjarke Berg 762d72b018 update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)
Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
(cherry picked from commit 9b19d63a6a)
2024-09-27 07:40:42 +02:00
Nhu DinhandGitHub 45f43a6b7a V14 Added Content tests with different document types properties (#17131)
* Added tests for Allow At Root property

* Added Content tests for Allowed Child Nodes property

* Added Content tests for the Allow at root property

* Added Content tests for the Allowed child node property

* Added Content tests for the Collection property

* Added Content tests with allow vary by culture

* Added more waits

* Updated tests due to api helper changes

* Added Content tests with allowed templates

* Bumped version of test helper

* Updated code due to api helper changes

* Fixed naming
2024-09-27 10:36:15 +07:00
Jacob Overgaard c9c9374de1 update backoffice submodule 2024-09-26 14:39:12 +02:00
Jacob Overgaard 6bd558c016 update backoffice submodule 2024-09-26 14:38:27 +02:00
Bjarke Berg f1cddd91c6 Missing context complete
(cherry picked from commit fdb9cfa3e7)
2024-09-26 09:55:19 +02:00
Bjarke Berg fdb9cfa3e7 Missing context complete 2024-09-26 09:54:43 +02:00
Bjarke Berg 009394982c Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-09-26 08:54:19 +02:00
Jacob Overgaard a43db4ff05 update backoffice submodule 2024-09-26 08:52:40 +02:00
Jacob Overgaard 8c4780380d update backoffice submodule 2024-09-26 08:51:36 +02:00
Kenn JacobsenandBjarke Berg d3a67fe4e0 Move all V14 User and User Group migration to pre-migrations (#17130)
(cherry picked from commit 910d70302e)
2024-09-26 08:45:37 +02:00
Kenn JacobsenandGitHub 910d70302e Move all V14 User and User Group migration to pre-migrations (#17130) 2024-09-26 08:45:08 +02:00
Bjarke Berg 63a487bc0b Merge remote-tracking branch 'origin/v13/dev' into v13/dev 2024-09-26 07:54:43 +02:00
Ronald BarendseandBjarke Berg a40eadcfce Add RemoveDefault() extension method to fluent API for CMS webhook events (#15424)
* Add RemoveDefault extension method

* Move default webhook event types to single list

(cherry picked from commit 8f26263178)
2024-09-26 07:54:26 +02:00
Ronald BarendseandBjarke Berg 0c1daa290b Add RemoveDefault() extension method to fluent API for CMS webhook events (#15424)
* Add RemoveDefault extension method

* Move default webhook event types to single list

(cherry picked from commit 8f26263178)
2024-09-26 07:53:54 +02:00
Ronald BarendseandGitHub 8f26263178 Add RemoveDefault() extension method to fluent API for CMS webhook events (#15424)
* Add RemoveDefault extension method

* Move default webhook event types to single list
2024-09-26 07:52:39 +02:00
Ronald BarendseandBjarke Berg 635d9b83f9 Use version of the assembly with the same name as the package ID (#16544)
(cherry picked from commit 14a0e62278)
2024-09-26 07:51:35 +02:00
Ronald BarendseandGitHub 14a0e62278 Use version of the assembly with the same name as the package ID (#16544) 2024-09-26 07:51:16 +02:00
Ronald BarendseandBjarke Berg a76af1de9d Fix IContentBase.GetUdi() extension method to support document-blueprint entity type (#16939)
* Add tests for all UDI entity types

* Fix IContentBase UDI entity type for blueprints

* Remove redundant switch statements and reorder methods

(cherry picked from commit 609b5f76d4)
2024-09-26 07:48:10 +02:00
Ronald BarendseandGitHub 609b5f76d4 Fix IContentBase.GetUdi() extension method to support document-blueprint entity type (#16939)
* Add tests for all UDI entity types

* Fix IContentBase UDI entity type for blueprints

* Remove redundant switch statements and reorder methods
2024-09-26 07:47:33 +02:00
9b19d63a6a update ImageSharpMiddlewareOption for fixing invalid width and height (#17126)
Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
2024-09-25 13:19:09 +02:00
Andreas ZerbstandGitHub e4dacf5c8c V14 QA fixed E2E tests for SQL server (#17122)
* Updated version of test helpers

* Added option to run smoke tests

* Found the issue

* Fixed pipeline

* Removed duplicate file creation

* Removed

* Always run sql server tests

* Removed unused parameter

* Enables sqlServer E2E to run on pipeline

* Removed comment
2024-09-25 07:04:12 +02:00
dependabot[bot]andJacob Overgaard 99125ef5cc Bump rollup from 4.21.3 to 4.22.4 in /src/Umbraco.Web.UI.Login
Bumps [rollup](https://github.com/rollup/rollup) from 4.21.3 to 4.22.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.21.3...v4.22.4)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 14:43:07 +02:00
Jacob Overgaard 264fbb6987 update backoffice submodule 2024-09-24 14:34:00 +02:00
Emma L GarlandandGitHub ac575662ac Resolved more warnings, and marked more warning types as errors (#16991)
* Fix warnings SA1111, SA1028, SA1500, IDE1270  in Umbraco.Web.Website, and updated rules.

* Remove warnings: IDE0270: Null check can be simplified

* More SqlServer project warnings resolved

* CS0105 namespace appeared already

* Suppress warning until implementation:

#pragma warning disable CS0162 // Unreachable code detected
#pragma warning disable CS0618 // Type or member is obsolete

CS0162 remove unreachable code
SA1028 remove trailing whitespace
SA1106 no empty statements
CS1570 malformed XML
CS1572 corrected xml parameter
CS1573 param tag added
IDE0007 var not explicit
IDE0008 explicit not var
IDE0057 simplify substring
IDE0074 compound assignment
CA1825 array.empty

Down to 3479 warnings

* - SA1116, SA117 params on same line
- IDE0057 substring simplified

Specific warnings for Umbraco.Tests.Benchmarks

* Fixed IDE0074 compound assignment and added specific warnings for Umbraco.Tests.Common

* Specific warnings for Umbraco.Tests.Integration and Umbraco.Tests.Common

Fixed:

- SA1111, SA1116, SA117 params and line formatting (not all as there are many)
- SA1122 string.Empty
- IDE0057 simplify substring
- IDE0044,IDE0044 make field readonly
- IDE1006 naming rule violation (add _)
- SA1111 closing parenthesis on line of last parameter
- SA1649 filename match type name
- SA1312,SA1306 lowercase variable and field names

* Fixed various warnings where they are more straight-forward, including:

- SA1649 file name match type name
- SA111 parenthesis on line of last parameter
- IDE0028 simplify collection initializer
- SA1306 lower-case letter field
- IDE044 readonly field
- SA1122 string.Empty
- SA1116 params same line
- IDE1006 upper casing
- IDE0041 simplify null check

Updated the following projects to only list their remaining specific warning codes:

- Umbraco.Tests.UnitTests

Typo in `Umbraco.Web.Website` project

* Reverted test change

* Now 1556 warnings.

Fixed various warnings where they are more straight-forward, including:

- SA1111/SA1116/SA1119 parenthesis
- SA1117 params
- SA1312 lowercase variable
- SA1121 built-in type
- SA1500/SA1513/SA1503 formatting braces
- SA1400 declare access modifier
- SA1122 string.Empty
- SA1310 no underscore
- IDE0049 name simplified
- IDE0057 simplify substring
- IDE0074 compound assignment
- IDE0032 use auto-property
- IDE0037 simplify member name
- IDE0008 explicit type not var
- IDE0016/IDE0270/IDE0041 simplify null checks
- IDE0048/SA1407 clarity in arithmetic
- IDE1006 correct param names
- IDE0042 deconstruct variable
- IDE0044 readonly
- IDE0018 inline variable declarations
- IDE0074/IDE0054 compound assignment
- IDE1006 naming
- CS1573 param XML
- CS0168 unused variable

Comment formatting in project files for consistency.

Updated all projects to only list remaining specific warning codes as warnings instead of errors (errors is now default).

* Type not var, and more warning exceptions

* Tweaked merge issue, readded comment about rollback

* Readded comment re rollback.

* Readded comments

* Comment tweak

* Comment tweak
2024-09-24 12:56:28 +01:00
Terence BurridgeandSebastiaan Janssen 6939472f37 Update valid reasons not to have a template on a content node to include having a redirect field
Cherry-picked from: 385a5345b1
2024-09-23 14:30:13 +02:00
Sebastiaan Janssen 0387307301 Merge branch 'v13/dev' into v13/contrib 2024-09-23 14:27:48 +02:00
Andreas ZerbstandAndreas Zerbst e92b4f3172 V15 QA Enabled Nightly E2E Pipeline to run on V15 (#17103)
* Uncommented

* Added timeout

(cherry picked from commit 142db8c0fb)
2024-09-23 14:00:32 +02:00
Jacob Overgaard c70c8d86f9 update backoffice submodule 2024-09-23 09:58:52 +02:00
Bjarke Berg e733ec1717 Merge remote-tracking branch 'origin/release/14.3' into v14/dev 2024-09-18 13:48:55 +02:00
Bjarke Berg fa7b81474c Bump version to 14.3.0 2024-09-18 13:48:23 +02:00
Bjarke Berg 753aa6f9db Fixed version 2024-09-18 13:46:05 +02:00
Bjarke Berg 59aac9053f Bump version 2024-09-18 13:17:16 +02:00
Bjarke Berg 234c2673f6 Allow the client to send all content, with all languages, even when the user do not have permissions to save a specific language. (#17052)
(cherry picked from commit c5243e562e)
2024-09-18 13:16:25 +02:00
Bjarke Berg d2d6d3493f Revert "Bump version"
This reverts commit f8e26f5ba1.
2024-09-18 13:15:59 +02:00
Bjarke BergandGitHub c5243e562e Allow the client to send all content, with all languages, even when the user do not have permissions to save a specific language. (#17052) 2024-09-18 13:10:15 +02:00
Bjarke Berg 5c857aa97d Bump version 2024-09-18 12:57:05 +02:00
Bjarke Berg f8e26f5ba1 Bump version 2024-09-18 12:56:19 +02:00
Bjarke Berg 25a5dde8e9 Merge remote-tracking branch 'origin/release/13.5' into v13/dev
# Conflicts:
#	version.json
2024-09-18 12:55:35 +02:00
Bjarke Berg 47d843f424 Merge remote-tracking branch 'refs/remotes/origin/contrib' into v14/dev
# Conflicts:
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
2024-09-18 11:05:15 +02:00
dependabot[bot]andJacob Overgaard c8899afed6 Bump vite from 5.3.1 to 5.4.6 in /src/Umbraco.Web.UI.Login
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.3.1 to 5.4.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-18 10:31:40 +02:00
Jacob Overgaard 939b2aaa3d update backoffice submodule to 14.3 release branch 2024-09-18 09:45:21 +02:00
Bjarke Berg 2e068bb73e Merge remote-tracking branch 'origin/release/13.5' into release/13.5 2024-09-17 14:51:05 +02:00
Bjarke Berg 842cacde19 Bump version 2024-09-17 14:50:57 +02:00
f72c39ef59 V14: Fix templates not having set master template on package install (#16978)
* Reorder templates to save master templates first, and use new ITemplateService

* Add obsoletion

* Fix if statement

* Refactor async calls into async method to avoid multiple get awaiters

* Update interface

* Avoid breaking changes

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-09-17 14:43:05 +02:00
MoleandGitHub 991b9a791e Updaet template to reference 13.5 (#17063) 2024-09-17 14:42:25 +02:00
Bjarke BergandGitHub 920591bcd1 Updated the assembly names to avoid a debug-warning in the log (#16997) 2024-09-17 14:41:29 +02:00
Dennis ÖhmanandSebastiaan Janssen 6a453a0910 v13.5 - New Swedish translation crashes Umbraco, removed duplicate areas. (#17059)
Cherry-picked from d64bf5de22
2024-09-17 14:04:22 +02:00
Sebastiaan Janssen ff9903b14d Merge branch 'v13/contrib' of https://github.com/umbraco/Umbraco-CMS into v13/contrib 2024-09-17 13:58:37 +02:00
Dennis ÖhmanandGitHub d64bf5de22 v13.5 - New Swedish translation crashes Umbraco, removed duplicate areas. (#17059) 2024-09-17 13:56:58 +02:00
Sebastiaan Janssen 9300d867fb Merge branch 'v13/dev' into v13/contrib 2024-09-17 13:12:04 +02:00
Andreas ZerbstandGitHub 66aeafe797 V14 QA Content with upload video (#17066)
* Added tests for upload video in content

* Added ogv file

* Added ogv to test

* Reverted smokeTest command
2024-09-17 12:13:35 +02:00
Andreas ZerbstandGitHub f32d40a35e V14 QA Content with vector graphics (#17065)
* Added tests for Upload vector graphics

* Run all content tests

* Fixed indentation

* Reverted smokeTest string
2024-09-17 12:13:10 +02:00
Jacob Overgaard 625366f82b update backoffice submodule 2024-09-17 11:46:51 +02:00
Jacob Overgaard 8ebc44f959 update OpenApi.json 2024-09-17 11:01:30 +02:00
Kenn JacobsenandJacob Overgaard e6f379034f Add notification alias to document notifications endpoint output (#17028) 2024-09-17 10:59:33 +02:00
Niels LyngsøandGitHub eb0f8b5c24 fire change event (#17078) 2024-09-17 10:06:16 +02:00
Niels LyngsøandGitHub d58768f26d utilize lock unlock events for readonly mode while saving (#17077) 2024-09-17 09:52:00 +02:00
Niels LyngsøandGitHub 3667217053 only resolve if value is present (#17070) 2024-09-17 09:51:47 +02:00
Andreas ZerbstandGitHub d12dedb526 V14 QA update fetch depth (#17068)
* Removed fetch depth

* Added fetch depth 0
2024-09-17 10:16:29 +07:00
Bjarke BergandGitHub 017209c5ba Updated nuget packages (#17062) 2024-09-16 12:15:36 +02:00
Andreas ZerbstandGitHub 48e4cdaa88 V14 QA new E2E test pipeline (#17064)
* Added E2E pipeline

* Set up CI with Azure Pipelines

[skip ci]

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Updated solution file

* Added fetch depth

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Added a step for installing wait-on

* Added runSqlServerE2ETests

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Updated pipeline so we only run smoke

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Update nightly-E2E-test-pipelines.yml for Azure Pipelines

* Removed pipeline
2024-09-16 10:13:26 +02:00
Jacob Overgaard ce379bc153 update backoffice submodule 2024-09-13 13:54:43 +02:00
Bjarke Berg 26bf04c085 Merge remote-tracking branch 'origin/v13/dev' into v14/dev 2024-09-13 08:12:23 +02:00
Sven Geusens b237285703 Merge branch 'release/13.5' into v13/dev and version bump 2024-09-12 15:12:20 +02:00
Andreas ZerbstandGitHub a96a304860 V14 Fix E2E tests (#17011)
* Fixed tests

* Fixed tests

* Added timeout

* Fixed rest of the failing tests

* Bumped version

* Added timeout

* Bumped version of helpers

* Added parameter

* Applied fixes for tests and did some skips

* Small changes

* Bumped version

* Fixed comments
2024-09-12 11:04:12 +02:00
Kenn JacobsenandGitHub 3d3f6b5021 Add endpoint for upgrade checks (#17026)
* Fix upgrade check repo, so it's able to check more than once :)

* Add VersionCheckPeriod to server configuration output

* Add upgrade check endpoint

* Obsolete unused response model

* Update OpenAPI JSON
2024-09-11 17:08:50 +02:00
Jacob Overgaard 78aaafedc7 update backoffice submodule 2024-09-11 07:53:34 +02:00
Sven Geusens a6c5581942 Update version to non RC 2024-09-10 18:10:57 +02:00
Sven GeusensandGitHub 9a088d36b9 Expand RedirectUrl.Url storage type to avoid truncation (#17038)
* Add migration to expand RedirectUrl.Url to varcharMax

* Simplify Migration

* readded notnull attribute
2024-09-10 18:07:20 +02:00
Emma L GarlandandGitHub 862820c6a6 Resolved more warnings, and marked more warning types as errors (#16990)
* Fix warnings SA1111, SA1028, SA1500, IDE1270  in Umbraco.Web.Website, and updated rules.

* Remove warnings: IDE0270: Null check can be simplified

* More SqlServer project warnings resolved

* CS0105 namespace appeared already

* Suppress warning until implementation:

#pragma warning disable CS0162 // Unreachable code detected
#pragma warning disable CS0618 // Type or member is obsolete

CS0162 remove unreachable code
SA1028 remove trailing whitespace
SA1106 no empty statements
CS1570 malformed XML
CS1572 corrected xml parameter
CS1573 param tag added
IDE0007 var not explicit
IDE0008 explicit not var
IDE0057 simplify substring
IDE0074 compound assignment
CA1825 array.empty

Down to 3479 warnings
2024-09-10 15:17:29 +01:00
Sven Geusens 407734ff4a Fix null reference exception in CacheValues.For when building the CompositeStringStringKey (#17024)
* Fix null ref exeption based on IPropertyValue.Culture documentation

* Clarify comment
2024-09-10 12:50:02 +02:00
Sven GeusensandGitHub a74d963cfa Fix null reference exception in CacheValues.For when building the CompositeStringStringKey (#17024)
* Fix null ref exeption based on IPropertyValue.Culture documentation

* Clarify comment
2024-09-09 18:13:14 +02:00
Jacob Overgaard a30827145c update backoffice submodule 2024-09-09 16:01:25 +02:00
Niels LyngsøandNiels Lyngsø 02a47695e7 dispatch change event when embedded media has been added (#17008) 2024-09-09 13:09:31 +02:00
Niels Lyngsø 0f37cd3a45 PR 17018 2024-09-09 13:07:47 +02:00
Yari MariënandGitHub 5fe18bb78c Content.EditorDirectiveController: added formSubmittedValidationFailed broadcast to prevent fields to stay disabled (#17018) 2024-09-09 13:05:12 +02:00
Niels LyngsøandGitHub b16dfa9ca1 dispatch change event when embedded media has been added (#17008) 2024-09-09 12:49:07 +02:00
kasparboelkjeldsenandGitHub 3d5e70654b ModelsGenerator to IModelsGenerator in BuildModelsBuilderController (#16919)
* ModelsGenerator to IModelsGenerator in BuildModelsBuilderController

* Added obsolete constructors for backwards compatibility
2024-09-09 08:06:52 +02:00
marwaldvandMatthew-Wise 7acce83c83 Update LogDto.cs
fix: issue resolved, where content saving breaks due to saving to umbracoLog with error message like that: String or binary data would be truncated in table 'dto.umbracoLog', column 'parameters'. Truncated value: 'English (United States), German (Switzerland), French (France), Italian (Italy), Arabic (Iraq), Pers'...
2024-09-05 14:55:35 +02:00
3e6116fcba No longer shows success message if content moving is cancelled (#15051)
* Fix for issue https://github.com/umbraco/Umbraco-CMS/issues/13923
 - Added AttemptMove method to the ContentService
 - Updated ContentController PostMove method to return ValidationProblem whenever the node is not moved

* Align changes with V14 solution. Make it non breaking.

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2024-09-05 14:08:48 +02:00
Bjarke Berg 3b3c9c57ca Merge remote-tracking branch 'refs/remotes/origin/v13/dev' into v14/dev 2024-09-04 14:20:43 +02:00
Ronald BarendseandGitHub ef3bf496e9 Avoid concurrent build of Umbraco.JsonSchema tool and add execution timeouts to Exec build tasks (#17006)
* Disable building Umbraco.JsonSchema and Umbraco.Tests.AcceptanceTest.UmbracoProject

* Add 10 minute timeout to Exec MSBuild tasks
2024-09-04 13:44:19 +02:00
087a01de83 V14/fix/cookie breaking installer (#16993)
* Do not run authentication if Umbraco is not ready for it. Fail instead.

* Fix breaking change

* Spelling + code style :)

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-09-03 11:05:22 +02:00
Sebastiaan Janssen bff293213d Merge branch 'v13/dev' into v13/contrib 2024-09-03 11:01:39 +02:00
a47a1775f2 Prevent templates being editable when using Production runtime mode (#16923)
Co-authored-by: Nick Hoang <nick@codeberwery.com>
Co-authored-by: Jason Elkin <jason@bumpdigital.co.uk>
2024-09-03 00:54:32 +01:00
Jacob Overgaard 9321774613 Merge branch 'v14/dev' of github.com:umbraco/Umbraco-CMS into v14/dev 2024-08-29 11:38:35 +02:00
Jacob Overgaard 590b28110b update backoffice submodule 2024-08-29 11:38:24 +02:00
c277005b62 improve missingProperties data returned for missing propertie values (#16910)
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2024-08-29 10:12:43 +02:00
Andreas ZerbstandGitHub 6851113cf1 V14 QA added block list editor tests (#16862)
* Added tests for blocklistEditor

* Added more tets

* Removed faker

* Added blockTest

* Updates

* Added tests

* Removed dependencies

* Fixes

* Clean up

* Fixed naming

* Cleaned up

* Bumped version

* Added missing semicolons

* Added tags

* Only runs the new tests

* Updates

* Bumped version

* Fixed tests

* Cleaned up

* Updated version

* Fixes, not done

* Fixed tests

* Bumped helpers

* Bumped helpers

* Fixed conflict

* Fixed comment

* Reverted to run smokeTests

* Updated helpers
2024-08-29 08:47:24 +02:00
Jason Elkin b2a2df7a8a Ignore Visual Studio's generated launchSettings file. 2024-08-28 14:08:52 +01:00
Sven Geusens 34179f5b7d Merge branch 'release/13.5' into v13/dev and bump version 2024-08-28 10:14:09 +02:00
98e9a300bc Treat warnings as errors for initial projects (#15019)
* Treat warnings as errors for Umbraco.Cms, Umbraco.Cms.Api.Common and Umbraco.Cms.Api.Delivery projects.

* Treat warnings as errors for Umbraco.Cms.Imaging.ImageSharp and Umbraco.Cms.Imaging.ImageSharp2 projects

* Treat warnings as errors for Umbraco.Cms.Persistence.EFCore.Sqlite, Umbraco.Cms.Persistence.EFCore.SqlServer and Umbraco.Cms.StaticAssets

* Treat warnings as errors for Umbraco.Cms.Targets

* Treat warnings as errors for templates/Umbraco.Templates and Umbraco.JsonSchema

* More projects with warnings as errors.

* Reverted warnings as errors due to some file changes since the update.

* Remove unwanted tag

* Removed warnings as errors on TestData project

* Implement warnings as errors in props file, and exclude specific warnings where appropriate as per PR review suggestions.

* Reverted spaces

* Revert "Reverted spaces"

This reverts commit 3734c45e22.

* Update sdk version to fully support Umbraco.code 2.2.0 dependency on Microsoft.CodeAnalysis.CSharp.Workspaces 4.10.0

* Ignore PathToLongErrors for now in static assets

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-08-27 18:56:09 +02:00
Sven GeusensandGitHub 95f08e748e Update sdk version to fully support Umbraco.code 2.2.0 dependency on Microsoft.CodeAnalysis.CSharp.Workspaces 4.10.0 (#16963) 2024-08-27 18:55:42 +02:00
Sven Geusens d38b744c08 Merge branch 'v13/dev' into release/13.5 2024-08-27 18:54:54 +02:00
Jacob OvergaardandGitHub 04d96c6a94 fix: appEntryPoint types are not executed unless we have the UmbappEntryPointExtensionInitializer running (#16967) 2024-08-27 16:07:50 +01:00
Niels LyngsøandGitHub ef58416814 V13: Read only mode while saving (#16961)
* make a clear console error when case happens

* turn Content into readonly mode when submitting form aka saving
2024-08-27 15:01:59 +01:00
Sven GeusensandGitHub 62b7c9468e Fix undefined property read (#16941) 2024-08-27 14:28:04 +01:00
Sven GeusensandGitHub 27108036b4 Support parentId in document/media item search endpoints (#16933)
* Updated search services to start searching from a guid based key.

* Solved api breaking changes with new minor version

* Ordering and formatting

* Changed interface default implementation to the new method...

* Consolidated version

* PR review cleanup and renaming
2024-08-27 15:18:25 +02:00
148d51bf8c Remove warnings from Umbraco.Web.UI (#16958)
* Fixed warning SA1119 for Umbraco.Web.UI project (unnecessary parenthesis)

* Remove parenthesis (startup no longer exists)

---------

Co-authored-by: Emma Garland <emma.garland@rocksolidknowledge.com>
2024-08-27 11:29:02 +01:00
Andreas ZerbstandGitHub 3f8bae1a29 V14 QA added Block grid acceptance tests (#16908)
* Added blockgrid tests

* Additional tests

* Added more tets

* Split tests

* Block updates

* Bumped version

* Added block tests

* Fixes, not done

* Fixed

* Updated helper

* Bumped version

* Bumped helpers

* Fixed conflicts

* Removed page

* Removed page

* Bumped

* Reverted to run smoke tests
2024-08-27 10:36:44 +02:00
Nhu DinhandGitHub c5e5fa2dd1 V14 QA Added Content tests with various of data types (#16824)
* Added Content tests with content picker

* Removed the test for content picker

* Added Content tests with the default content picker

* Added more Content tests with Content Picker data type

* Added the Content tests with Dropdown

* Added Content tests with Image Cropper

* Updated upload file method due to test helper changes

* Added Content tests with Image Cropper

* Added Content tests with Image Cropper data type

* Added Content tests with Media Picker data type

* Updated Media tests due to ui helper changes

* Bumped version of test helper and json builder

* Make all Content tests run in pipeline - should remove it before merging

* Fixed the name of tests

* Updated the tests for Media Picker in Content section

* Added the Content tests with Multiple Media Picker

* Updated the Content test with Content Picker due to the test helper changes

* Bumped version of test helper

* Fixed the failing tests for Content

* Removed Image Cropper test in this branch

* Added more waits

* Added smoke tags

* Make smoke tests run in the pipeline

* Added Content tests for Image Cropper

* Added smoke tags to make all Image Cropper tests running in the pipeline

* Added Content tests with Member Picker

* Added Content tests with Multiple Image Media Picker

* Added Content tests with Numeric

* Bumped version of test helper

* Make all Content tests running in the pipeline

* Assert that the content is published

* Assert that the content is published

* Fixed code conflict

* Fixed comment and code conflict

* Make all Content tests run in the pipeline

* Refactor the Content tests with different data type

* Cleaned code

* Make the smoke tests run in the pipeline
2024-08-27 13:53:35 +07:00
Bjarke BergandGitHub bafdb21b45 Fix mandatory RTE validation (#16962)
* Added a custom RichTextRequiredValidator, to check that the empty richtext object (still with json) can be required or not. We are now testing the markdown needs to have a value

* Fixed namespaced and moved back wrong class

* Cleanup
2024-08-26 15:03:11 +02:00
MoleandGitHub a31e4265bd Improve dotnet templates (#16815)
* Add delivery api toggle

* Add Dockerfile

* add docker compose template

* Ensure no duplicate database containers

* Remove wwwroot/umbraco permission check

We don't need write access to this folder

* Provide environment variables from dokcer-compose

* Build as debug from compose

The compose file is intended to be used for local dev

* Don't store password in docker files

Still not great to store it in .env but it's fine for dev

* Add additional template files

* Add docker ignore file

* Enable delivery API in settings too

* Enable models builder mode toggle

* Add WIP for umbraco release option

* Add starterkit option

* Add option to chose LTS or latest

* Add development mode option

* Add descriptions

* Add display names

* Add backoffice development at explicit default

* Rearrange DevelopmentMode before ModelsBuilderMode

* Allow specifying a port for the compose file

* Add some notes

* Move starterkits into its own template

* Don't update version

* Remove test configuration from Dockerfile

* Add default modelsbuilder option

* Update descriptions

* overwrite default values in IDE development

* Remove obsolete runtime minification

* Try and fix healthcheck

* Don't use post action for starterkit

otherwise it won't work with Rider, also make the version 13.0.0 if LTS is chosen

* Move UmbracoVersion above FinalVersion

Otherwise, rider will use UmbracoVersion for some weird reason

* Fix healthcheck

* Use else instead of second if for modelsbuilder

* Obsolete UmbracoVersion

* Remove custom release option

* Use forward slashes for volumes

* Add MSSQL_SA_PASSWORD env variable

* Temporarily limit acceptance tests so it works

* Try again

* Disable SQLServer integration tests

* Set UseHttps to false in appsettings.Development.json

You still want to be able to use non-https when developing locally

* Fix LTS version

LTS still needs installer endpoints added

* Update permissions of wwwroot/umbraco for v13 sites

* Fix conditional in Program.cs

* Undo pipeline shenanigans
2024-08-26 11:21:02 +02:00
Terence BurridgeandEmma L Garland 385a5345b1 Update valid reasons not to have a template on a content node to include having a redirect field 2024-08-25 22:01:38 +01:00
Jason ElkinandMatthew-Wise 862e45eca3 Ignore Visual Studio's generated launchSettings file. 2024-08-25 15:31:51 +01:00
Nhu DinhandGitHub 17d441760d V14 QA Fixed the failing smoke tests (#16953)
* Updated api tests for Data type due to test helper changes

* Fixed Data Type tests due to test helper changes

* Updated the test for edit password due to ui helper changes

* Bumped version
2024-08-23 16:18:28 +07:00
Nhu DinhandGitHub 8eeac2774b V14 Added the Content tests with Upload Article, Upload Audio and Upload File data type (#16945)
* Added the test files for article

* Added Content tests with Upload Article datatype

* Added the audio test files

* Fix format

* Updated the Content tests with Upload Article

* Added Content tests with Upload Audio

* Added Content tests with Upload File

* Bumped version

* Make all Content tests run in the pipeline

* Cleaned code

* Make the smoke tests run in the pipeline
2024-08-23 15:17:30 +07:00
Nhu DinhandGitHub 405fd9724f V14 Added the Content tests with Textarea, Textstring, TrueFalse datatype (#16946)
* Added Contents test with Textarea

* Added Content tests with textstring

* Removed the tests for Textarea property editor

* Added Content tests for TrueFalse data type

* Bumped version of test helper

* Make all Content tests run in the pipeline

* Cleaned code

* Make the smoke tests run in the pipeline
2024-08-23 13:54:14 +07:00
dependabot[bot]andJason Elkin e8051978e9 Bump axios from 1.6.5 to 1.7.4 in /tests/Umbraco.Tests.AcceptanceTest
Bumps [axios](https://github.com/axios/axios) from 1.6.5 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.6.5...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 20:49:13 +01:00
Sven Geusens 136753f0b0 Merge branch 'release/14.2' into v14/dev with correct version bump
# Conflicts:
#	version.json
2024-08-22 16:07:40 +02:00
Sven Geusens 1b21caa20a Update backoffice submodule with hotfix for breaking change that broke forms. 2024-08-22 12:14:43 +02:00
Nhu DinhandGitHub bbda1c8330 V14 Added Content tests with Multi URL picker (#16885)
* Added Content tests with Multi URL Picker

* Bumped version of test helper

* Make all Content tests run in the pipeline - remove it before merging

* Added goToSection step

* Fix comments

* Fix comments

* Fixed comments

* Make the smoke tests run in the pipeline
2024-08-22 16:00:35 +07:00
Bjarke BergandGitHub 79080ffa93 Updated nuget packages and take a explicit dependency on Microsoft.IdentityModel.JsonWebTokens (#16935) 2024-08-21 10:25:39 +02:00
Sven GeusensandGitHub f99f821a6d Fix Mismatching constraint names in old migration (#16891)
* Find the constraint name based on table,column,type name instead of hardcoding it

* removed unnecesary using

* Check constraint rename seperatly from column rename
2024-08-21 09:07:09 +02:00
Nikolaj Geisle bf805a181a Bump version 2024-08-20 12:54:19 +02:00
Nikolaj Geisle 66592bfbcc Merge branch 'release/14.1' into release/14.2
# Conflicts:
#	version.json
2024-08-20 12:53:40 +02:00
Sven Geusens 1a69bc9d8b Merge branch 'v13/dev' into v14/dev
# Conflicts:
#	Directory.Packages.props
#	src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
2024-08-20 11:25:31 +02:00
leekelleher 1ff3858a9e update backoffice submodule 2024-08-20 09:56:00 +01:00
Bjarke BergandNikolaj Geisle b76070c794 Merge commit from fork
* Use Debug Mode to determine content of the ProblemDetails

* Cache the debug value
2024-08-19 15:10:44 +02:00
Sven GeusensandNikolaj Geisle 72bef8861d Merge commit from fork 2024-08-19 15:10:24 +02:00
Bjarke BergandGitHub d0c76171dd Merge commit from fork
* Use Debug Mode to determine content of the ProblemDetails

* Cache the debug value
2024-08-19 15:05:02 +02:00
Sven GeusensandGitHub b0988e6136 Merge commit from fork 2024-08-19 15:04:08 +02:00
Nhu DinhandGitHub 20087c8e80 V14 Added the Content tests with Radiobox and Tags datatype (#16909)
* Added Content tests with Radiobox data type - not done

* Removed Content test with Tags property editor

* Added Content tests with Radiobox datatype

* Added Content tests with Tags data type

* Created content with data type via API

* Bumped version of test helper

* Make all Content tests run in the pipeline

* Make all smoke tests run in the pipeline
2024-08-19 13:54:55 +07:00
Matthew CareandGitHub 3b6fbf1a4c Cache a dictionary of dictionaries (#15908)
* Re-commit change

Re-commit change after merge

* Fix issues after merge

Update usings after merge

* Re-delete obsolete

Remove the obsolete method
2024-08-17 15:00:24 +01:00
Emanuel GustafzonandGitHub 9338395a59 Stripped username before login (#16921)
* Stripped username before login
2024-08-16 20:59:10 +01:00
Nikolaj Geisle a3ede67777 bump version 2024-08-16 09:29:03 +02:00
Niels LyngsøandGitHub 3b51475150 move and rename (#16916) 2024-08-15 12:53:57 +02:00
Sebastiaan Janssen b41de5764b Merge branch 'v13/dev' into v13/contrib 2024-08-15 11:28:55 +02:00
PeterandSebastiaan Janssen bb1c36f591 Making method ExecuteAsync virtual. (#16496)
Co-authored-by: Kvyatkovsky, Petr <pkvyatkovsky@qulix.com>
(cherry picked from commit 3a9ef3810b)
2024-08-15 11:15:24 +02:00
Sebastiaan Janssen 3560fc9848 Merge branch 'v14/dev' into contrib 2024-08-15 11:10:30 +02:00
Jason Elkin 80b8b2a4ed Issue-15712: MemberDefaultLockoutTimeInMinutes fix. 2024-08-15 09:51:27 +02:00
Andrii KudandJason Elkin 09f16c33d1 Issue-15712: MemberDefaultLockoutTimeInMinutes fix. 2024-08-15 08:48:58 +01:00
fd100602c2 V14/fix/element switch validation (#16421)
* Added Element <-> Document type switch validation

* Apply HasElementconfigured to block grid and block list

Fix smalle bug + optimization

* Moved some of the logic into warnings trough notifcationhandlers and eventmessages

* Cleanup

* Update openApi spec (merge changes)

* Add IsElement check between parent and child on creation

* Typos

* Transformed HasElementConfigured into HasElementConfigured

* Typo

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>

* IsElement Validation refactor

Moved validation logic regarding doctype IsElement switch into its own service as it will be consumed by more things down the line

* commit missing services...

* Naming improvements

* Bugfix

* First batch of integration tests for ElementSwitchValidator

* More integration tests!

* Little reformatting

* Changed the default values of block based configuration to match expected values.

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-08-15 07:11:17 +02:00
PeterGitHubKvyatkovsky, Petr <pkvyatkovsky@qulix.com>
3a9ef3810b Making method ExecuteAsync virtual. (#16496)
Co-authored-by: Kvyatkovsky, Petr <pkvyatkovsky@qulix.com>
2024-08-14 21:07:36 +01:00
Andreas ZerbstandGitHub 7a700f3029 V14 QA content image media picker tests (#16890)
* Started some tests for imageMediaPicker

* Added tests

* Added additional test

* Fixed based on updates to helpers

* Bumped versions

* Fixes based on comments

* Updated so we run all content test

* Cleaned
2024-08-14 21:05:09 +02:00
Nikolaj GeisleandGitHub de57523b4f Use browse instead of protect (#16907) 2024-08-14 10:03:35 +02:00
56b3f17355 V14: Don't duplicate audit loggin for media trashing (#16903)
* Remove auditlogging from media service

* Refactor to use backofficeSecurityaccessor to get backoffice user

* Fix constructor error

* Reinstate media service move

* Go back to audit type delete

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-08-13 12:29:29 +02:00
9d94658372 V13: fix 16663 (#16866)
* fix unit testing

* fix server value update case

* PastePropertyResolver for RTE Blocks

---------

Co-authored-by: leekelleher <leekelleher@gmail.com>
2024-08-13 09:43:20 +01:00
Niels LyngsøandGitHub 81f36df066 V13: fix 15516 (#16864)
* fix unit testing

* fix server value update case

* re initialize Block if it was offloaded
2024-08-13 09:25:24 +01:00
Nikolaj Geisle 66ccc92399 change version after merge 2024-08-13 08:57:26 +02:00
Nikolaj Geisle 8aee8a8bc9 Merge branch 'release/14.2' into v14/dev 2024-08-13 08:57:05 +02:00
Nikolaj Geisle a36535b354 bump version 2024-08-13 08:56:18 +02:00
EalseandEmma L Garland 7afc2b9963 fix: uploaded item not selected in media picker 2024-08-12 21:42:35 +01:00
Kenn JacobsenandNikolaj Geisle 79807999ee Add the default date-with-time configuration if missing (#16902) 2024-08-12 16:37:01 +02:00
Kenn JacobsenandGitHub 61a9386209 Add the default date-with-time configuration if missing (#16902) 2024-08-12 14:25:27 +02:00
Kenn JacobsenandZeegaan 506d3b3a9c Fix date conversion on the server-side (#16841)
(cherry picked from commit ceddf8681b)
2024-08-12 13:15:27 +02:00
Kenn JacobsenandGitHub ceddf8681b Fix date conversion on the server-side (#16841) 2024-08-12 12:41:37 +02:00
c288d038dd v14: TryGetUmbracouser default implementation (#16899)
* Add default implementation

* Update src/Umbraco.Core/Security/Authorization/IAuthorizationHelper.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-08-12 12:38:28 +02:00
a235591521 Add Content-Security-Policy (CSP) health check (#16830)
* Add CSP Header Check

* Update src/Umbraco.Core/EmbeddedResources/Lang/en.xml

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>

* Update src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
2024-08-12 10:18:20 +02:00
leekelleher 35d6fc2f39 update backoffice submodule 2024-08-12 08:16:20 +01:00
Zeegaan d3d057db60 bumb version.json 2024-08-12 09:04:37 +02:00
Andreas ZerbstandGitHub b30a45a248 V14 QA applied changes from our test helpers (#16889)
* Made fixes based on changes in our test helpers

* Bumped version

* Fixed user tests
2024-08-12 10:28:34 +07:00
leekelleher cae00d49d8 update backoffice submodule 2024-08-08 09:04:34 +01:00
Sven GeusensandGitHub 2e3369a09a Upgrade imagesharp2 dependency (#16883) 2024-08-07 15:20:28 +02:00
Bjarke BergandGitHub 58e515da11 Do not allow save of invalid domains (#16880) 2024-08-07 13:38:32 +02:00
Bjarke BergandGitHub 212b2c999f Updated to lastest nuget minor or patch versions (#16871) 2024-08-07 10:17:00 +02:00
Sebastiaan Janssen 1c1b4c6ee8 Merge branch 'v14/dev' into contrib 2024-08-06 14:42:37 +02:00
mcl-szandSebastiaan Janssen 2761f5cd20 Combining OpenId and OfflineAccess scope (#16220)
* Combining OpenId and OfflineAccess scope

When the client scope is set to "openid offline_access", the returned scope only has the "offline_access" scope. The "openid" scope and the "id_token" are missing. By combining the OpenId and OfflineAccess as return scope, the refresh_token and id_token are returned.

* Update MemberController.cs

Cleaner way, provided by @kjac, to check if the scope has openid and/or offiline_access set.

(cherry picked from commit 55f9b09ab7)
2024-08-06 14:35:59 +02:00
Nikolaj Geisle 0f16dae269 Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_7_0/MigrateTagsFromNVarcharToNText.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/UseNvarcharInsteadOfNText.cs
2024-08-06 09:09:10 +02:00
Sebastiaan Janssen d5831fea94 Merge branch 'v13/dev' into v13/contrib 2024-08-06 09:07:06 +02:00
Sebastiaan Janssen 71afa21701 Revert "Configure WebP encoder to use Lossy by default (#16769)"
This reverts commit ee0fd7dd5f.
2024-08-06 09:04:27 +02:00
Nikolaj GeisleandGitHub 4f63324411 Create new AccessPolicy (#16865) 2024-08-06 08:47:01 +02:00
18d2656414 FIX: Deleting language can make the backoffice client unusable (#16863)
* Make missing languages a non blocker for usergroup retrieval

* Add logging

* Update obsolete message

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
2024-08-05 13:30:18 +02:00
Bjarke BergandGitHub 4cd2f4637b Updated nuget packages (#16861) 2024-08-05 11:23:21 +02:00
Callum WhyteandGitHub d26f1e474d Remove favicon from dotnet templates (#16840) 2024-08-05 10:22:42 +01:00
Sven GeusensandGitHub c48490bf13 OpenIddict needs to process the /.well-known/openid-configuration url to be able to return the data. (#16845) 2024-08-05 11:11:56 +02:00
Bartlomiej KomendarczukandGitHub fc5cd6bdd1 Added apostrophe to allowed characters for username. (#16406) 2024-08-02 13:26:16 +01:00
Wojciech TenglerandZeegaan 2736a513a3 Fixing regression bug introduced in #14806 and found during investigation of #16803 - well tested on db with 300k+ nodes (#16837)
Co-authored-by: Wojciech Tengler <wtengler@umbracare.net>
(cherry picked from commit 688790e90a)
2024-08-02 11:58:02 +02:00
688790e90a Fixing regression bug introduced in #14806 and found during investigation of #16803 - well tested on db with 300k+ nodes (#16837)
Co-authored-by: Wojciech Tengler <wtengler@umbracare.net>
2024-08-02 11:21:48 +02:00
Sven GeusensandGitHub bb654360bf Improve migration performance (#16784)
* Improve migration performance

* Fix PR review comments

* Revert tags migration for sql lite as the optimized sql doesn't work properly and sqlLite datasets should not be large anyway
2024-07-31 10:35:28 +02:00
Kenn JacobsenandGitHub 5d866d7bae Graceful handling of unauthorized requests to the Management API (#16836) 2024-07-31 09:45:34 +02:00
mcl-szandGitHub 55f9b09ab7 Combining OpenId and OfflineAccess scope (#16220)
* Combining OpenId and OfflineAccess scope

When the client scope is set to "openid offline_access", the returned scope only has the "offline_access" scope. The "openid" scope and the "id_token" are missing. By combining the OpenId and OfflineAccess as return scope, the refresh_token and id_token are returned.

* Update MemberController.cs

Cleaner way, provided by @kjac, to check if the scope has openid and/or offiline_access set.
2024-07-30 08:38:06 +02:00
Sven GeusensandGitHub f8079608fe Clean up Processed local image links in Management api (#16828)
* Removed type attribute from processed local links

improved code readabilty by using multi return type to private class

* Removed type attribute from processed locallinks in delivery api

* Removed type attribute from expected output regarding locallink parsing

* Added type atttribute removal in deliveryapi for local image link and invalid local links

Test rename for clarity and
2024-07-29 13:32:42 +02:00
Jacob Overgaard ceb86b6c36 Merge remote-tracking branch 'origin/v14/dev' into v14/dev 2024-07-26 11:06:25 +02:00
Jacob Overgaard 18c7fc5767 update backoffice submodule 2024-07-26 11:06:15 +02:00
Nhu DinhandGitHub 15a74e2511 V14 Fixing the failing smoke tests (#16822)
* Added tests with empty name for Partial View, Stylesheet, Script and Template

* Added tests with non-empty folder for Partial View, Stylesheet, Script

* Added tests to create a partial view in a folder in a folder

* Moved goToSetting to Arrange

* Fixed the failing tests and added the unhappy path tests

* Fixed the failing tests due to UI changes

* Fixed format

* Bumped version of test helper

* Run the tests for Settings in the pipeline

* Fixed the Member failing tests

* Fixed the Document Type Design Tab failing tests

* Fixed the Media Type Design Tab failing tests

* Fixed the Script failing tests

* Bumped version of test helper

* Bumped version of test helper
2024-07-26 10:56:23 +02:00
b14ac811ef Make block editor base classes public (#16774)
* Make block editor base classes public

* Update BlockEditorValues.cs

Change to trigger a new build for #16774

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-07-26 08:16:08 +02:00
Jacob Overgaard bec0bd6641 update backoffice submodule 2024-07-25 18:20:17 +02:00
Nhu DinhandGitHub 4f62746053 V14 Added Content tests with various data types (#16809)
* Added Content tests with content picker

* Removed the test for content picker

* Added Content tests with the default content picker

* Added more Content tests with Content Picker data type

* Added the Content tests with Dropdown

* Added Content tests with Image Cropper

* Updated upload file method due to test helper changes

* Added Content tests with Image Cropper

* Added Content tests with Image Cropper data type

* Added Content tests with Media Picker data type

* Updated Media tests due to ui helper changes

* Bumped version of test helper and json builder

* Make all Content tests run in pipeline - should remove it before merging

* Fixed the name of tests

* Updated the tests for Media Picker in Content section

* Added the Content tests with Multiple Media Picker

* Updated the Content test with Content Picker due to the test helper changes

* Bumped version of test helper

* Fixed the failing tests for Content

* Removed Image Cropper test in this branch

* Added more waits

* Added smoke tags

* Make smoke tests run in the pipeline
2024-07-25 17:59:47 +07:00
Elitsa MarinovskaandGitHub b61b71ee9d Returning the correct totalItems amount (#16799) 2024-07-25 10:01:53 +02:00
9a49ab712b Add Health Check for Runtime mode (#16715)
* Add Health Check for Runtime mode

* Update src/Umbraco.Core/EmbeddedResources/Lang/en.xml

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>

* Update src/Umbraco.Core/HealthChecks/Checks/LiveEnvironment/RuntimeModeCheck.cs

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>

* Update lang file

* Fix typo.

---------

Co-authored-by: Jason Elkin <jasonelkin86@gmail.com>
2024-07-24 17:36:17 +01:00
Ronald BarendseandGitHub 2f78d1a8f3 Fix UdiRange.Parse() throwing ArgumentException for valid value (#16788)
* Add test to assert UdiRange can round-trip all selectors

* Fix parsing UdiRange without a selector
2024-07-24 14:28:19 +02:00
Jacob Overgaard 7e444e5604 update backoffice submodule 2024-07-24 10:12:54 +02:00
9e0fb54ea5 Removed Type attribute from parsed local links (#16780)
* Removed type attribute from processed local links

improved code readabilty by using multi return type to private class

* Removed type attribute from processed locallinks in delivery api

* Removed type attribute from expected output regarding locallink parsing

* Cleanup

* Fixed spacing bug

* Added 2 more edge test cases

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-07-23 10:25:54 +02:00
Nikolaj Geisle 94ee50c819 Merge branch 'release/14.1.1' into v14/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client
#	version.json
2024-07-22 08:12:16 +02:00
MoleandGitHub 213a13db81 Merge pull request #16800 from umbraco/v14/merge
V14: Merge
2024-07-19 11:22:01 +02:00
nikolajlauridsen a7bfc6fbf0 Merge branch 'refs/heads/v13/dev' into v14/merge 2024-07-19 10:15:08 +02:00
nikolajlauridsen 635076d657 Revert "fix: revert the inert attribute on Tours since you are expected to be able to work with the background in certain steps"
This reverts commit d72fc5c4e8.
2024-07-19 10:14:54 +02:00
Jacob OvergaardandGitHub cad5502f79 V14: Remove user-defined.css (#16792)
* chore: remove the `user-defined.css` asset from the RCL

You cannot overwrite an asset in an RCL just like that, as the user-defined.css were intended.

* delete actual file
2024-07-18 13:06:27 +01:00
Jacob Overgaard 2f7afa67a3 update backoffice submodule 2024-07-18 12:56:58 +02:00
Daniël KnippersandGitHub ee0fd7dd5f Configure WebP encoder to use Lossy by default (#16769)
This greatly reduces file sizes in many cases compared to the default
Lossless setting that seems to be used for PNGs.
2024-07-16 20:48:32 +01:00
Jacob Overgaard eb4fc97c5d update backoffice submodule (datepicker hotfix) 2024-07-16 09:22:47 +02:00
Jacob Overgaard f6074b4c32 bump version to 14.1.1 2024-07-15 14:31:37 +02:00
Elitsa MarinovskaandGitHub dfe41d7f76 V13: Ensure TransformingIndexValues event is also raised from the DeliveryApiContentIndex (#16756)
* Removing override of OnTransformingIndexValues from DeliveryApiContentIndex

* Making sure that TransformingIndexValues event is raised for DeliveryApiContentIndex without performing the special index value transformations

* Review suggestion
2024-07-15 10:45:57 +02:00
Jacob Overgaard efe2f51d13 update backoffice submodule 2024-07-15 09:58:47 +02:00
Jacob Overgaard be81586b46 set version to 13.5.0-rc 2024-07-11 15:07:36 +02:00
Jacob Overgaard c33b06274d Merge remote-tracking branch 'origin/release/13.4' into v13/dev 2024-07-11 15:06:42 +02:00
Jacob Overgaard d72fc5c4e8 fix: revert the inert attribute on Tours since you are expected to be able to work with the background in certain steps 2024-07-11 12:50:49 +02:00
Jacob OvergaardandSebastiaan Janssen a41555cc0d fix: revert the inert attribute on Tours since you are expected to be able to work with the background in certain steps 2024-07-11 12:38:37 +02:00
Jacob Overgaard c1bf3a7e15 bump version to 13.4.1 2024-07-11 12:02:39 +02:00
Nikolaj Geisle cbb6c5c9bf Merge branch 'release/14.1' into v14/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client
2024-07-11 11:37:40 +02:00
Jacob Overgaard d05e32b6e9 update backoffice submodule 2024-07-10 11:49:47 +02:00
nikolajlauridsen 40a782e50f Merge remote-tracking branch 'refs/remotes/origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
2024-07-10 09:21:40 +02:00
Elitsa MarinovskaandGitHub 510f805223 Keeping launchBrowser settings as in v13 (#16765) 2024-07-09 09:57:26 +02:00
Jacob OvergaardandGitHub 512114bcd7 V14: Add usernameIsEmail to the user configuration object (#16759)
* fix: move usernameIsEmail from the current user to the user configuration since it is a static variable not only relevant to the current user

* update OpenApi.json

* update OpenApi.json

* update OpenApi.json
2024-07-08 16:15:48 +02:00
Elitsa 5f6be40bdf Revert "Removing override of OnTransformingIndexValues from DeliveryApiContentIndex"
This reverts commit f6deaca452.
2024-07-08 09:30:12 +03:00
Elitsa 8dc02fa081 Revert "Making sure base.OnTransformingIndexValues(e); is called for DeliveryApiContentIndex without the special index value transformations"
This reverts commit a7ff32891e.
2024-07-08 09:30:12 +03:00
Elitsa a7ff32891e Making sure base.OnTransformingIndexValues(e); is called for DeliveryApiContentIndex without the special index value transformations 2024-07-08 09:28:34 +03:00
Elitsa f6deaca452 Removing override of OnTransformingIndexValues from DeliveryApiContentIndex 2024-07-08 09:27:36 +03:00
Jacob Overgaard 26084d8bb5 update backoffice submodule 2024-07-05 13:45:27 +02:00
8681a4e4e8 Move ReservedFieldNames to type configuration endpoints (#16735)
* Move ReservedFieldNames to type configuration endpoints

* Update obsoletion messages

* Update src/Umbraco.Cms.Api.Management/Controllers/MemberType/ConfigurationMemberTypeController.cs

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

---------

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2024-07-05 12:34:25 +03:00
Jacob Overgaard ff3b1d678b introduce an "other changes" category 2024-07-05 09:10:06 +02:00
Jacob Overgaard 36d00bd967 add type/improvement to list of bug fixes 2024-07-05 09:05:23 +02:00
Jason Elkin f20528c9fa Merge branch 'v14/dev' into contrib 2024-07-04 12:56:41 +01:00
Nhu DinhandGitHub ffa85ee3b5 V14 Added Content tests with Checkbox list (#16733)
* Added Content tests with checkbox list

* Bumped version of test helper

* Make the Content tests run in the pipeline

* Moved goToBackOffice to beforeEach

* Removed the unnecessary file

* Moved goToBackOffice to beforeEach

* Make smoke test run in the pipeline
2024-07-04 16:57:55 +07:00
Elitsa MarinovskaandGitHub ef01c27fad Respect user start nodes in GetPagedChildren (used in List View) (#16722) 2024-07-02 09:55:03 +02:00
Elitsa MarinovskaandGitHub d8b4361936 V13: Update url scheme for Twitter OEmbedProvider (#16650)
* Adds url support for x.com/.*/status/.*

* Updated regex

* Obsoleting Twitter as OEmbedProvider

* Introducing X as its new alternative

* Adding X and removing Twitter from EmbedProvidersCollection

* Typo
2024-06-27 09:23:47 +02:00
Vlael LayugandGitHub 4e746d367e Use parentElement instead of parent when setting focus for modals with tabs (#16257)
* added null checker for umb-tab when it's trying to get the elm.parent

* use parentElement instead of parent
2024-06-22 13:01:04 +01:00
Christian YngvessonandGitHub b60665d096 Feature/swedish translations (#16582)
* Added some translations

* Update sv.xml - Minor typo
2024-06-14 16:18:18 +01:00
594 changed files with 28261 additions and 4137 deletions
+2 -1
View File
@@ -14,6 +14,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
@@ -28,7 +29,7 @@
<!-- Package Validation -->
<PropertyGroup>
<GenerateCompatibilitySuppressionFile>true</GenerateCompatibilitySuppressionFile>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>14.0.0</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
+31 -27
View File
@@ -12,25 +12,25 @@
</ItemGroup>
<!-- Microsoft packages -->
<ItemGroup>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.11" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.6" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.11" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.6" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.6" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.11" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.11" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
@@ -45,14 +45,14 @@
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageVersion Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageVersion Include="Examine" Version="3.2.1" />
<PackageVersion Include="Examine.Core" Version="3.2.1" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.61" />
<PackageVersion Include="JsonPatch.Net" Version="3.1.0" />
<PackageVersion Include="Examine" Version="3.5.0" />
<PackageVersion Include="Examine.Core" Version="3.5.0" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="JsonPatch.Net" Version="3.1.1" />
<PackageVersion Include="K4os.Compression.LZ4" Version="1.3.8" />
<PackageVersion Include="MailKit" Version="4.6.0" />
<PackageVersion Include="MailKit" Version="4.8.0" />
<PackageVersion Include="Markdown" Version="2.2.1" />
<PackageVersion Include="MessagePack" Version="2.5.168" />
<PackageVersion Include="MessagePack" Version="2.5.192" />
<PackageVersion Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageVersion Include="MiniProfiler.Shared" Version="4.3.8" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
@@ -62,30 +62,34 @@
<PackageVersion Include="OpenIddict.AspNetCore" Version="5.7.0" />
<PackageVersion Include="OpenIddict.EntityFrameworkCore" Version="5.7.0" />
<PackageVersion Include="Serilog" Version="3.1.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageVersion Include="Serilog.Expressions" Version="4.0.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Formatting.Compact" Version="2.0.0" />
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="3.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.1" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.7" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
</ItemGroup>
<!-- Transitive pinned versions (only required because our direct dependencies have vulnerable versions of transitive dependencies) -->
<ItemGroup>
<!-- Both Microsoft.EntityFrameworkCore.SqlServer and NPoco.SqlServer bring in a vulnerable version of Azure.Identity -->
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<!-- Dazinator.Extensions.FileProviders brings in a vulnerable version of System.Net.Http -->
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<!-- Examine brings in a vulnerable version of System.Security.Cryptography.Xml -->
<PackageVersion Include="System.Security.Cryptography.Xml" Version="8.0.1" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="8.0.2" />
<!-- Both Dazinator.Extensions.FileProviders and MiniProfiler.AspNetCore.Mvc bring in a vulnerable version of System.Text.RegularExpressions -->
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<!-- Both OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer bring in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.7.1" />
<!-- Examine.Lucene bring in a vulnerable version of Lucene.Net.Replicator -->
<PackageVersion Include="Lucene.Net.Replicator" Version="4.8.0-beta00017" />
</ItemGroup>
</Project>
</Project>
+17 -19
View File
@@ -5,8 +5,8 @@ parameters:
displayName: Run SQL Server Integration Tests
type: boolean
default: false
- name: sqlServerAcceptanceTests
displayName: Run SQL Server Acceptance Tests
- name: sqlServerLinuxAcceptanceTests
displayName: Run SQL Server Linux Acceptance Tests
type: boolean
default: false
- name: myGetDeploy
@@ -75,7 +75,7 @@ stages:
- job: A
displayName: Build Umbraco CMS
pool:
vmImage: 'ubuntu-latest'
vmImage: 'windows-latest'
steps:
- checkout: self
submodules: true
@@ -506,6 +506,10 @@ stages:
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Ensures we have the package wait-on installed
- pwsh: npm install wait-on
displayName: Install wait-on package
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
@@ -517,10 +521,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- ${{ if eq(parameters.isNightly, true) }}:
pwsh: npm run test --ignore-certificate-errors
${{ else }}:
pwsh: npm run smokeTest --ignore-certificate-errors
- pwsh: npm run smokeTestSqlite --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
@@ -556,18 +557,17 @@ stages:
- job:
displayName: E2E Tests (SQL Server)
# condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerAcceptanceTests}}) # Outcommented due to timeouts
condition: eq(${{parameters.sqlServerAcceptanceTests}}, True)
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: 'Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True'
${{ if eq(parameters.sqlServerLinuxAcceptanceTests, True) }} :
Linux:
vmImage: 'ubuntu-latest'
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: 'Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True'
Windows:
vmImage: 'windows-latest'
pool:
@@ -593,7 +593,8 @@ stages:
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)" | Out-File .env
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
@@ -660,10 +661,7 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- ${{ if eq(parameters.isNightly, true) }}:
pwsh: npm run test --ignore-certificate-errors
${{ else }}:
pwsh: npm run smokeTest --ignore-certificate-errors
- pwsh: npm run smokeTest --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
@@ -714,7 +712,7 @@ stages:
dependsOn:
- Unit
- Integration
# - E2E
# - E2E
condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.myGetDeploy}}))
jobs:
- job:
+399
View File
@@ -0,0 +1,399 @@
name: Nightly_E2E_Test_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
pr: none
trigger: none
# schedules:
# - cron: '0 0 * * *'
# displayName: Daily midnight build
# branches:
# include:
# - v14/dev
variables:
nodeVersion: 20
solution: umbraco.sln
buildConfiguration: Release
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
npm_config_cache: $(Pipeline.Workspace)/.npm_client
NODE_OPTIONS: --max_old_space_size=16384
parameters:
- name: runSmokeTests
displayName: Run the smoke tests
type: boolean
default: false
stages:
###############################################
## Build
###############################################
- stage: Build
jobs:
- job: A
displayName: Build Umbraco CMS
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
fetchDepth: 0
submodules: true
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- template: templates/backoffice-install.yml
- script: npm run build:for:cms
displayName: Run build (Bellissima)
workingDirectory: src/Umbraco.Web.UI.Client
- script: npm ci --no-fund --no-audit --prefer-offline
displayName: Run npm ci (Login)
workingDirectory: src/Umbraco.Web.UI.Login
- script: npm run build
displayName: Run npm build (Login)
workingDirectory: src/Umbraco.Web.UI.Login
- task: DotNetCoreCLI@2
displayName: Run dotnet restore
inputs:
command: restore
projects: $(solution)
- task: DotNetCoreCLI@2
name: build
displayName: Run dotnet build and generate NuGet packages
inputs:
command: build
projects: $(solution)
arguments: '--configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg'
- task: PublishPipelineArtifact@1
displayName: Publish nupkg
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/nupkg
artifactName: nupkg
- task: PublishPipelineArtifact@1
displayName: Publish build artifacts
inputs:
targetPath: $(Build.SourcesDirectory)
artifactName: build_output
- stage: E2E
displayName: E2E Tests
dependsOn: Build
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm_e2e
# Enable console logging in Release mode
SERILOG__WRITETO__0__NAME: Async
SERILOG__WRITETO__0__ARGS__CONFIGURE__0__NAME: Console
# Set unattended install settings
UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED: true
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME: Playwright Test
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD: UmbracoAcceptance123!
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL: playwright@umbraco.com
# Custom Umbraco settings
UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP: false
UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER: true
UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE: true
UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042
UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD: 0
UMBRACO__CMS__GLOBAL__USEHTTPS: true
UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED: false
UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK: true
UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL: https://localhost:44331/
ASPNETCORE_URLS: https://localhost:44331
jobs:
# E2E Tests
- job:
displayName: E2E Tests (SQLite)
timeoutInMinutes: 180
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=Umbraco;Mode=Memory;Cache=Shared;Foreign Keys=True;Pooling=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.Sqlite
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
Windows:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download NuGet artifacts
inputs:
artifact: nupkg
path: $(Agent.BuildDirectory)/app/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
retryCountOnTaskFailure: 3
inputs:
versionSpec: $(nodeVersion)
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
# Cache and restore NPM packages
- task: Cache@2
displayName: Cache NPM packages
inputs:
key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
npm_e2e | "$(Agent.OS)"
npm_e2e
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
displayName: Restore NPM packages
# Build application
- pwsh: |
$cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
dotnet new nugetconfig
dotnet nuget add source ./nupkg --name Local
dotnet new install Umbraco.Templates::$cmsVersion
dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
displayName: Build application
workingDirectory: $(Agent.BuildDirectory)/app
# Run application
- bash: |
nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName: Run application (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
workingDirectory: $(Agent.BuildDirectory)/app
- pwsh: |
$process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName: Run application (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Ensures we have the package wait-on installed
- pwsh: npm install wait-on
displayName: Install wait-on package
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- ${{ if eq(parameters.runSmokeTests, true) }}:
pwsh: npm run smokeTestSqlite --ignore-certificate-errors
${{ else }}:
pwsh: npm run testSqlite --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
- pwsh: Stop-Process -Id $(AcceptanceTestProcessId)
displayName: Stop application (Windows)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)'
- job:
displayName: E2E Tests (SQL Server)
timeoutInMinutes: 180
variables:
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
CONNECTIONSTRINGS__UMBRACODBDSN: 'Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True'
Windows:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
steps:
# Setup test environment
- task: DownloadPipelineArtifact@2
displayName: Download NuGet artifacts
inputs:
artifact: nupkg
path: $(Agent.BuildDirectory)/app/nupkg
- task: NodeTool@0
displayName: Use Node.js $(nodeVersion)
inputs:
versionSpec: $(nodeVersion)
- task: UseDotNet@2
displayName: Use .NET SDK from global.json
inputs:
useGlobalJson: true
- pwsh: |
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
URL=$(ASPNETCORE_URLS)
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
displayName: Generate .env
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
# Cache and restore NPM packages
- task: Cache@2
displayName: Cache NPM packages
inputs:
key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
restoreKeys: |
npm_e2e | "$(Agent.OS)"
npm_e2e
path: $(npm_config_cache)
- script: npm ci --no-fund --no-audit --prefer-offline
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
displayName: Restore NPM packages
# Build application
- pwsh: |
$cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
dotnet new nugetconfig
dotnet nuget add source ./nupkg --name Local
dotnet new install Umbraco.Templates::$cmsVersion
dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
dotnet dev-certs https
displayName: Build application
workingDirectory: $(Agent.BuildDirectory)/app
# Start SQL Server
- powershell: docker run --name mssql -d -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$(SA_PASSWORD)" mcr.microsoft.com/mssql/server:2022-latest
displayName: Start SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB start MSSQLLocalDB
displayName: Start SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Run application
- bash: |
nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName: Run application (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
workingDirectory: $(Agent.BuildDirectory)/app
- pwsh: |
$process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName: Run application (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
workingDirectory: $(Agent.BuildDirectory)/app
# Ensures we have the package wait-on installed
- pwsh: npm install wait-on
displayName: Install wait-on package
# Wait for application to start responding to requests
- pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
displayName: Wait for application
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Install Playwright and dependencies
- pwsh: npx playwright install --with-deps
displayName: Install Playwright
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
# Test
- ${{ if eq(parameters.runSmokeTests, true) }}:
pwsh: npm run smokeTest --ignore-certificate-errors
${{ else }}:
pwsh: npm run test --ignore-certificate-errors
displayName: Run Playwright tests
continueOnError: true
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
# Stop application
- bash: kill -15 $(AcceptanceTestProcessId)
displayName: Stop application (Linux)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
- pwsh: Stop-Process -Id $(AcceptanceTestProcessId)
displayName: Stop application (Windows)
condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
# Stop SQL Server
- pwsh: docker stop mssql
displayName: Stop SQL Server Docker image (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh: SqlLocalDB stop MSSQLLocalDB
displayName: Stop SQL Server LocalDB (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Copy artifacts
- pwsh: |
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse
}
displayName: Copy Playwright results
condition: succeededOrFailed()
# Publish
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)'
+1 -1
View File
@@ -26,7 +26,7 @@ steps:
useSameBranch: true
waitForQueuedBuildsToFinish: false
storeInEnvironmentVariable: false
templateParameters: 'sqlServerIntegrationTests: true, sqlServerAcceptanceTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true'
templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true'
authenticationMethod: 'OAuth Token'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
+1 -1
View File
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "8.0.300",
"rollForward": "latestFeature"
}
}
@@ -10,14 +10,15 @@ public class ProcessRequestContextHandler
: IOpenIddictServerHandler<OpenIddictServerEvents.ProcessRequestContext>, IOpenIddictValidationHandler<OpenIddictValidationEvents.ProcessRequestContext>
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly string _backOfficePathSegment;
private readonly string[] _pathsToHandle;
public ProcessRequestContextHandler(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
_backOfficePathSegment = Constants.System.DefaultUmbracoPath.TrimStart(Constants.CharArrays.Tilde)
var backOfficePathSegment = Constants.System.DefaultUmbracoPath.TrimStart(Constants.CharArrays.Tilde)
.EnsureStartsWith('/')
.EnsureEndsWith('/');
_pathsToHandle = [backOfficePathSegment, "/.well-known/openid-configuration"];
}
public ValueTask HandleAsync(OpenIddictServerEvents.ProcessRequestContext context)
@@ -48,6 +49,14 @@ public class ProcessRequestContextHandler
return false;
}
return requestPath.StartsWith(_backOfficePathSegment) is false;
foreach (var path in _pathsToHandle)
{
if (requestPath.StartsWith(path))
{
return false;
}
}
return true;
}
}
@@ -46,7 +46,9 @@ public static class UmbracoBuilderAuthExtensions
Paths.BackOfficeApi.LogoutEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetRevocationEndpointUris(
Paths.MemberApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash),
Paths.BackOfficeApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash));
Paths.BackOfficeApi.RevokeEndpoint.TrimStart(Constants.CharArrays.ForwardSlash))
.SetUserinfoEndpointUris(
Paths.MemberApi.UserinfoEndpoint.TrimStart(Constants.CharArrays.ForwardSlash));
// Enable authorization code flow with PKCE
options
@@ -58,7 +60,8 @@ public static class UmbracoBuilderAuthExtensions
options
.UseAspNetCore()
.EnableAuthorizationEndpointPassthrough()
.EnableLogoutEndpointPassthrough();
.EnableLogoutEndpointPassthrough()
.EnableUserinfoEndpointPassthrough();
// Enable reference tokens
// - see https://documentation.openiddict.com/configuration/token-storage.html
@@ -31,6 +31,8 @@ public static class Paths
public static readonly string RevokeEndpoint = EndpointPath($"{EndpointTemplate}/revoke");
public static readonly string UserinfoEndpoint = EndpointPath($"{EndpointTemplate}/userinfo");
// NOTE: we're NOT using /api/v1.0/ here because it will clash with the Delivery API docs
private static string EndpointPath(string relativePath) => $"/umbraco/delivery/api/v1/{relativePath}";
}
@@ -3,7 +3,6 @@
<Title>Umbraco CMS - API Common</Title>
<Description>Contains the bits and pieces that are shared between the Umbraco CMS APIs.</Description>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
@@ -14,6 +13,12 @@
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="OpenIddict.Abstractions" />
<PackageReference Include="OpenIddict.AspNetCore" />
<!-- Both OpenIddict.AspNetCore, Npoco.SqlServer and Microsoft.EntityFrameworkCore.SqlServer bring in a vulnerable version of Microsoft.IdentityModel.JsonWebTokens -->
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens"/>
<!-- Take top-level depedendency on OpenIddict.AspNetCore depends on a vulnerable version -->
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
</ItemGroup>
<ItemGroup>
@@ -15,6 +15,7 @@ namespace Umbraco.Cms.Api.Delivery.Controllers.Content;
[ApiExplorerSettings(GroupName = "Content")]
[LocalizeFromAcceptLanguageHeader]
[ValidateStartItem]
[AddVaryHeader]
[OutputCache(PolicyName = Constants.DeliveryApi.OutputCache.ContentCachePolicy)]
public abstract class ContentApiControllerBase : DeliveryApiControllerBase
{
@@ -0,0 +1,28 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OpenIddict.Server.AspNetCore;
using Umbraco.Cms.Api.Delivery.Routing;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Controllers.Security;
[ApiVersion("1.0")]
[ApiController]
[VersionedDeliveryApiRoute(Common.Security.Paths.MemberApi.EndpointTemplate)]
[ApiExplorerSettings(IgnoreApi = true)]
[Authorize(AuthenticationSchemes = OpenIddictServerAspNetCoreDefaults.AuthenticationScheme)]
public class CurrentMemberController : DeliveryApiControllerBase
{
private readonly ICurrentMemberClaimsProvider _currentMemberClaimsProvider;
public CurrentMemberController(ICurrentMemberClaimsProvider currentMemberClaimsProvider)
=> _currentMemberClaimsProvider = currentMemberClaimsProvider;
[HttpGet("userinfo")]
public async Task<IActionResult> Userinfo()
{
Dictionary<string, object> claims = await _currentMemberClaimsProvider.GetClaimsAsync();
return Ok(claims);
}
}
@@ -159,11 +159,12 @@ public class MemberController : DeliveryApiControllerBase
claim.SetDestinations(OpenIddictConstants.Destinations.AccessToken);
}
if (request.GetScopes().Contains(OpenIddictConstants.Scopes.OfflineAccess))
{
// "offline_access" scope is required to use refresh tokens
memberPrincipal.SetScopes(OpenIddictConstants.Scopes.OfflineAccess);
}
// "openid" and "offline_access" are the only scopes allowed for members; explicitly ensure we only add those
// NOTE: the "offline_access" scope is required to use refresh tokens
IEnumerable<string> allowedScopes = request
.GetScopes()
.Intersect(new[] { OpenIddictConstants.Scopes.OpenId, OpenIddictConstants.Scopes.OfflineAccess });
memberPrincipal.SetScopes(allowedScopes);
return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, memberPrincipal);
}
@@ -60,6 +60,7 @@ public static class UmbracoBuilderExtensions
builder.Services.AddSingleton<IApiMediaQueryService, ApiMediaQueryService>();
builder.Services.AddTransient<IMemberApplicationManager, MemberApplicationManager>();
builder.Services.AddTransient<IRequestMemberAccessService, RequestMemberAccessService>();
builder.Services.AddTransient<ICurrentMemberClaimsProvider, CurrentMemberClaimsProvider>();
builder.Services.ConfigureOptions<ConfigureUmbracoDeliveryApiSwaggerGenOptions>();
builder.AddUmbracoApiOpenApiUI();
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc.Filters;
namespace Umbraco.Cms.Api.Delivery.Filters;
public sealed class AddVaryHeaderAttribute : ActionFilterAttribute
{
private const string Vary = "Accept-Language, Preview, Start-Item";
public override void OnResultExecuting(ResultExecutingContext context)
=> context.HttpContext.Response.Headers.Vary = context.HttpContext.Response.Headers.Vary.Count > 0
? $"{context.HttpContext.Response.Headers.Vary}, {Vary}"
: Vary;
}
@@ -1,56 +1,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
using Umbraco.Cms.Core.Models.DeliveryApi;
using Umbraco.Cms.Infrastructure.Serialization;
namespace Umbraco.Cms.Api.Delivery.Json;
// see https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism?pivots=dotnet-7-0
public class DeliveryApiJsonTypeResolver : DefaultJsonTypeInfoResolver
{
public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
{
JsonTypeInfo jsonTypeInfo = base.GetTypeInfo(type, options);
Type[] derivedTypes = GetDerivedTypes(jsonTypeInfo);
if (derivedTypes.Length > 0)
{
ConfigureJsonPolymorphismOptions(jsonTypeInfo, derivedTypes);
}
return jsonTypeInfo;
}
protected virtual Type[] GetDerivedTypes(JsonTypeInfo jsonTypeInfo)
{
if (jsonTypeInfo.Type == typeof(IApiContent))
{
return new[] { typeof(ApiContent) };
}
if (jsonTypeInfo.Type == typeof(IApiContentResponse))
{
return new[] { typeof(ApiContentResponse) };
}
if (jsonTypeInfo.Type == typeof(IRichTextElement))
{
return new[] { typeof(RichTextRootElement), typeof(RichTextGenericElement), typeof(RichTextTextElement) };
}
return Array.Empty<Type>();
}
protected void ConfigureJsonPolymorphismOptions(JsonTypeInfo jsonTypeInfo, params Type[] derivedTypes)
{
jsonTypeInfo.PolymorphismOptions = new JsonPolymorphismOptions
{
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization,
};
foreach (Type derivedType in derivedTypes)
{
jsonTypeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(derivedType));
}
}
}
public class DeliveryApiJsonTypeResolver : ContentJsonTypeResolverBase
{ }
@@ -0,0 +1,88 @@
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Umbraco.Cms.Core.DeliveryApi;
namespace Umbraco.Cms.Api.Delivery.Json;
public abstract class DeliveryApiVersionAwareJsonConverterBase<T> : JsonConverter<T>
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly JsonConverter<T> _defaultConverter = (JsonConverter<T>)JsonSerializerOptions.Default.GetConverter(typeof(T));
public DeliveryApiVersionAwareJsonConverterBase(IHttpContextAccessor httpContextAccessor)
=> _httpContextAccessor = httpContextAccessor;
/// <inheritdoc />
public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> _defaultConverter.Read(ref reader, typeToConvert, options);
/// <inheritdoc />
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
{
Type type = typeof(T);
var apiVersion = GetApiVersion();
// Get the properties in the specified order
PropertyInfo[] properties = type.GetProperties().OrderBy(GetPropertyOrder).ToArray();
writer.WriteStartObject();
foreach (PropertyInfo property in properties)
{
// Filter out properties based on the API version
var include = apiVersion is null || ShouldIncludeProperty(property, apiVersion.Value);
if (include is false)
{
continue;
}
var propertyName = property.Name;
writer.WritePropertyName(options.PropertyNamingPolicy?.ConvertName(propertyName) ?? propertyName);
JsonSerializer.Serialize(writer, property.GetValue(value), options);
}
writer.WriteEndObject();
}
private int? GetApiVersion()
{
HttpContext? httpContext = _httpContextAccessor.HttpContext;
ApiVersion? apiVersion = httpContext?.GetRequestedApiVersion();
return apiVersion?.MajorVersion;
}
private int GetPropertyOrder(PropertyInfo prop)
{
var attribute = prop.GetCustomAttribute<JsonPropertyOrderAttribute>();
return attribute?.Order ?? 0;
}
/// <summary>
/// Determines whether a property should be included based on version bounds.
/// </summary>
/// <param name="propertyInfo">The property info.</param>
/// <param name="version">An integer representing an API version.</param>
/// <returns><c>true</c> if the property should be included; otherwise, <c>false</c>.</returns>
private bool ShouldIncludeProperty(PropertyInfo propertyInfo, int version)
{
var attribute = propertyInfo
.GetCustomAttributes(typeof(IncludeInApiVersionAttribute), false)
.FirstOrDefault();
if (attribute is not IncludeInApiVersionAttribute apiVersionAttribute)
{
return true; // No attribute means include the property
}
// Check if the version is within the specified bounds
var isWithinMinVersion = apiVersionAttribute.MinVersion.HasValue is false || version >= apiVersionAttribute.MinVersion.Value;
var isWithinMaxVersion = apiVersionAttribute.MaxVersion.HasValue is false || version <= apiVersionAttribute.MaxVersion.Value;
return isWithinMinVersion && isWithinMaxVersion;
}
}
@@ -1,6 +1,5 @@
using Umbraco.Cms.Api.Delivery.Indexing.Filters;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Delivery.Querying.Filters;
@@ -15,15 +14,15 @@ public sealed class ContentTypeFilter : IFilterHandler
/// <inheritdoc/>
public FilterOption BuildFilterOption(string filter)
{
var alias = filter.Substring(ContentTypeSpecifier.Length);
var filterValue = filter.Substring(ContentTypeSpecifier.Length);
var negate = filterValue.StartsWith('!');
var aliases = filterValue.TrimStart('!').Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
return new FilterOption
{
FieldName = ContentTypeFilterIndexer.FieldName,
Values = alias.IsNullOrWhiteSpace() == false
? new[] { alias.TrimStart('!') }
: Array.Empty<string>(),
Operator = alias.StartsWith('!')
Values = aliases,
Operator = negate
? FilterOperation.IsNot
: FilterOperation.Is
};
@@ -1,5 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Delivery.Indexing.Selectors;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Extensions;
@@ -10,10 +12,22 @@ public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler
{
private const string AncestorsSpecifier = "ancestors:";
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly IRequestPreviewService _requestPreviewService;
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService)
: base(publishedSnapshotAccessor, requestRoutingService) =>
[Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")]
public AncestorsSelector(
IPublishedSnapshotAccessor publishedSnapshotAccessor,
IRequestRoutingService requestRoutingService)
: this(publishedSnapshotAccessor, requestRoutingService, StaticServiceProvider.Instance.GetRequiredService<IRequestPreviewService>())
{
}
public AncestorsSelector(IPublishedSnapshotAccessor publishedSnapshotAccessor, IRequestRoutingService requestRoutingService, IRequestPreviewService requestPreviewService)
: base(publishedSnapshotAccessor, requestRoutingService)
{
_publishedSnapshotAccessor = publishedSnapshotAccessor;
_requestPreviewService = requestPreviewService;
}
/// <inheritdoc />
public bool CanHandle(string query)
@@ -37,10 +51,20 @@ public sealed class AncestorsSelector : QueryOptionBase, ISelectorHandler
};
}
IPublishedSnapshot publishedSnapshot = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot();
IPublishedContentCache contentCache = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot()?.Content
?? throw new InvalidOperationException("Could not obtain the content cache");
IPublishedContent contentItem = publishedSnapshot.Content?.GetById((Guid)id)
?? throw new InvalidOperationException("Could not obtain the content cache");
IPublishedContent? contentItem = contentCache.GetById(_requestPreviewService.IsPreview(), id.Value);
if (contentItem is null)
{
// no such content item, make sure the selector does not yield any results
return new SelectorOption
{
FieldName = AncestorsSelectorIndexer.FieldName,
Values = Array.Empty<string>()
};
}
var ancestorKeys = contentItem.Ancestors().Select(a => a.Key.ToString("D")).ToArray();
@@ -0,0 +1,44 @@
using OpenIddict.Abstractions;
using Umbraco.Cms.Core.DeliveryApi;
using Umbraco.Cms.Core.Security;
namespace Umbraco.Cms.Api.Delivery.Services;
// NOTE: this is public and unsealed to allow overriding the default claims with minimal effort.
public class CurrentMemberClaimsProvider : ICurrentMemberClaimsProvider
{
private readonly IMemberManager _memberManager;
public CurrentMemberClaimsProvider(IMemberManager memberManager)
=> _memberManager = memberManager;
public virtual async Task<Dictionary<string, object>> GetClaimsAsync()
{
MemberIdentityUser? memberIdentityUser = await _memberManager.GetCurrentMemberAsync();
return memberIdentityUser is not null
? await GetClaimsForMemberIdentityAsync(memberIdentityUser)
: throw new InvalidOperationException("Could not retrieve the current member. This method should only ever be invoked when a member has been authorized.");
}
protected virtual async Task<Dictionary<string, object>> GetClaimsForMemberIdentityAsync(MemberIdentityUser memberIdentityUser)
{
var claims = new Dictionary<string, object>
{
[OpenIddictConstants.Claims.Subject] = memberIdentityUser.Key
};
if (memberIdentityUser.Name is not null)
{
claims[OpenIddictConstants.Claims.Name] = memberIdentityUser.Name;
}
if (memberIdentityUser.Email is not null)
{
claims[OpenIddictConstants.Claims.Email] = memberIdentityUser.Email;
}
claims[OpenIddictConstants.Claims.Role] = await _memberManager.GetRolesAsync(memberIdentityUser);
return claims;
}
}
@@ -42,31 +42,42 @@ internal sealed class RequestRedirectService : RoutingServiceBase, IRequestRedir
{
requestedPath = requestedPath.EnsureStartsWith("/");
IPublishedContent? startItem = GetStartItem();
// must append the root content url segment if it is not hidden by config, because
// the URL tracking is based on the actual URL, including the root content url segment
if (_globalSettings.HideTopLevelNodeFromPath == false)
if (_globalSettings.HideTopLevelNodeFromPath == false && startItem?.UrlSegment != null)
{
IPublishedContent? startItem = GetStartItem();
if (startItem?.UrlSegment != null)
{
requestedPath = $"{startItem.UrlSegment.EnsureStartsWith("/")}{requestedPath}";
}
requestedPath = $"{startItem.UrlSegment.EnsureStartsWith("/")}{requestedPath}";
}
var culture = _requestCultureService.GetRequestedCulture();
// append the configured domain content ID to the path if we have a domain bound request,
// because URL tracking registers the tracked url like "{domain content ID}/{content path}"
Uri contentRoute = GetDefaultRequestUri(requestedPath);
DomainAndUri? domainAndUri = GetDomainAndUriForRoute(contentRoute);
if (domainAndUri != null)
// important: redirect URLs are always tracked without trailing slashes
requestedPath = requestedPath.TrimEnd("/");
IRedirectUrl? redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(requestedPath, culture);
// if a redirect URL was not found, try by appending the start item ID because URL tracking might have tracked
// a redirect with "{root content ID}/{content path}"
if (redirectUrl is null && startItem is not null)
{
requestedPath = GetContentRoute(domainAndUri, contentRoute);
culture ??= domainAndUri.Culture;
redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl($"{startItem.Id}{requestedPath}", culture);
}
// still no redirect URL found - try looking for a configured domain if we have a domain bound request,
// because URL tracking might have tracked a redirect with "{domain content ID}/{content path}"
if (redirectUrl is null)
{
Uri contentRoute = GetDefaultRequestUri(requestedPath);
DomainAndUri? domainAndUri = GetDomainAndUriForRoute(contentRoute);
if (domainAndUri is not null)
{
requestedPath = GetContentRoute(domainAndUri, contentRoute);
culture ??= domainAndUri.Culture;
redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(requestedPath, culture);
}
}
// important: redirect URLs are always tracked without trailing slashes
IRedirectUrl? redirectUrl = _redirectUrlService.GetMostRecentRedirectUrl(requestedPath.TrimEnd("/"), culture);
IPublishedContent? content = redirectUrl != null
? _apiPublishedContentCache.GetById(redirectUrl.ContentKey)
: null;
@@ -3,7 +3,11 @@
<Title>Umbraco CMS - Delivery API</Title>
<Description>Contains the presentation layer for the Umbraco CMS Delivery API.</Description>
</PropertyGroup>
<PropertyGroup>
<!-- TODO: [ASP0019] use IHeaderDictionary.Append or the indexer to append or set headers,
and remove this override -->
<WarningsNotAsErrors>ASP0019</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Content;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Models.ContentEditing.Validation;
using Umbraco.Cms.Core.Services.OperationStatus;
@@ -9,6 +11,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Content;
public abstract class ContentControllerBase : ManagementApiControllerBase
{
protected IActionResult ContentEditingOperationStatusResult(ContentEditingOperationStatus status)
=> OperationStatusResult(status, problemDetailsBuilder => status switch
{
@@ -96,7 +99,8 @@ public abstract class ContentControllerBase : ManagementApiControllerBase
}
var errors = new SortedDictionary<string, string[]>();
var missingPropertyAliases = new List<string>();
var missingPropertyModels = new List<PropertyValidationResponseModel>();
foreach (PropertyValidationError validationError in validationResult.ValidationErrors)
{
TValueModel? requestValue = requestModel.Values.FirstOrDefault(value =>
@@ -105,7 +109,7 @@ public abstract class ContentControllerBase : ManagementApiControllerBase
&& value.Segment == validationError.Segment);
if (requestValue is null)
{
missingPropertyAliases.Add(validationError.Alias);
missingPropertyModels.Add(MapMissingProperty(validationError));
continue;
}
@@ -119,7 +123,16 @@ public abstract class ContentControllerBase : ManagementApiControllerBase
.WithTitle("Validation failed")
.WithDetail("One or more properties did not pass validation")
.WithRequestModelErrors(errors)
.WithExtension("missingProperties", missingPropertyAliases.ToArray())
.WithExtension("missingValues", missingPropertyModels.ToArray())
.Build()));
}
private PropertyValidationResponseModel MapMissingProperty(PropertyValidationError source) =>
new()
{
Alias = source.Alias,
Segment = source.Segment,
Culture = source.Culture,
Messages = source.ErrorMessages,
};
}
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
@@ -7,10 +8,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class CopyDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -8,10 +9,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class CreateDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[VersionedApiBackOfficeRoute(Constants.UdiEntityType.DataType)]
[ApiExplorerSettings(GroupName = "Data Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentsOrDocumentTypes)]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentOrMediaOrContentTypes)]
public abstract class DataTypeControllerBase : ManagementApiControllerBase
{
protected IActionResult DataTypeOperationStatusResult(DataTypeOperationStatus status) =>
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
@@ -6,10 +7,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class DeleteDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DataType;
@@ -7,10 +8,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class MoveDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -8,10 +9,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DataType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDataTypes)]
public class UpdateDataTypeController : DataTypeControllerBase
{
private readonly IDataTypeService _dataTypeService;
@@ -18,18 +18,21 @@ public abstract class CreateDocumentControllerBase : DocumentControllerBase
protected async Task<IActionResult> HandleRequest(CreateDocumentRequestModel requestModel, Func<Task<IActionResult>> authorizedHandler)
{
IEnumerable<string> cultures = requestModel.Variants
.Where(v => v.Culture is not null)
.Select(v => v.Culture!);
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionNew.ActionLetter, requestModel.Parent?.Id, cultures),
AuthorizationPolicies.ContentPermissionByResource);
// TODO This have temporarily been uncommented, to support the client sends values from all cultures, even when the user do not have access to the languages.
// The values are ignored in the ContentEditingService
if (!authorizationResult.Succeeded)
{
return Forbidden();
}
// IEnumerable<string> cultures = requestModel.Variants
// .Where(v => v.Culture is not null)
// .Select(v => v.Culture!);
// AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
// User,
// ContentPermissionResource.WithKeys(ActionNew.ActionLetter, requestModel.Parent?.Id, cultures),
// AuthorizationPolicies.ContentPermissionByResource);
//
// if (!authorizationResult.Succeeded)
// {
// return Forbidden();
// }
return await authorizedHandler();
}
@@ -39,7 +39,7 @@ public class GetAuditLogDocumentController : DocumentControllerBase
{
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionProtect.ActionLetter, id),
ContentPermissionResource.WithKeys(ActionBrowse.ActionLetter, id),
AuthorizationPolicies.ContentPermissionByResource);
if (!authorizationResult.Succeeded)
@@ -21,16 +21,21 @@ public class SearchDocumentItemController : DocumentItemControllerBase
_documentPresentationFactory = documentPresentationFactory;
}
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> await SearchFromParent(cancellationToken, query, skip, take);
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<DocumentItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
{
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Document, query, skip, take);
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Document, query, parentId, skip, take);
var result = new PagedModel<DocumentItemResponseModel>
{
Items = searchResult.Items.OfType<IDocumentEntitySlim>().Select(_documentPresentationFactory.CreateItemResponseModel),
Total = searchResult.Total
Total = searchResult.Total,
};
return await Task.FromResult(Ok(result));
@@ -17,18 +17,21 @@ public abstract class UpdateDocumentControllerBase : DocumentControllerBase
protected async Task<IActionResult> HandleRequest(Guid id, UpdateDocumentRequestModel requestModel, Func<Task<IActionResult>> authorizedHandler)
{
IEnumerable<string> cultures = requestModel.Variants
.Where(v => v.Culture is not null)
.Select(v => v.Culture!);
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
User,
ContentPermissionResource.WithKeys(ActionUpdate.ActionLetter, id, cultures),
AuthorizationPolicies.ContentPermissionByResource);
// TODO This have temporarily been uncommented, to support the client sends values from all cultures, even when the user do not have access to the languages.
// The values are ignored in the ContentEditingService
if (!authorizationResult.Succeeded)
{
return Forbidden();
}
// IEnumerable<string> cultures = requestModel.Variants
// .Where(v => v.Culture is not null)
// .Select(v => v.Culture!);
// AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
// User,
// ContentPermissionResource.WithKeys(ActionUpdate.ActionLetter, id, cultures),
// AuthorizationPolicies.ContentPermissionByResource);
//
// if (!authorizationResult.Succeeded)
// {
// return Forbidden();
// }
return await authorizedHandler();
}
@@ -66,6 +66,10 @@ public class UpdateDomainsController : DocumentControllerBase
.WithDetail("One or more of the specified domain names were conflicting with domain assignments to other content items.")
.WithExtension("conflictingDomainNames", _domainPresentationFactory.CreateDomainAssignmentModels(result.Result.ConflictingDomains.EmptyNull()))
.Build()),
DomainOperationStatus.InvalidDomainName => BadRequest(problemDetailsBuilder
.WithTitle("Invalid domain name detected")
.WithDetail("One or more of the specified domain names were invalid.")
.Build()),
_ => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
.WithTitle("Unknown domain update operation status.")
.Build()),
@@ -2,9 +2,12 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Features;
using Umbraco.Cms.Web.Common.Authorization;
@@ -14,18 +17,31 @@ namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ConfigurationDocumentTypeController : DocumentTypeControllerBase
{
private readonly UmbracoFeatures _umbracoFeatures;
private readonly DataTypesSettings _dataTypesSettings;
private readonly SegmentSettings _segmentSettings;
private readonly IConfigurationPresentationFactory _configurationPresentationFactory;
[ActivatorUtilitiesConstructor]
public ConfigurationDocumentTypeController(IConfigurationPresentationFactory configurationPresentationFactory)
{
_configurationPresentationFactory = configurationPresentationFactory;
}
[Obsolete("Use the constructor that only accepts IConfigurationPresentationFactory, scheduled for removal in V16")]
public ConfigurationDocumentTypeController(
UmbracoFeatures umbracoFeatures,
IOptionsSnapshot<DataTypesSettings> dataTypesSettings,
IOptionsSnapshot<SegmentSettings> segmentSettings,
IConfigurationPresentationFactory configurationPresentationFactory)
: this(configurationPresentationFactory)
{
}
[Obsolete("Use the constructor that only accepts IConfigurationPresentationFactory, scheduled for removal in V16")]
public ConfigurationDocumentTypeController(
UmbracoFeatures umbracoFeatures,
IOptionsSnapshot<DataTypesSettings> dataTypesSettings,
IOptionsSnapshot<SegmentSettings> segmentSettings)
: this(StaticServiceProvider.Instance.GetRequiredService<IConfigurationPresentationFactory>())
{
_umbracoFeatures = umbracoFeatures;
_dataTypesSettings = dataTypesSettings.Value;
_segmentSettings = segmentSettings.Value;
}
[HttpGet("configuration")]
@@ -33,12 +49,7 @@ public class ConfigurationDocumentTypeController : DocumentTypeControllerBase
[ProducesResponseType(typeof(DocumentTypeConfigurationResponseModel), StatusCodes.Status200OK)]
public Task<IActionResult> Configuration(CancellationToken cancellationToken)
{
var responseModel = new DocumentTypeConfigurationResponseModel
{
DataTypesCanBeChanged = _dataTypesSettings.CanBeChanged,
DisableTemplates = _umbracoFeatures.Disabled.DisableTemplates,
UseSegments = _segmentSettings.Enabled,
};
DocumentTypeConfigurationResponseModel responseModel = _configurationPresentationFactory.CreateDocumentTypeConfigurationResponseModel();
return Task.FromResult<IActionResult>(Ok(responseModel));
}
@@ -98,6 +98,18 @@ public abstract class DocumentTypeControllerBase : ManagementApiControllerBase
.WithTitle("Name was too long")
.WithDetail("Name cannot be more than 255 characters in length.")
.Build()),
ContentTypeOperationStatus.InvalidElementFlagDocumentHasContent => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle("Invalid IsElement flag")
.WithDetail("Cannot change to element type because content has already been created with this document type.")
.Build()),
ContentTypeOperationStatus.InvalidElementFlagElementIsUsedInPropertyEditorConfiguration => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle("Invalid IsElement flag")
.WithDetail("Cannot change to document type because this element type is used in the configuration of a data type.")
.Build()),
ContentTypeOperationStatus.InvalidElementFlagComparedToParent => new BadRequestObjectResult(problemDetailsBuilder
.WithTitle("Invalid IsElement flag")
.WithDetail("Can not create a documentType with inheritance composition where the parent and the new type's IsElement flag are different.")
.Build()),
_ => new ObjectResult("Unknown content type operation status") { StatusCode = StatusCodes.Status500InternalServerError },
});
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ExportDocumentTypeController : DocumentTypeControllerBase
{
private readonly IContentTypeService _contentTypeService;
@@ -1,17 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ImportExistingDocumentTypeController : DocumentTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,17 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.DocumentType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessDocumentTypes)]
public class ImportNewDocumentTypeController : DocumentTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,4 +1,4 @@
using Asp.Versioning;
using Asp.Versioning;
using Examine;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -38,7 +38,7 @@ public class RebuildIndexerController : IndexerControllerBase
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Rebuild(CancellationToken cancellationToken, string indexName)
{
if (!_examineManager.TryGetIndex(indexName, out var index))
if (!_examineManager.TryGetIndex(indexName, out IIndex? index))
{
var invalidModelProblem = new ProblemDetails
{
@@ -46,6 +46,6 @@ public class CreateMediaController : CreateMediaControllerBase
return result.Success
? CreatedAtId<ByKeyMediaController>(controller => nameof(controller.ByKey), result.Result.Content!.Key)
: ContentEditingOperationStatusResult(result.Status);
: MediaEditingOperationStatusResult(result.Status, requestModel, result.Result.ValidationResult);
});
}
@@ -21,16 +21,21 @@ public class SearchMediaItemController : MediaItemControllerBase
_mediaPresentationFactory = mediaPresentationFactory;
}
[NonAction]
[Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
=> await SearchFromParent(cancellationToken, query, skip, take, null);
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<MediaItemResponseModel>), StatusCodes.Status200OK)]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
public async Task<IActionResult> SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null)
{
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Media, query, skip, take);
PagedModel<IEntitySlim> searchResult = _indexedEntitySearchService.Search(UmbracoObjectTypes.Media, query, parentId, skip, take);
var result = new PagedModel<MediaItemResponseModel>
{
Items = searchResult.Items.OfType<IMediaEntitySlim>().Select(_mediaPresentationFactory.CreateItemResponseModel),
Total = searchResult.Total
Total = searchResult.Total,
};
return await Task.FromResult(Ok(result));
@@ -0,0 +1,31 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ConfigurationMediaTypeController : MediaTypeControllerBase
{
private readonly IConfigurationPresentationFactory _configurationPresentationFactory;
public ConfigurationMediaTypeController(IConfigurationPresentationFactory configurationPresentationFactory)
{
_configurationPresentationFactory = configurationPresentationFactory;
}
[HttpGet("configuration")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(MediaTypeConfigurationResponseModel), StatusCodes.Status200OK)]
public Task<IActionResult> Configuration(CancellationToken cancellationToken)
{
MediaTypeConfigurationResponseModel responseModel = _configurationPresentationFactory.CreateMediaTypeConfigurationResponseModel();
return Task.FromResult<IActionResult>(Ok(responseModel));
}
}
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ExportMediaTypeController : MediaTypeControllerBase
{
private readonly IMediaTypeService _mediaTypeService;
@@ -1,17 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ImportExistingMediaTypeController : MediaTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,18 +1,19 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Controllers.DocumentType;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ImportExport;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MediaType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMediaTypes)]
public class ImportNewMediaTypeController : MediaTypeControllerBase
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
@@ -1,9 +1,8 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Controllers.DocumentType;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services.ContentTypeEditing;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class AvailableCompositionMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeEditingService _memberTypeEditingService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
@@ -6,10 +7,12 @@ using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class CompositionReferenceMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeService _memberTypeService;
@@ -0,0 +1,31 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class ConfigurationMemberTypeController : MemberTypeControllerBase
{
private readonly IConfigurationPresentationFactory _configurationPresentationFactory;
public ConfigurationMemberTypeController(IConfigurationPresentationFactory configurationPresentationFactory)
{
_configurationPresentationFactory = configurationPresentationFactory;
}
[HttpGet("configuration")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(MemberTypeConfigurationResponseModel), StatusCodes.Status200OK)]
public Task<IActionResult> Configuration(CancellationToken cancellationToken)
{
MemberTypeConfigurationResponseModel responseModel = _configurationPresentationFactory.CreateMemberTypeConfigurationResponseModel();
return Task.FromResult<IActionResult>(Ok(responseModel));
}
}
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class CopyMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeService _memberTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -9,10 +10,12 @@ using Umbraco.Cms.Core.Models.ContentTypeEditing;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services.ContentTypeEditing;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class CreateMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeEditingPresentationFactory _memberTypeEditingPresentationFactory;
@@ -1,13 +1,16 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class DeleteMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeService _memberTypeService;
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[VersionedApiBackOfficeRoute(Constants.UdiEntityType.MemberType)]
[ApiExplorerSettings(GroupName = "Member Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)]
public abstract class MemberTypeControllerBase : ManagementApiControllerBase
{
protected IActionResult OperationStatusResult(ContentTypeOperationStatus status)
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.MemberType.Tree;
[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberType}")]
[ApiExplorerSettings(GroupName = "Member Type")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)]
public class MemberTypeTreeControllerBase : NamedEntityTreeControllerBase<MemberTypeTreeItemResponseModel>
{
private readonly IMemberTypeService _memberTypeService;
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -10,10 +11,12 @@ using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.ContentTypeEditing;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.MemberType;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessMemberTypes)]
public class UpdateMemberTypeController : MemberTypeControllerBase
{
private readonly IMemberTypeEditingPresentationFactory _memberTypeEditingPresentationFactory;
@@ -1,8 +1,9 @@
using System;
using System;
using System.Threading.Tasks;
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Infrastructure.ModelsBuilder;
@@ -16,12 +17,13 @@ public class BuildModelsBuilderController : ModelsBuilderControllerBase
{
private ModelsBuilderSettings _modelsBuilderSettings;
private readonly ModelsGenerationError _mbErrors;
private readonly ModelsGenerator _modelGenerator;
private readonly IModelsGenerator _modelGenerator;
[ActivatorUtilitiesConstructor]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
ModelsGenerator modelGenerator)
IModelsGenerator modelGenerator)
{
_mbErrors = mbErrors;
_modelGenerator = modelGenerator;
@@ -30,6 +32,26 @@ public class BuildModelsBuilderController : ModelsBuilderControllerBase
modelsBuilderSettings.OnChange(x => _modelsBuilderSettings = x);
}
[Obsolete("Please use the constructor that accepts IModelsGenerator only. Will be removed in V16.")]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
ModelsGenerator modelGenerator)
: this(modelsBuilderSettings, mbErrors, (IModelsGenerator)modelGenerator)
{
}
// this constructor is required for the DI, otherwise it'll throw an "Ambiguous Constructor" errors at boot time.
[Obsolete("Please use the constructor that accepts IModelsGenerator only. Will be removed in V16.")]
public BuildModelsBuilderController(
IOptionsMonitor<ModelsBuilderSettings> modelsBuilderSettings,
ModelsGenerationError mbErrors,
IModelsGenerator modelGenerator,
ModelsGenerator notUsed)
: this(modelsBuilderSettings, mbErrors, modelGenerator)
{
}
[HttpPost("build")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
@@ -23,7 +23,7 @@ public class ByPathPartialViewController : PartialViewControllerBase
_mapper = mapper;
}
[HttpGet("{path}")]
[HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PartialViewResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
@@ -22,7 +22,7 @@ public class DeletePartialViewController : PartialViewControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpDelete("{path}")]
[HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -22,7 +22,7 @@ public class ByPathPartialViewFolderController : PartialViewFolderControllerBase
_mapper = mapper;
}
[HttpGet("{path}")]
[HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PartialViewFolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
@@ -15,7 +15,7 @@ public class DeletePartialViewFolderController : PartialViewFolderControllerBase
public DeletePartialViewFolderController(IPartialViewFolderService partialViewFolderService)
=> _partialViewFolderService = partialViewFolderService;
[HttpDelete("{path}")]
[HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -29,7 +29,7 @@ public class UpdatePartialViewController : PartialViewControllerBase
_mapper = mapper;
}
[HttpPut("{path}")]
[HttpPut("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -23,7 +23,7 @@ public class ByPathScriptController : ScriptControllerBase
_mapper = mapper;
}
[HttpGet("{path}")]
[HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ScriptResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
@@ -22,7 +22,7 @@ public class DeleteScriptController : ScriptControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpDelete("{path}")]
[HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -22,7 +22,7 @@ public class ByPathScriptFolderController : ScriptFolderControllerBase
_mapper = mapper;
}
[HttpGet("{path}")]
[HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(ScriptFolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
@@ -15,7 +15,7 @@ public class DeleteScriptFolderController : ScriptFolderControllerBase
public DeleteScriptFolderController(IScriptFolderService scriptFolderService)
=> _scriptFolderService = scriptFolderService;
[HttpDelete("{path}")]
[HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -29,7 +29,7 @@ public class UpdateScriptController : ScriptControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPut("{path}")]
[HttpPut("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -1,4 +1,4 @@
using System.Security.Claims;
using System.Security.Claims;
using Asp.Versioning;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication;
@@ -34,6 +34,8 @@ namespace Umbraco.Cms.Api.Management.Controllers.Security;
[ApiExplorerSettings(IgnoreApi = true)]
public class BackOfficeController : SecurityControllerBase
{
private static long? _loginDurationAverage;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBackOfficeSignInManager _backOfficeSignInManager;
private readonly IBackOfficeUserManager _backOfficeUserManager;
@@ -72,45 +74,65 @@ public class BackOfficeController : SecurityControllerBase
[Authorize(Policy = AuthorizationPolicies.DenyLocalLoginIfConfigured)]
public async Task<IActionResult> Login(CancellationToken cancellationToken, LoginRequestModel model)
{
IdentitySignInResult result = await _backOfficeSignInManager.PasswordSignInAsync(
model.Username, model.Password, true, true);
// Start a timed scope to ensure failed responses return is a consistent time
var loginDuration = Math.Max(_loginDurationAverage ?? _securitySettings.Value.UserDefaultFailedLoginDurationInMilliseconds, _securitySettings.Value.UserMinimumFailedLoginDurationInMilliseconds);
await using var timedScope = new TimedScope(loginDuration, cancellationToken);
if (result.IsNotAllowed)
IdentitySignInResult result = await _backOfficeSignInManager.PasswordSignInAsync(model.Username, model.Password, true, true);
if (result.Succeeded is false)
{
return StatusCode(StatusCodes.Status403Forbidden, new ProblemDetailsBuilder()
.WithTitle("User is not allowed")
.WithDetail("The operation is not allowed on the user")
.Build());
}
if (result.IsLockedOut)
{
return StatusCode(StatusCodes.Status403Forbidden, new ProblemDetailsBuilder()
.WithTitle("User is locked")
.WithDetail("The user is locked, and need to be unlocked before more login attempts can be executed.")
.Build());
}
if(result.RequiresTwoFactor)
{
string? twofactorView = _backOfficeTwoFactorOptions.GetTwoFactorView(model.Username);
BackOfficeIdentityUser? attemptingUser = await _backOfficeUserManager.FindByNameAsync(model.Username);
IEnumerable<string> enabledProviders = (await _userTwoFactorLoginService.GetProviderNamesAsync(attemptingUser!.Key)).Result.Where(x=>x.IsEnabledOnUser).Select(x=>x.ProviderName);
return StatusCode(StatusCodes.Status402PaymentRequired, new RequiresTwoFactorResponseModel()
// TODO: The result should include the user and whether the credentials were valid to avoid these additional checks
BackOfficeIdentityUser? user = await _backOfficeUserManager.FindByNameAsync(model.Username.Trim()); // Align with UmbracoSignInManager and trim username!
if (user is not null &&
await _backOfficeUserManager.CheckPasswordAsync(user, model.Password))
{
TwoFactorLoginView = twofactorView,
EnabledTwoFactorProviderNames = enabledProviders
});
// The credentials were correct, so cancel timed scope and provide a more detailed failure response
await timedScope.CancelAsync();
if (result.IsNotAllowed)
{
return StatusCode(StatusCodes.Status403Forbidden, new ProblemDetailsBuilder()
.WithTitle("User is not allowed")
.WithDetail("The operation is not allowed on the user")
.Build());
}
if (result.IsLockedOut)
{
return StatusCode(StatusCodes.Status403Forbidden, new ProblemDetailsBuilder()
.WithTitle("User is locked")
.WithDetail("The user is locked, and need to be unlocked before more login attempts can be executed.")
.Build());
}
if (result.RequiresTwoFactor)
{
string? twofactorView = _backOfficeTwoFactorOptions.GetTwoFactorView(model.Username);
IEnumerable<string> enabledProviders = (await _userTwoFactorLoginService.GetProviderNamesAsync(user.Key)).Result.Where(x => x.IsEnabledOnUser).Select(x => x.ProviderName);
return StatusCode(StatusCodes.Status402PaymentRequired, new RequiresTwoFactorResponseModel()
{
TwoFactorLoginView = twofactorView,
EnabledTwoFactorProviderNames = enabledProviders
});
}
}
return StatusCode(StatusCodes.Status401Unauthorized, new ProblemDetailsBuilder()
.WithTitle("Invalid credentials")
.WithDetail("The provided credentials are invalid. User has not been signed in.")
.Build());
}
if (result.Succeeded)
{
return Ok();
}
return StatusCode(StatusCodes.Status401Unauthorized, new ProblemDetailsBuilder()
.WithTitle("Invalid credentials")
.WithDetail("The provided credentials are invalid. User has not been signed in.")
.Build());
// Set initial or update average (successful) login duration
_loginDurationAverage = _loginDurationAverage is long average
? (average + (long)timedScope.Elapsed.TotalMilliseconds) / 2
: (long)timedScope.Elapsed.TotalMilliseconds;
// Cancel the timed scope (we don't want to unnecessarily wait on a successful response)
await timedScope.CancelAsync();
return Ok();
}
[AllowAnonymous]
@@ -185,12 +207,17 @@ public class BackOfficeController : SecurityControllerBase
[MapToApiVersion("1.0")]
public async Task<IActionResult> Signout(CancellationToken cancellationToken)
{
var userName = await GetUserNameFromAuthCookie();
AuthenticateResult cookieAuthResult = await HttpContext.AuthenticateAsync(Constants.Security.BackOfficeAuthenticationType);
var userName = cookieAuthResult.Principal?.Identity?.Name;
var userId = cookieAuthResult.Principal?.Identity?.GetUserId();
await _backOfficeSignInManager.SignOutAsync();
_backOfficeUserManager.NotifyLogoutSuccess(cookieAuthResult.Principal ?? User, userId);
_logger.LogInformation("User {UserName} from IP address {RemoteIpAddress} has logged out",
userName ?? "UNKNOWN", HttpContext.Connection.RemoteIpAddress);
_logger.LogInformation(
"User {UserName} from IP address {RemoteIpAddress} has logged out",
userName ?? "UNKNOWN",
HttpContext.Connection.RemoteIpAddress);
// Returning a SignOutResult will ask OpenIddict to redirect the user agent
// to the post_logout_redirect_uri specified by the client application.
@@ -217,7 +244,7 @@ public class BackOfficeController : SecurityControllerBase
/// <summary>
/// Called when a user links an external login provider in the back office
/// </summary>
/// <param name="provider"></param>
/// <param name="requestModel"></param>
/// <returns></returns>
// This method is marked as AllowAnonymous and protected with a secret (linkKey) inside the model for the following reasons
// - when a js client uses the fetch api (or old ajax requests) they can send a bearer token
@@ -1,19 +1,37 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Security;
public class BackOfficeDefaultController : Controller
{
private readonly IRuntime _umbracoRuntime;
[ActivatorUtilitiesConstructor]
public BackOfficeDefaultController(IRuntime umbracoRuntime)
=> _umbracoRuntime = umbracoRuntime;
[Obsolete("Use the non obsoleted constructor instead. Scheduled to be removed in v17")]
public BackOfficeDefaultController()
: this(StaticServiceProvider.Instance.GetRequiredService<IRuntime>())
{
}
[HttpGet]
[AllowAnonymous]
public async Task<IActionResult> Index(CancellationToken cancellationToken)
{
// force authentication to occur since this is not an authorized endpoint
AuthenticateResult result = await this.AuthenticateBackOfficeAsync();
// a user can not be authenticated if no users have been created yet, or the user repository is unavailable
AuthenticateResult result = _umbracoRuntime.State.Level < RuntimeLevel.Upgrade
? AuthenticateResult.Fail("RuntimeLevel " + _umbracoRuntime.State.Level + " does not support authentication")
: await this.AuthenticateBackOfficeAsync();
// if we are not authenticated then we need to redirect to the login page
if (!result.Succeeded)
@@ -1,9 +1,11 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Management.ViewModels.Server;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
namespace Umbraco.Cms.Api.Management.Controllers.Server;
@@ -11,8 +13,20 @@ namespace Umbraco.Cms.Api.Management.Controllers.Server;
public class ConfigurationServerController : ServerControllerBase
{
private readonly SecuritySettings _securitySettings;
private readonly GlobalSettings _globalSettings;
public ConfigurationServerController(IOptions<SecuritySettings> securitySettings) => _securitySettings = securitySettings.Value;
[Obsolete("Use the constructor that accepts all arguments. Will be removed in V16.")]
public ConfigurationServerController(IOptions<SecuritySettings> securitySettings)
: this(securitySettings, StaticServiceProvider.Instance.GetRequiredService<IOptions<GlobalSettings>>())
{
}
[ActivatorUtilitiesConstructor]
public ConfigurationServerController(IOptions<SecuritySettings> securitySettings, IOptions<GlobalSettings> globalSettings)
{
_securitySettings = securitySettings.Value;
_globalSettings = globalSettings.Value;
}
[HttpGet("configuration")]
[MapToApiVersion("1.0")]
@@ -22,6 +36,7 @@ public class ConfigurationServerController : ServerControllerBase
var responseModel = new ServerConfigurationResponseModel
{
AllowPasswordReset = _securitySettings.AllowPasswordReset,
VersionCheckPeriod = _globalSettings.VersionCheckPeriod
};
return Task.FromResult<IActionResult>(Ok(responseModel));
@@ -0,0 +1,45 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.ViewModels.Server;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Extensions;
namespace Umbraco.Cms.Api.Management.Controllers.Server;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.RequireAdminAccess)]
public class UpgradeCheckServerController : ServerControllerBase
{
private readonly IUpgradeService _upgradeService;
private readonly IUmbracoVersion _umbracoVersion;
public UpgradeCheckServerController(IUpgradeService upgradeService, IUmbracoVersion umbracoVersion)
{
_upgradeService = upgradeService;
_umbracoVersion = umbracoVersion;
}
[HttpGet("upgrade-check")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(UpgradeCheckResponseModel), StatusCodes.Status200OK)]
public async Task<IActionResult> UpgradeCheck(CancellationToken cancellationToken)
{
UpgradeResult upgradeResult = await _upgradeService.CheckUpgrade(_umbracoVersion.SemanticVersion);
var responseModel = new UpgradeCheckResponseModel
{
Type = upgradeResult.UpgradeType,
Comment = upgradeResult.Comment,
Url = upgradeResult.UpgradeUrl.IsNullOrWhiteSpace()
? string.Empty
: $"{upgradeResult.UpgradeUrl}?version={_umbracoVersion.Version.ToString(3)}"
};
return Ok(responseModel);
}
}
@@ -23,7 +23,7 @@ public class ByPathStylesheetController : StylesheetControllerBase
_umbracoMapper = umbracoMapper;
}
[HttpGet("{path}")]
[HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(StylesheetResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Extensions;
@@ -9,10 +10,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessStylesheets)]
public class CreateStylesheetController : StylesheetControllerBase
{
private readonly IStylesheetService _stylesheetService;
@@ -1,14 +1,17 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Extensions;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessStylesheets)]
public class DeleteStylesheetController : StylesheetControllerBase
{
private readonly IStylesheetService _stylesheetService;
@@ -22,7 +25,7 @@ public class DeleteStylesheetController : StylesheetControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpDelete("{path}")]
[HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -24,7 +24,7 @@ public class ByPathStylesheetFolderController : StylesheetFolderControllerBase
_mapper = mapper;
}
[HttpGet("{path}")]
[HttpGet("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(StylesheetFolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
@@ -15,7 +15,7 @@ public class DeleteStylesheetFolderController : StylesheetFolderControllerBase
public DeleteStylesheetFolderController(IStylesheetFolderService stylesheetFolderService)
=> _stylesheetFolderService = stylesheetFolderService;
[HttpDelete("{path}")]
[HttpDelete("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Extensions;
@@ -9,10 +10,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessStylesheets)]
public class RenameStylesheetController : StylesheetControllerBase
{
private readonly IStylesheetService _stylesheetService;
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet;
[VersionedApiBackOfficeRoute($"{Constants.UdiEntityType.Stylesheet}")]
[ApiExplorerSettings(GroupName = "Stylesheet")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessStylesheets)]
[Authorize(Policy = AuthorizationPolicies.TreeAccessStylesheetsOrDocumentOrMediaOrMember)]
public class StylesheetControllerBase : FileSystemManagementControllerBase
{
protected IActionResult StylesheetOperationStatusResult(StylesheetOperationStatus status) =>
@@ -1,4 +1,5 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Extensions;
@@ -9,10 +10,12 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessStylesheets)]
public class UpdateStylesheetController : StylesheetControllerBase
{
private readonly IStylesheetService _stylesheetService;
@@ -29,7 +32,7 @@ public class UpdateStylesheetController : StylesheetControllerBase
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
}
[HttpPut("{path}")]
[HttpPut("{*path}")]
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Management.Routing;
@@ -17,6 +17,9 @@ public abstract class TemporaryFileControllerBase : ManagementApiControllerBase
.WithTitle("File extension not allowed")
.WithDetail("The file extension is not allowed.")
.Build()),
TemporaryFileOperationStatus.InvalidFileName => BadRequest(problemDetailsBuilder
.WithTitle("The provided file name is not valid")
.Build()),
TemporaryFileOperationStatus.KeyAlreadyUsed => BadRequest(problemDetailsBuilder
.WithTitle("Key already used")
.WithDetail("The specified key is already used.")
@@ -45,7 +45,8 @@ public abstract class UserStartNodeTreeControllerBase<TItem> : EntityTreeControl
IEntitySlim[] children = base.GetPagedChildEntities(parentKey, skip, take, out totalItems);
return UserHasRootAccess() || IgnoreUserStartNodes()
? children
: CalculateAccessMap(() => _userStartNodeEntitiesService.ChildUserAccessEntities(children, UserStartNodePaths), out totalItems);
// Keeping the correct totalItems amount from GetPagedChildEntities
: CalculateAccessMap(() => _userStartNodeEntitiesService.ChildUserAccessEntities(children, UserStartNodePaths), out _);
}
protected override TItem[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities)
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Filters;
@@ -21,7 +21,8 @@ public abstract class UpgradeControllerBase : ManagementApiControllerBase
? Ok()
: OperationStatusResult(status, problemDetailsBuilder => status switch
{
UpgradeOperationStatus.UpgradeFailed => StatusCode(StatusCodes.Status500InternalServerError,
UpgradeOperationStatus.UpgradeFailed => StatusCode(
StatusCodes.Status500InternalServerError,
problemDetailsBuilder
.WithTitle("Upgrade failed")
.WithDetail(result?.ErrorMessage ?? "An unknown error occurred.")
@@ -1,5 +1,4 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -8,12 +7,10 @@ using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Webhook;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessWebhooks)]
public class CreateWebhookController : WebhookControllerBase
{
private readonly IWebhookService _webhookService;
@@ -1,5 +1,4 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core;
@@ -7,12 +6,10 @@ using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Webhook;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessWebhooks)]
public class DeleteWebhookController : WebhookControllerBase
{
private readonly IWebhookService _webhookService;
@@ -1,5 +1,4 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Management.Factories;
@@ -8,12 +7,10 @@ using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Webhook;
[ApiVersion("1.0")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessWebhooks)]
public class UpdateWebhookController : WebhookControllerBase
{
private readonly IWebhookService _webhookService;
@@ -1,13 +1,16 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.Builders;
using Umbraco.Cms.Api.Management.Routing;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Web.Common.Authorization;
namespace Umbraco.Cms.Api.Management.Controllers.Webhook;
[VersionedApiBackOfficeRoute("webhook")]
[ApiExplorerSettings(GroupName = "Webhook")]
[Authorize(Policy = AuthorizationPolicies.TreeAccessWebhooks)]
public abstract class WebhookControllerBase : ManagementApiControllerBase
{
protected IActionResult WebhookOperationStatusResult(WebhookOperationStatus status) =>
@@ -33,6 +33,7 @@ internal static class ApplicationBuilderExtensions
{
innerBuilder.UseExceptionHandler(exceptionBuilder => exceptionBuilder.Run(async context =>
{
var isDebug = context.RequestServices.GetRequiredService<IHostingEnvironment>().IsDebugMode;
Exception? exception = context.Features.Get<IExceptionHandlerPathFeature>()?.Error;
if (exception is null)
{
@@ -42,16 +43,16 @@ internal static class ApplicationBuilderExtensions
var response = new ProblemDetails
{
Title = exception.Message,
Detail = exception.StackTrace,
Detail = isDebug ? exception.StackTrace : null,
Status = StatusCodes.Status500InternalServerError,
Instance = exception.GetType().Name,
Instance = isDebug ? exception.GetType().Name : null,
Type = "Error"
};
await context.Response.WriteAsJsonAsync(response);
}));
});
internal static IApplicationBuilder UseEndpoints(this IApplicationBuilder applicationBuilder)
internal static IApplicationBuilder UseEndpoints(this IApplicationBuilder applicationBuilder)
{
IServiceProvider provider = applicationBuilder.ApplicationServices;
@@ -1,6 +1,8 @@
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.Security;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Notifications;
namespace Umbraco.Cms.Api.Management.DependencyInjection;
@@ -9,6 +11,13 @@ internal static class AuditLogBuilderExtensions
internal static IUmbracoBuilder AddAuditLogs(this IUmbracoBuilder builder)
{
builder.Services.AddTransient<IAuditLogPresentationFactory, AuditLogPresentationFactory>();
builder.AddNotificationHandler<UserLoginSuccessNotification, BackOfficeUserManagerAuditer>();
builder.AddNotificationHandler<UserLogoutSuccessNotification, BackOfficeUserManagerAuditer>();
builder.AddNotificationHandler<UserLoginFailedNotification, BackOfficeUserManagerAuditer>();
builder.AddNotificationHandler<UserForgotPasswordRequestedNotification, BackOfficeUserManagerAuditer>();
builder.AddNotificationHandler<UserForgotPasswordChangedNotification, BackOfficeUserManagerAuditer>();
builder.AddNotificationHandler<UserPasswordChangedNotification, BackOfficeUserManagerAuditer>();
builder.AddNotificationHandler<UserPasswordResetNotification, BackOfficeUserManagerAuditer>();
return builder;
}
@@ -29,6 +29,7 @@ internal static class BackOfficeAuthPolicyBuilderExtensions
builder.Services.AddSingleton<IAuthorizationHandler, UserGroupPermissionHandler>();
builder.Services.AddSingleton<IAuthorizationHandler, UserPermissionHandler>();
builder.Services.AddSingleton<IAuthorizationHandler, AllowedApplicationHandler>();
builder.Services.AddSingleton<IAuthorizationHandler, BackOfficeHandler>();
builder.Services.AddAuthorization(CreatePolicies);
return builder;
@@ -46,7 +47,7 @@ internal static class BackOfficeAuthPolicyBuilderExtensions
options.AddPolicy(AuthorizationPolicies.BackOfficeAccess, policy =>
{
policy.AuthenticationSchemes.Add(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme);
policy.RequireAuthenticatedUser();
policy.Requirements.Add(new BackOfficeRequirement());
});
options.AddPolicy(AuthorizationPolicies.RequireAdminAccess, policy =>
@@ -57,13 +58,16 @@ internal static class BackOfficeAuthPolicyBuilderExtensions
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessContent, Constants.Applications.Content);
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessContentOrMedia, Constants.Applications.Content, Constants.Applications.Media);
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessForContentTree,
AddAllowedApplicationsPolicy(
AuthorizationPolicies.SectionAccessForContentTree,
Constants.Applications.Content, Constants.Applications.Media, Constants.Applications.Users,
Constants.Applications.Settings, Constants.Applications.Packages, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessForMediaTree,
AddAllowedApplicationsPolicy(
AuthorizationPolicies.SectionAccessForMediaTree,
Constants.Applications.Content, Constants.Applications.Media, Constants.Applications.Users,
Constants.Applications.Settings, Constants.Applications.Packages, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessForMemberTree,
AddAllowedApplicationsPolicy(
AuthorizationPolicies.SectionAccessForMemberTree,
Constants.Applications.Content, Constants.Applications.Media, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessMedia, Constants.Applications.Media);
AddAllowedApplicationsPolicy(AuthorizationPolicies.SectionAccessMembers, Constants.Applications.Members);
@@ -76,17 +80,20 @@ internal static class BackOfficeAuthPolicyBuilderExtensions
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessDictionaryOrTemplates, Constants.Applications.Translation, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessDocuments, Constants.Applications.Content);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessDocumentsOrDocumentTypes, Constants.Applications.Content, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessDocumentOrMediaOrContentTypes, Constants.Applications.Content, Constants.Applications.Settings, Constants.Applications.Media);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessDocumentTypes, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessLanguages, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMediaTypes, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMediaOrMediaTypes, Constants.Applications.Media, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMemberGroups, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMemberTypes, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessMembersOrMemberTypes, Constants.Applications.Settings, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessPartialViews, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessRelationTypes, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessScripts, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessStylesheets, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessTemplates, Constants.Applications.Settings);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessStylesheetsOrDocumentOrMediaOrMember, Constants.Applications.Settings, Constants.Applications.Content, Constants.Applications.Media, Constants.Applications.Members);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessTemplates, Constants.Applications.Settings, Constants.Applications.Content);
AddAllowedApplicationsPolicy(AuthorizationPolicies.TreeAccessWebhooks, Constants.Applications.Settings);
// Contextual permissions
@@ -52,8 +52,7 @@ public static partial class UmbracoBuilderExtensions
hostingEnvironment,
factory.GetRequiredService<ILogger<PhysicalFileSystem>>(),
hostingEnvironment.MapPathContentRoot(path),
hostingEnvironment.ToAbsolute(path)
);
hostingEnvironment.ToAbsolute(path));
});
return builder;
@@ -52,8 +52,7 @@ public static partial class UmbracoBuilderExtensions
factory.GetRequiredService<IUserRepository>(),
factory.GetRequiredService<IRuntimeState>(),
factory.GetRequiredService<IEventMessagesFactory>(),
factory.GetRequiredService<ILogger<BackOfficeUserStore>>()
))
factory.GetRequiredService<ILogger<BackOfficeUserStore>>()))
.AddUserManager<IBackOfficeUserManager, BackOfficeUserManager>()
.AddSignInManager<IBackOfficeSignInManager, BackOfficeSignInManager>()
.AddClaimsPrincipalFactory<BackOfficeClaimsPrincipalFactory>()
@@ -94,14 +93,16 @@ public static partial class UmbracoBuilderExtensions
/// <summary>
/// Adds support for external login providers in Umbraco
/// </summary>
public static IUmbracoBuilder AddBackOfficeExternalLogins(this IUmbracoBuilder umbracoBuilder,
public static IUmbracoBuilder AddBackOfficeExternalLogins(
this IUmbracoBuilder umbracoBuilder,
Action<BackOfficeExternalLoginsBuilder> builder)
{
builder(new BackOfficeExternalLoginsBuilder(umbracoBuilder.Services));
return umbracoBuilder;
}
public static BackOfficeIdentityBuilder AddTwoFactorProvider<T>(this BackOfficeIdentityBuilder identityBuilder,
public static BackOfficeIdentityBuilder AddTwoFactorProvider<T>(
this BackOfficeIdentityBuilder identityBuilder,
string providerName) where T : class, ITwoFactorProvider
{
identityBuilder.Services.AddSingleton<ITwoFactorProvider, T>();
@@ -1,8 +1,14 @@
using Microsoft.Extensions.Options;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Api.Management.ViewModels.Media;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Api.Management.ViewModels.Member;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Features;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Factories;
@@ -10,19 +16,40 @@ namespace Umbraco.Cms.Api.Management.Factories;
public class ConfigurationPresentationFactory : IConfigurationPresentationFactory
{
private readonly IReservedFieldNamesService _reservedFieldNamesService;
private readonly UmbracoFeatures _umbracoFeatures;
private readonly DataTypesSettings _dataTypesSettings;
private readonly ContentSettings _contentSettings;
private readonly SegmentSettings _segmentSettings;
public ConfigurationPresentationFactory(
IReservedFieldNamesService reservedFieldNamesService,
IOptions<ContentSettings> contentSettings,
IOptions<SegmentSettings> segmentSettings)
IOptions<SegmentSettings> segmentSettings,
IOptions<DataTypesSettings> dataTypesSettings,
UmbracoFeatures umbracoFeatures)
{
_reservedFieldNamesService = reservedFieldNamesService;
_umbracoFeatures = umbracoFeatures;
_dataTypesSettings = dataTypesSettings.Value;
_contentSettings = contentSettings.Value;
_segmentSettings = segmentSettings.Value;
}
[Obsolete("Use the constructor with all dependencies")]
public ConfigurationPresentationFactory(
IReservedFieldNamesService reservedFieldNamesService,
IOptions<ContentSettings> contentSettings,
IOptions<SegmentSettings> segmentSettings)
: this(
reservedFieldNamesService,
contentSettings,
segmentSettings,
StaticServiceProvider.Instance.GetRequiredService<IOptions<DataTypesSettings>>(),
StaticServiceProvider.Instance.GetRequiredService<UmbracoFeatures>()
)
{
}
public DocumentConfigurationResponseModel CreateDocumentConfigurationResponseModel() =>
new()
{
@@ -33,12 +60,27 @@ public class ConfigurationPresentationFactory : IConfigurationPresentationFactor
ReservedFieldNames = _reservedFieldNamesService.GetDocumentReservedFieldNames(),
};
public DocumentTypeConfigurationResponseModel CreateDocumentTypeConfigurationResponseModel() =>
new()
{
DataTypesCanBeChanged = _dataTypesSettings.CanBeChanged,
DisableTemplates = _umbracoFeatures.Disabled.DisableTemplates,
UseSegments = _segmentSettings.Enabled,
ReservedFieldNames = _reservedFieldNamesService.GetDocumentReservedFieldNames(),
};
public MemberConfigurationResponseModel CreateMemberConfigurationResponseModel() =>
new()
{
ReservedFieldNames = _reservedFieldNamesService.GetMemberReservedFieldNames(),
};
public MemberTypeConfigurationResponseModel CreateMemberTypeConfigurationResponseModel() =>
new()
{
ReservedFieldNames = _reservedFieldNamesService.GetMemberReservedFieldNames(),
};
public MediaConfigurationResponseModel CreateMediaConfigurationResponseModel() =>
new()
{
@@ -46,4 +88,10 @@ public class ConfigurationPresentationFactory : IConfigurationPresentationFactor
DisableUnpublishWhenReferenced = _contentSettings.DisableUnpublishWhenReferenced,
ReservedFieldNames = _reservedFieldNamesService.GetMediaReservedFieldNames(),
};
public MediaTypeConfigurationResponseModel CreateMediaTypeConfigurationResponseModel() =>
new()
{
ReservedFieldNames = _reservedFieldNamesService.GetMediaReservedFieldNames(),
};
}
@@ -27,13 +27,14 @@ internal sealed class DocumentNotificationPresentationFactory : IDocumentNotific
.ToArray()
?? Array.Empty<string>();
var availableActionIds = _actionCollection.Where(a => a.ShowInNotifier).Select(a => a.Letter.ToString()).ToArray();
return await Task.FromResult(
availableActionIds.Select(actionId => new DocumentNotificationResponseModel
return await Task.FromResult(_actionCollection
.Where(action => action.ShowInNotifier)
.Select(action => new DocumentNotificationResponseModel
{
ActionId = actionId,
Subscribed = subscribedActionIds.Contains(actionId)
}).ToArray());
ActionId = action.Letter,
Alias = action.Alias,
Subscribed = subscribedActionIds.Contains(action.Letter)
})
.ToArray());
}
}
@@ -1,6 +1,9 @@
using Umbraco.Cms.Api.Management.ViewModels.Document;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Api.Management.ViewModels.Media;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Api.Management.ViewModels.Member;
using Umbraco.Cms.Api.Management.ViewModels.MemberType;
namespace Umbraco.Cms.Api.Management.Factories;
@@ -8,7 +11,16 @@ public interface IConfigurationPresentationFactory
{
DocumentConfigurationResponseModel CreateDocumentConfigurationResponseModel();
DocumentTypeConfigurationResponseModel CreateDocumentTypeConfigurationResponseModel()
=> throw new NotImplementedException();
MemberConfigurationResponseModel CreateMemberConfigurationResponseModel();
MemberTypeConfigurationResponseModel CreateMemberTypeConfigurationResponseModel()
=> throw new NotImplementedException();
MediaConfigurationResponseModel CreateMediaConfigurationResponseModel();
MediaTypeConfigurationResponseModel CreateMediaTypeConfigurationResponseModel()
=> throw new NotImplementedException();
}
@@ -1,5 +1,4 @@
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Api.Management.ViewModels.MediaType;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentTypeEditing;
using Umbraco.Cms.Core.Services;
@@ -1,11 +1,12 @@
using Umbraco.Cms.Api.Management.Mapping;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Api.Management.Mapping;
using Umbraco.Cms.Api.Management.ViewModels;
using Umbraco.Cms.Api.Management.ViewModels.UserGroup;
using Umbraco.Cms.Api.Management.ViewModels.UserGroup.Permissions;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Models.Membership.Permissions;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Services.OperationStatus;
using Umbraco.Cms.Core.Strings;
@@ -20,17 +21,30 @@ public class UserGroupPresentationFactory : IUserGroupPresentationFactory
private readonly IShortStringHelper _shortStringHelper;
private readonly ILanguageService _languageService;
private readonly IPermissionPresentationFactory _permissionPresentationFactory;
private readonly ILogger<UserGroupPresentationFactory> _logger;
[Obsolete("Use the new constructor instead, will be removed in v16.")]
public UserGroupPresentationFactory(
IEntityService entityService,
IShortStringHelper shortStringHelper,
ILanguageService languageService,
IPermissionPresentationFactory permissionPresentationFactory)
: this(entityService, shortStringHelper, languageService, permissionPresentationFactory, StaticServiceProvider.Instance.GetRequiredService<ILogger<UserGroupPresentationFactory>>())
{
}
public UserGroupPresentationFactory(
IEntityService entityService,
IShortStringHelper shortStringHelper,
ILanguageService languageService,
IPermissionPresentationFactory permissionPresentationFactory,
ILogger<UserGroupPresentationFactory> logger)
{
_entityService = entityService;
_shortStringHelper = shortStringHelper;
_languageService = languageService;
_permissionPresentationFactory = permissionPresentationFactory;
_logger = logger;
}
/// <inheritdoc />
@@ -43,10 +57,9 @@ public class UserGroupPresentationFactory : IUserGroupPresentationFactory
Attempt<IEnumerable<string>, UserGroupOperationStatus> languageIsoCodesMappingAttempt = await MapLanguageIdsToIsoCodeAsync(userGroup.AllowedLanguages);
// We've gotten this data from the database, so the mapping should not fail
if (languageIsoCodesMappingAttempt.Success is false)
{
throw new InvalidOperationException($"Unknown language ID in User Group: {userGroup.Name}");
_logger.LogDebug("Unknown language ID in User Group: {0}", userGroup.Name);
}
return new UserGroupResponseModel
@@ -77,10 +90,9 @@ public class UserGroupPresentationFactory : IUserGroupPresentationFactory
Guid? mediaStartNodeKey = GetKeyFromId(userGroup.StartMediaId, UmbracoObjectTypes.Media);
Attempt<IEnumerable<string>, UserGroupOperationStatus> languageIsoCodesMappingAttempt = await MapLanguageIdsToIsoCodeAsync(userGroup.AllowedLanguages);
// We've gotten this data from the database, so the mapping should not fail
if (languageIsoCodesMappingAttempt.Success is false)
{
throw new InvalidOperationException($"Unknown language ID in User Group: {userGroup.Name}");
_logger.LogDebug("Unknown language ID in User Group: {0}", userGroup.Name);
}
return new UserGroupResponseModel
@@ -217,9 +229,10 @@ public class UserGroupPresentationFactory : IUserGroupPresentationFactory
.Select(x => x.IsoCode)
.ToArray();
return isoCodes.Length == ids.Count()
? Attempt.SucceedWithStatus<IEnumerable<string>, UserGroupOperationStatus>(UserGroupOperationStatus.Success, isoCodes)
: Attempt.FailWithStatus<IEnumerable<string>, UserGroupOperationStatus>(UserGroupOperationStatus.LanguageNotFound, isoCodes);
// if a language id does not exist, it simply not returned.
// We do this so we don't have to clean up user group data when deleting languages and to make it easier to restore accidentally removed languages
return Attempt.SucceedWithStatus<IEnumerable<string>, UserGroupOperationStatus>(
UserGroupOperationStatus.Success, isoCodes);
}
private async Task<Attempt<IEnumerable<int>, UserGroupOperationStatus>> MapLanguageIsoCodesToIdsAsync(IEnumerable<string> isoCodes)
@@ -150,6 +150,7 @@ public class UserPresentationFactory : IUserPresentationFactory
{
// You should not be able to invite users if any providers has deny local login set.
CanInviteUsers = _emailSender.CanSendRequiredEmail() && _externalLoginProviders.HasDenyLocalLogin() is false,
UsernameIsEmail = _securitySettings.UsernameIsEmail,
PasswordConfiguration = _passwordConfigurationPresentationFactory.CreatePasswordConfigurationResponseModel(),
});
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Umbraco.Cms.Api.Management.ViewModels;
@@ -32,7 +32,12 @@ internal class NotificationHeaderFilter : IOperationFilter
response.Headers.TryAdd(Constants.Headers.Notifications, new OpenApiHeader
{
Description = "The list of notifications produced during the request.",
Schema = new OpenApiSchema { Type = "array" , Nullable = true, Items = new OpenApiSchema(){
Schema = new OpenApiSchema
{
Type = "array",
Nullable = true,
Items = new OpenApiSchema()
{
Reference = new OpenApiReference()
{
Type = ReferenceType.Schema,
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization.Infrastructure;
using Umbraco.Cms.Api.Management.Security.Authorization.User;
namespace Umbraco.Cms.Api.Management.Security.Authorization.DenyLocalLogin;
@@ -24,12 +25,12 @@ public class DenyLocalLoginHandler : MustSatisfyRequirementAuthorizationHandler<
if (isDenied is false)
{
// AuthorizationPolicies.BackOfficeAccess policy adds this requirement by policy.RequireAuthenticatedUser()
// AuthorizationPolicies.BackOfficeAccess policy adds this requirement by policy.Requirements.Add(new BackOfficeRequirement());
// Since we want to "allow anonymous" for some endpoints (i.e. BackOfficeController.Login()), it is necessary to succeed this requirement
IEnumerable<DenyAnonymousAuthorizationRequirement> denyAnonymousUserRequirements = context.PendingRequirements.OfType<DenyAnonymousAuthorizationRequirement>();
foreach (DenyAnonymousAuthorizationRequirement denyAnonymousUserRequirement in denyAnonymousUserRequirements)
IEnumerable<BackOfficeRequirement> backOfficeRequirements = context.PendingRequirements.OfType<BackOfficeRequirement>();
foreach (BackOfficeRequirement backOfficeRequirement in backOfficeRequirements)
{
context.Succeed(denyAnonymousUserRequirement);
context.Succeed(backOfficeRequirement);
}
}

Some files were not shown because too many files have changed in this diff Show More