Commit Graph

44474 Commits

Author SHA1 Message Date
Elitsa Marinovska
fda866fc9e V14: Add authorization policies to Management API controllers - p2 (#15211)
* Making ProblemDetails details more generic

* Adding authorizer that can be replaces for external authz in handlers. Adding handler and requirement for UserBelongsToUserGroupInRequest policy

* Adding method to get the GUID from claims

* Adding service methods to check user group authz

* Porting MustSatisfyRequirementAuthorizationHandler

* Adding controllers authz

* Fix return status code + produced response type

* Moving to folder

* Adding DenyLocalLogin policy scaffold

* Implement a temp DenyLocalLoginHandler

* Introducing a new Fobidden result

* Fix comment

* Introducing a helper class for authorizers

* Changed nullability for GetCurrentUser

* Changes from Attempt to Status + FIXME comments

* Create a UserGroupAuthorizationStatus to be used in the future

* Introduces a new authz status for checking media acess

* Introducing a new permission service for media

* Adding fixme

* Adding more policy configurations

* Adding Media policy requirement and handler

* Adding media authorizer

* Fix order of params

* Adding duplicate code comment

* Adding authz to media controllers

* Migrating more logic from MediaPermissions.cs

* Adding more MediaAuthorizationStatus-es

* Handling of new authorization status

* Fix comment

* Adding NotFound case

* Adding NewDenyLocalLoginIfConfigured policy && commenting [AllowAnonymous] where the policy is applied since it is already handled

* Changed Forbid() to Forbidden() to get the correct status code

* Remove policy that is applied on the base controller already

* Implement and apply NewUmbracoFeatureEnabled policy

* Renaming classes to add Permission in the name

* Register permission services

* Add FIXME

* Introduce new IUserGroupPermissionService and refactor accordingly

* Add single overload with default implementation

* Adding user permission policy and related

* Applying admin policy

* Register all new policies

* Better wording

* Add default implementation for a single overload

* Adding remarks to IContentPermissionService.cs

* Supporting null as key in ContentPermissionService

* Fix namespace

* Reverting back to not supporting null as content key, but having dedicated implementation

* Adding content authorizer with null values to represent root item

* Removing null key support and adding dedicated implementation

* Removing remarks

* Adding content resource with null support

* Removing null support

* Adding requirement and status

* Adding content authorizer + handlers

* Applying policies to content controllers

* Update comment

* Handling of Authorization Statuses

* More authz in controllers

* Fix comments

* New branch handler

* Obsolete old implementation

* Adding dedicated policies to root and bin

* Adding a branch specific namespace

* Bin specific requirement and namespace

* Root specific requirement and namespace

* Changing to new root policy

* Refactoring

* Save policies

* Fix null check/reference

* Add TODO comment

* Create media root- and bin-specific policies, handlers, etc.

* Apply correct policy in create and update media controllers

* Apply root policy to move and sort controllers

* Fix wording

* Adding UserGroupAuthorizationStatusResult

* Remove all AuthorizationStatusResult as we cannot get the specific AuthorizationStatus

* Fixing Umbraco feature policy

* Fix allow anonymous endpoints - the value returned from DenyLocalLoginHandler wasn't enough, we need to succeed DenyAnonymousAuthorizationRequirement as it is required for some of the endpoints that had the attribute

* Apply DenyLocalLoginIfConfigured policy to corresponding re-implementation of PostSetInvitedUserPassword

* Fix comment

* Renaming performingUser to user and fixing comments

* Rename helper method

* Fix references

* Re-add merge conflict deletion

* Adding Backoffice requirement and relevant

* Registering

* Added a simple policy test

* Fixed small test things and clean up

* Temp solution

* Added one more test and fix another static issue

* Fix another merge conflict

* Remove BackOfficePermissionRequirement and handler as they might not be necessary

* Comment out again [AllowAnonymous]

* Remove AuthorizationPolicies.BackOfficeAccessWithoutApproval policy as it might not be necessary

* Fix temp implementation

* Fix reference to correct handler

* Apply authz policy to new publish/unpublish controllers

* Fix comments

* Removing duplicate ProducesResponseTypes

* Added swagger documentation about the 401 and 403

* Added Resources to Media, User and UserGroup

* Handle root, recycle bin and branch in the same handler

* Handle both parent and target when moving

* Check Ids for all sort requests

* Xml docs

* Clean up

* Clean up

* Fix build

* Cleanup

* Remove TODO

* Added missing overload

* Use yield

* Adding some keys to check

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-12-11 08:25:29 +01:00
Jacob Overgaard
f8b95e5c69 update backoffice submodule 2023-12-07 10:06:46 +01:00
Jacob Overgaard
f5a49d87c3 update backoffice submodule 2023-12-06 15:32:47 +01:00
Kenn Jacobsen
4e6b9af959 Allow specifying root access for user groups (#15364) 2023-12-06 10:18:32 +01:00
Jacob Overgaard
1be548b680 Update nightly build (#15359)
* cherry-pick templateParameters from v14/dev

* add isNightly parameter

* remove v9

* add parameter check for myget isNightly
2023-12-05 13:11:15 +01:00
Jacob Overgaard
cd10d5840d V14: Publish Bellissima package to npm via Pipelines (#14926)
* ignore node_modules specifically to limit size of build_output

* build and publish backoffice artifacts

* instruct GitVersioning to output all variables such as npm to use in Pipelines

* use NBGV variables

* prepare npm package for nightlies

* instruct to deploy to MyGet for nightlies

* Deploy to npm only after Myget

* add public access to publish

* write scopes to .npmrc file

* add scope to registry.npmjs.org

* nightly param
2023-12-05 10:54:23 +01:00
Nhu Dinh
48befe730b V14 QA Refactor code of Partial View acceptance tests (#15325)
* Refactor acceptance tests for Partial View

* Refactor api tests for Partial View

* Bumped version of Test Helper

* Added suggestion from review

* Bumped version to testhelpers 2.0.8

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-12-01 11:20:57 +01:00
Kenn Jacobsen
f9ecd9514e Management API should expose if a user group is a system group (#15333) 2023-12-01 09:39:27 +01:00
Kenn Jacobsen
42234cdd40 Move system information away from the User API (#15316)
* Move system information away from the User API

* Review comments
2023-11-30 14:29:16 +01:00
Bjarke Berg
53d0057ac6 Update test dependencies 2023-11-29 12:46:28 +01:00
Kenn Jacobsen
c9c234492b Add missing API version attributes to management API controllers (#15310) 2023-11-29 09:23:23 +01:00
Bjarke Berg
ddf9f05a8f Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	version.json
2023-11-28 15:18:24 +01:00
Bjarke Berg
17ea20ee3d Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoInstall/Index.cshtml
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoLogin/Index.cshtml
2023-11-28 15:09:48 +01:00
Jacob Overgaard
98e2a1b897 update backoffice submodule 2023-11-28 13:54:03 +01:00
Kenn Jacobsen
34d6695c89 Don't expect specific .NET feature versions - utilize rollForward instead. (#15304)
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-28 13:21:09 +01:00
Bjarke Berg
1f527fefd8 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.Integration/CompatibilitySuppressions.xml
2023-11-28 11:20:02 +01:00
Bjarke Berg
1176f04caf Updated pacakge-lock files 2023-11-28 09:45:07 +01:00
Bjarke Berg
280518c9d6 Merge remote-tracking branch 'origin/v11/dev' into v12/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
#	src/Umbraco.Infrastructure/Logging/Viewer/LogViewerConfig.cs
#	src/Umbraco.Web.UI.Client/.nvmrc
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
2023-11-28 09:39:31 +01:00
Jacob Overgaard
32493c759a add -login prefix to curves color 2023-11-28 08:48:55 +01:00
Jacob Overgaard
8d76e32941 V13: Add more css custom properties to style the login screen (#15301)
* add more css custom properties to control the login screen

* add override for text color

* add variables to control the font-size of the headline
2023-11-28 08:37:59 +01:00
Bjarke Berg
008d797a66 Added <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> 2023-11-27 19:54:03 +01:00
Bjarke Berg
ab781560bc Merge remote-tracking branch 'origin/v10/dev' into v11/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
2023-11-27 19:47:24 +01:00
Bjarke Berg
8d9343b564 Merge branch 'release/10.8' into v10/dev
# Conflicts:
#	version.json
2023-11-27 18:10:40 +01:00
Bjarke Berg
1ee891c8d5 Merge remote-tracking branch 'origin/release/10.8' into release/10.8 2023-11-27 18:09:41 +01:00
Bjarke Berg
bf1a5b9b28 Bump version 2023-11-27 18:09:30 +01:00
Bjarke Berg
696b74cdb6 Merge branch 'release/10.8' into v10/dev 2023-11-27 18:08:30 +01:00
Bjarke Berg
bf8af4588e Centralised NuGet packages (#15293)
* Moved to centralized nuget packages

* Handle JsonSchema

* Change PackageReference to PackageVersion

* Opt out of central package management for mangement api (at least for versions less than 14) and the UI project

* ManagePackageVersionsCentrally = false

* Change folder acceptance tests are build, to avoid reading the test Directory.Packages.props

* Change folder acceptance tests are build, to avoid reading the test Directory.Packages.props

* change working directory

* workingDirectory

* Force the template to use local nuget packages

* Force the template to use local nuget packages

* clean up

* added wait on

* added wait on
2023-11-27 15:18:00 +01:00
Zeegaan
7443dd2bdc bump version 2023-11-27 10:36:56 +01:00
Nikolaj Geisle
bfe8b715d8 V13: Change request column to NVarcharMax (#15252)
* Change request column to NVarcharMax

* Rename migration

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-27 09:06:00 +01:00
Zeegaan
be443189e1 Merge branch 'v13/dev' into release/13.0
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/webhooks/overlays/details.html
2023-11-27 08:26:41 +01:00
Nhu Dinh
d6f0c33d83 V14 added acceptance tests for the Stylesheets (#15265)
* Added acceptance test for Stylesheets

* Updated api test for stylesheet using new helpers and apply AAA pattern

* Bumped version of Test Helpers

* Updated api and ui tests of Stylesheet after modifying TestHelper

* Updated stylesheets ui tests using openActionMenuAtRoot()

* Added suggestions from review

* Added wait for the flaky tests

* Fixed package-lock.json

---------

Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-11-23 09:33:51 +01:00
Jacob Overgaard
3b518050bd V13: Login page backwards compatibility (#15285) 2023-11-23 08:45:49 +01:00
Ronald Barendse
5ad400184a Fix IWebhook.GetUdi() and IEntity.GetUdi() extension methods (#15288)
* Fix IWebhook and IEntity GetUdi extension method

* Refactor to use switch expressions

* Add GetUdiForWebhook test

* Added a webhook builder for unit tests.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2023-11-23 08:02:57 +01:00
Bjarke Berg
1c2602f57c Dynamic root with culture and segment (#15287)
* parse culture and segment for dynamic root.

* Handle new culture and segment parameters

---------

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2023-11-22 19:58:06 +01:00
Jacob Overgaard
e04b015026 update backoffice submodule 2023-11-22 16:19:55 +01:00
Nikolaj Geisle
bcd386ac70 V13: Fix missing contenttype in webhook (#15282)
* Create missing node for content type

* Change to Unknown instead of deleted

* Cleared contentTypes and removed console.log

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-11-22 13:54:11 +01:00
Kenn Jacobsen
012b43a1c2 Publishing in the Management API (#14774)
* make CoreScopeProvider available for derived classes

* Create publish controller

* Add publish functionality

* Remove unneeded using

* Implement publish for multiple cultures

* support multiple cultures in controler

* Dont validate properties

* Refactor to use PublishingOperationStatus

* refactor to use proper publish async methods

* Refactor publish logic into own service

* Commit some demo code

* Add notes about what errors can happen when publishing

* Rework ContentPublishingService and introduce explicit Publish and PublishBranch methods in ContentService

* Fix merge

* Allow the publishing strategy to do its job

* Improved check for unsaved changes

* Make the old content controller work (as best possible)

* Remove SaveAndPublish (SaveAndPublishBranch) from all tests

* Proper guards for invalid cultures when publishing

* Fix edge cases for property validation and content unpublishing + add unpublishing to ContentPublishingService

* Clear out a few TODOs - we'll accept the behavior for now

* Unpublish controller

* Fix merge

* Fix branch publish notifications

* Added extra test for publishing unpublished cultures and added FIXME comments for when we fix the state of published cultures in content

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-22 12:52:08 +01:00
Elitsa Marinovska
42dd2da579 V14: Allowing custom backoffice host with CORS policy (#15269)
* Allowing custom backoffice host with CORS policy

* Adding missing allow
2023-11-21 15:49:29 +01:00
Andreas Zerbst
b499660101 V13 Bugfix. Added backend validation for checking if a webhook has any events (#15272)
* Added a webhookOperationStatus for noEvents

* Added a method for validating Webhooks. Currently checks if the webhooks has any events or not

* Added WebhookOperationStatus for NoEvents

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

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

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

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2023-11-21 14:49:40 +01:00
Nikolaj Geisle
8755703845 V13: Implement webook as i entity (#15267)
* Add webhook service to service context

* Refactor webhooks to implement IEntity

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-21 14:38:47 +01:00
Nikolaj Geisle
4c3b4752db V13: Change WebhookLog status for clarity (#15247)
* Refactor to show icon and status code to make status more clear

* Fix up migration

* Add change log status migration

* Fix up frontend to display cross when fail

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-21 13:55:52 +01:00
Ronald Barendse
4b60394488 Update ImageSharp2 dependency and add upper version limit 2023-11-21 13:35:36 +01:00
Ronald Barendse
524b5ef700 Merge pull request #15268 from umbraco/v13/improvement/update-dependencies
Update and remove unnecessary package dependencies
2023-11-21 13:12:20 +01:00
Ronald Barendse
4b602dc8e2 Fix incorrect merge resolution of package dependencies 2023-11-21 12:08:51 +01:00
Ronald Barendse
28550b88c8 Remove implicitly set EmbedUntrackedSources property 2023-11-21 11:39:04 +01:00
Ronald Barendse
40dd163e3a Update to Microsoft.ICU.ICU4C.Runtime 72.1.0.3 2023-11-21 10:52:25 +01:00
Ronald Barendse
e22c43b471 Update to Serilog 8.0.0 2023-11-21 10:51:03 +01:00
Ronald Barendse
49fc7f9786 Update to OpenIddict 4.10.0 2023-11-21 10:51:02 +01:00
Ronald Barendse
a77b77d98a Remove AngleSharp package reference 2023-11-21 10:51:02 +01:00
Ronald Barendse
93c46b1d10 Remove explicit SourceLink package reference (included in .NET 8 SDK) 2023-11-21 10:50:52 +01:00