Commit Graph

63 Commits

Author SHA1 Message Date
Kenn Jacobsen
874055eeab Add member "kind" - and refactor user "type" to "kind" for consistency (#16979)
* Rename UserType to UserKind

* Add MemberKind to tell API members from regular ones

* Remove user kind from invite user endpoint

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2024-09-03 10:43:09 +02:00
Kenn Jacobsen
68db079700 API access with client credentials (core functionality) (#16817)
* First stab

* Delivery API client credentials + a little refactor to ensure unique client IDs

* Introduce user type

* Support user type in the Management API

* Clean up TODOs

* Update API user last login date when issuing a token

* Better error reporting for mismatched user types

* Do not allow password change or reset for API users

* Update OpenApi.json

* Revert change

* Remove obsolete comment

* Make applicable classes abstract or sealed

* Review changes

* Add endpoint for retrieving all user client IDs
2024-07-29 14:34:11 +02:00
Kenn Jacobsen
d927146855 Fix issues with initial creation of external users (#16363)
* Use constant instead of "sub"

* Re-assign the newly created user key as well as its ID
2024-05-24 14:55:56 +02:00
Nikolaj Geisle
7bd499565d V14: Cache user by id (#16139)
* Cache user by id

* Add todo

* Fix tests

* Clear cache after update

* Refer to base class cache instead of implementing own

* Dont hardcode cache key

* Update to be Payload cache refresher instead
2024-04-25 15:56:01 +02:00
Nikolaj Geisle
d5809da665 V14: Move towards get guid (#15889)
* Implement using keymap for member

* Remove current usages of GetUserById

* User userId resolver to resolve user key

* Refactor user repository to use GUID not int

* Add happy path test

* Remove user in cache when user gets updated

* Use await in async method

* Fix up according to review

* Update IMetricsConsentService.cs to have async method

* Fix according to review

* Fix more according to comments

* Revert "Fix up according to review"

This reverts commit a75acaaa

* Get current backoffice user from method

* Update user repository delete functionality

* Fix up more test

* Try to get user by id if key fails

* Add user key as required claim

* Fix tests

* Don't set claim in BackofficeController

* Create constant for the Sub claim

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-11 13:53:34 +02:00
Sven Geusens
393d178b58 User endpoint additions and corrections (#15773)
* Make create user endpoint work with the supplied id

Return 201 instead of 200 with correct resource identifier

* Add ResetPassword endpoint

* Bring changepassword route inline with other resource actions

* Fixed User endpoints not advertising all their possible response codes/ models

Fixed certain endpoints not authorizing targeted user(s) versus the admin needs admin authorization requirement
Fixed a user not found response bug for the update flow
Fix spacing

* Fixed CurrentUser endpoints not advertising all their possible response codes/ models

Fix incorrect responseStatus in UserService.GetPermissionsAsync

* Update OpenApi definition

Fix smal model oversights in previous commits

* Update incorrect Response type

* Check for duplicate id's in user create validation

* Remove unnecasary returnmodel from changepassword

Renamed the model to it's remaining usage

* rename bad constructor parameter

* Renamed method parameters for better readability and usage

* Fixed wrong userkey being passed down because of (refactored) bad naming

Technically doesn't change anything as the two id's should be the same in this case (reset with token is always for self)

* Fixed resetpassword bug

* Update openapi

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

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

* Remove old password from change user password request model

Only makes sense when doing it for the logged in user => current endpoint

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2024-02-29 10:40:48 +01:00
Bjarke Berg
2494d8c5aa Granular permissions in Management API (#15734)
* It builds..

* Added granular permissions

* Added granular permissions

* Rename content to document

* Added migration

* Fixed issues causing the migration from v13 was not possible.

* Merged Permissions and Granular Permissions in viewmodel

* Prepared the viewmodel to a future where permissions can be more types.

* OpenApi

* Allow to translate a single char to many strings

* Use frontend friendly values for known permissions

* Validate the documents exist

* Allow setting non-document settings

* Add "$type" when required

* Rename to presentation model and update OpenApi.json

* OpenApi.json

* Fix tests

* OpenAPI

* Fixed issues with upgrades

* Add the discriminator name

* Fixed issues that only happended on SqlServer

* Fixed queries for SqlServer

* Clean up

* More cleanup

* Fix issue when migrating sqlserver

* Split fallback permissions into own concept in view model

* Also split on current user

* Added a extenable pattern for mappers between DTO => Granular Permission => ViewModel and ViewModel => Granular Permission

* Fixed issue with new exists method, that did not take duplicate keys into account.

* Added sections to current user response model

* Formatting fixes

* Move class to its own file

* xml comment

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
2024-02-27 21:57:02 +01:00
Mole
21b0a7ffae New Backoffice: Fix feedback to users controller (#14031)
* Add specific not found results

* Add tests for the enable/disable not found tweak

* Cache ids and key in UserIdKeyResolver

* Don't cache null keys

* BackOffice not Backoffice

* Move fetching the user out of the ChangePasswordUsersController

* Move resolving user out of SetAvatar

* Move resolving user out of Update

* Return more specific notfound in bykey

* Use ErrorResult for all endpoints with unknown errors

* Split integration tests

* Add mappers

* Use ?: consistently

* Add reuseable iso code validator

* Validate ISO code

* Update supressions

* Use method from base to get current user key

* Rename ISo to Iso

* Use keys in services instead of user groups + Added a couple of new validations

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-04-04 15:41:12 +02:00
Mole
9b626d02c8 New backoffice: User controller (#13947)
* Add UserResponseModel

* Add factory to created UserResponseModel

* Add GetByKey controller

* Add GetAllUsers endpoint

* User proper response model

* Make naming consistent

* Order by username in GetAll

* Add user filter endpoint

* Fix includer user states

* Remove gravatar from the backend

* Send user avatars in response

* Add create user model

* start working on create

* Validate the create model

* Add authorization to create

* Use UserRepository instead of UserService to ValidateSessíonId

* Create IBackofficeUserStore interface

This is essentially a core-friendly version of the BackOfficeUserStore, additionally it contains basic methods for managing users, I.E. Get users, save users, create users, etc.

* Remove more usages of user service

* Remove usages of IUserService in BackofficeUserStore

* Add documentation

* Fix tests and DI

* add IBackOfficeUserStoreAccessor to resolve it in singleton services

* Resolve circular dependency

* Remove obsolete constructor

* Add core friendly user manager

* Finish createasync in user service

* Add WIP create endpoint

* Save newly creates users user groups

* Use service scope for user service

* Remove now unnecessary accessors

* Add response types

* Add update user endpoint

* Add EmailUserInviteSender

* Add technology free way of creating confirmation token

* Add invite uri provider

* Add invite user to user service

* Add invite user controller

* Add delete endpoint

* Add operation status responses

* Add operation status responses

* Added temporary file uploads including a repository implementation using local temp folder.

* Add Disable users endpoint

* missing files

* Fixed copy paste error

* Fix create users return type

* Updated OpenApi.json

* Updated OpenApi.json

* Handle if created failed in identity

* Add enable user

* Make users plural in enable/disable

We're doing the operation on multiple entities

* Added file extension check

* Add unlock user endpoint

* Clean up. Removed old TemporaryFileService and UploadFileService and updated dictionary items to use this new items

* Clean up

* Add reset password

* Add UpdateUserGroupsOnUsers method

* Add UpdateUserGroups

* Get rid of stream directly on TemporaryFileModel, and use delegate to open stream instead.

* Fix post merge

* Use keys instead of IDs

* Add ClearAvatar endpoint

* Review changes

* Moved models to their own files

* Reverted launch settings

* Move enlist extension to its own namespace

* Create set avatar endpoint

* Add reponse types

* Remove infrastructure extension after merge

* Add Cmapatibility suppressions

* Add test suppression

* Add integration tests

* Fix issue found in tests

* Add invited user to UserInvitationResult

* Add more tests

* Add update tests

* Hide different tests under parent

* Return DuplicatUserName user operation status if username matches an email

* Add update tests

* Change sorted set to HashSet

It doesn't work if it's not IComparable

* Change ID to Key when checking super

* Add get tests

* Add more GetAllTests

* Move tests to the right namespace

* Add filter test

* Fix including disabled users bug found by test

* Add test to ensure invited user state

* Add test case for UserState.All

* Add more filter tests

* Add enable disable tests

* Add resolver for keys and ids

* Replace usages of IUserService with IUserIdKeyResolver

* Add CompatibilitySuppressions

* Add UserIdKeyResolverTests

* Fix UserIdKeyResolver

* Add missing user operation results

* Updates from review

* ID not key

* Post instead of patch

* Use set instead of params for enable/disable

* Don't call to array

* Use sets for usergroup keys and user keys instead

* LanguageIsoCode instead of Language

* Update CompatibilitySuppressions after changin enumerable to set

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: kjac <kja@umbraco.dk>
2023-03-29 08:14:47 +02:00
Mole
46cc9d6a97 V13: Add Guids to Users (#13868)
* Add MSSQL migration

* Make upgrade possible when user doesn't have a key yet

* Migrate SQLite

* Migrate the external login column

* Fix logging in after migration

* Handle fake GUID correctly

* Make GetByKey async

* Resolve external logins by key instead of id

* Remove usage of naive UserIdToInt

* Dont use ToGuid for property type defaults

* Use constant GUID for user groups

* Ensure that the same GUID is used to create the root user.

* Add migration for two factor logins

* Add default implementations

* Fix unit test

* Remove TODO

* Fix integration tests

* Add default implementation instead of throwing

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

* Make SQLServer migration idempotent

* Add comment about SQLite

* Fix typo

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-22 12:33:41 +01:00
Mole
5182f46bdb New Backoffice: User Groups Controller (#13811)
* Add key to UserGroupDto

* Fix renaming table in sqlite

The SqliteSyntaxProvider needed an overload to use the correct query

* Start work on user group GUID migration

* Add key index to UserGroupDto

* Copy over data when migrating sqlite

* Make sqlite column migration work

* Remove PostMigrations

These should be replaced with Notification usage

* Remove outer scope from Upgrader

* Remove unececary null check

* Add marker base class for migrations

* Enable scopeless migrations

* Remove unnecessary state check

The final state of the migration is no longer necessarily the final state of the plan.

* Extend ExecutedMigrationPlan

* Ensure that MigrationPlanExecutor.Execute always returns a result.

* Always save final state, regardless of errors

* Remove obsolete Execute

* Add Umbraco specific migration notification

* Publish notification after umbraco migration

* Throw the exception that failed a migration after publishing notification

* Handle notification publishing in DatabaseBuilder

* Fix tests

* Remember to complete scope

* Clean up MigrationPlanExecutor

* Run each package migration in a separate scope

* Add PartialMigrationsTests

* Add unhappy path test

* Fix bug shown by test

* Move PartialMigrationsTests into the correct folder

* Comment out refresh cache in data type migration

Need to add this back again as a notification handler or something.

* Start working on a notification test

* Allow migrations to request a cache rebuild

* Set RebuildCache from MigrateDataTypeConfigurations

* Clean MigrationPlanExecutor

* Add comment explaining the need to partial migration success

* Fix tests

* Allow overriding DefinePlan of UmbracoPlan

This is needed to test the DatabaseBuilder

* Fix notification test

* Don't throw exception to be immediately re-caught

* Assert that scopes notification are always published

* Ensure that scopes are created when requested

* Make test classes internal.

It doesn't really matter, but this way it doesn't show up in intellisense

* Add notification handler for clearing cookies

* Add CompatibilitySuppressions

* Use unscoped migration for adding GUID to user group

* Make sqlite migration work

It's really not pretty, square peg, round hole.

* Don't re-enable foreign keys

This will happen automatically next time a connection is started.

* Scope database when using SQLServer

* Don't call complete transaction

* Tidy up a couple of comment

* Only allow scoping the database from UnscopedMigrationBase

* Fix comment

* Remove remark in UnscopedMigrationBase as it's no longer true

* Add keys when creating default user groups

* Map database value from DTO to entity

* Fix migration

Rename also renamed the foreign keys, making it not work

* Make migration idempotent

* Fix unit test

* Update CompatibilitySuppressions.xml

* Add GetUserGroupByKey to UserService

* Add ByKey endpoint

* Add UniqueId to AppendGroupBy

Otherwise MSSQL grenades

* Ensure that languages are returned by PerformGetByQuery

* add POC displaying model

* Clean up by key controller

* Add GetAllEndpoint

* Add delete endpoint

* Use GetKey to get GUID from id

Instead of pulling up the entire entity.

* Add UserGroup2Permission table

* Fetch the new permissions when getting user groups

* Dont ToString int to parse it to a short

I'm pretty sure this is some way old migration type code that doesn't make any sense anymore

* Add new relation to GetDeleteClauses

* Persist the permissions

* Split UserGroupViewModel into multiple models

This is to make it possible to make endpoints more rest-ish

* Bootstrap create and update endpoints

* Make GetAllUserGroupController paged

* Add method to create IUserGroup from UserGroupSaveModel

* Add sanity check version of endpoint

* Fix persisting permissions

* Map section aliases to the name the frontend expects

This is a temporary fix till we find out how we really want to handle this

* Fix up post merge

* Make naming more consistent

* Implement initial update endpoint

* Fix media start node

* Clean name for XSS when mapping to IUserGroup

* Use a set instead of a list for permission names

We don't want dupes

* Make permission column nvarchar max

* Add UserGroupOperationStatuses

* Add IUserGroupAuthorizationService

* Add specific user group creation method to user service

* Move validating and authorizing into its own methods

* Add operation result to action result mapping

* Update create controller to use the create method

* Fix create end point

* Comment out getting current user untill we have auth

* Add usergroup service

* Obsolete usergroup things from IUserService

* Add update to UserGroupService interface

* User IUserGroupService in controllers

* User async notifications overloads

* Move authorize user group creation into its own service

* Add AuthorizeUserGroupUpdate method

* Make new service implementations internal and sealed

* Add update user

* Add GetAll to usergroup service

* Remove or obsolete usages of GetAllUserGroups

* Add usergroup service to DI

* Remove usage of GetGroupsByAlias

* Remove usages of GetUserGroupByAlias

* Remove usage of GetUserGroupById

* Add new table when creating a new database

* Implement Delete

* Add skip and take to getall

* Move skip take into the service

* Fixup suggestions in user group service

* Fixup unit tests

* Allow admins to change user groups they're not a part of

* Add CompatibilitySuppressions

* Update openapi

* Uppdate OpenApi.json

again

* Add missing compatibility suppression

* Added missing type info in ProducesResponseTypeAttribute

* Added INamedEntityViewModel and added on the relevant view models

* Fixed bug, resulting in serialization not being the same as swagger reported. Now all types objects implementing an interface, is serialized with the $type property

* updated OpenApi.json

* Added missing title in notfound response

* Typo

* .Result to .GetAwaiter().GetResult()

* Update comment to mention it should be implemented on CurrentUserController

* Validate that start nodes actually exists

* Handle not found consistently

* Use iso codes instead of ids

* Update OpenAPI

* Automatically infer statuscode in problemdetails

* Ensure that the language exists

* Fix usergroup 2 permission index

* Validate that group name and alias is not too long

* Only return status from validation

We're just returning the same usergroups, and this is less boilerplate code

* Handle empty and null group names

* Remove group prefix from statuses

* Add some basic validation tests

* Don't allow updating a usergroup to having a duplicate alias

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-16 09:39:17 +01:00
Callum Whyte
5ef43cb4f0 Rename StaticServiceProvider namespace Umbraco.Cms.Core.DependencyInjection (#13239) 2022-11-29 12:22:57 +01:00
Sebastiaan Janssen
db5d05d641 Revert files that shouldn't change back in v11 2022-09-19 16:37:24 +02:00
Sebastiaan Janssen
87c06f5f98 Back to 10.2.0-ish 2022-09-19 16:14:16 +02:00
Nikolaj Geisle
1b5225f4cd V11/feature/update to dotnet 7 (#12712)
* Update projects to .NET 7

* Fix nullability errors

* Fix up pipelines to run 7.0

* Update langversion to preview

* Revert "Fix up pipelines to run 7.0"

This reverts commit d0fa8d01b8126a4eaa59832a3814a567705419ae.

* Fix up pipelines again, this time without indentation changes

* Include preview versions

* Versions not Version

* Fix ModelTypeTests

* Fix MemberPasswordHasherTests

Microsoft wants to use SHA512 instead of SHA256, so our old hashes will return SuccessRehashNeeded now

* Use dotnet cli instead of nuget restore

* Update src/Umbraco.Web.UI/Umbraco.Web.UI.csproj

* Update dependencies

* Fix nullability issues

* Fix unit test

* Fix nullability in ChangingPasswordModel

OldPassword can be null, if we're changing the password with password reset enabled. Additionally, we might as well use the new required keyword instead of supressing null.

* Use required keyword instead of supressing null

* Fix up pipelines again

* fix up spelling-error

* Use dotnet cli instead of nuget restore

* Fix up another NuGet command

* Use dotnet version 7 before building

* Include preview versions

* Remove condition

* Use dotnet 7 before running powershell script

* Update templates to .net 7

* Download version 7 before running linux container

* Move use dotnet 7 even earlier in E2E process

* Remove dotnet 7

* Reintroduce .NET 7 task

* Update linux docker container and remove dotnet 7 from yml

* Fix up dockerfile with ARG

* Fix up docker file with nightly builds of dotnet 7

* Reintroduce dotnet 7 so windows can use it

* Use aspnet 7 in docker

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-08-23 11:31:05 +02:00
Bjarke Berg
e9f9b8aee1 merge v10 to v11 2022-08-18 14:38:49 +02:00
Nikolaj
838f4199c8 Only recreate token if it has changed. 2022-08-17 14:36:09 +02:00
Nikolaj
e2f5c93528 Ensure that LoginTokens gets marked as dirty
Might want to experiment with only removing/updating if the value is different
2022-08-16 15:47:01 +02:00
Nikolaj Geisle
b4fbad14c7 V11: cleanup obsoletes (#12481)
* Remove IExternalLoginService.cs

* Remove UmbracoApplicationComponentsInstallingNotification.cs

* Remove UmbracoApplicationMainDomAcquiredNotification.cs

* Merge IContentTypeWithHistoryCleanup with IContentType.cs

* Remove obsolete ctors from notifications

* Remove obsolete methods

* Remove obsolete method from RequestHandlerSettings.cs

* Fix UmbracoBuilder.Repositories.cs

* RemoveRemove obsolete constants

* Remove obsolete method from IRuntimeMinifier

* Remove SetLastLogin from IMemberRepository

* Revert "RemoveRemove obsolete constants"

This reverts commit cddb8ad1cf3d02bd9949d52bed91b45c8d2d66a9.

* Remove obsoleted Constants-Conventions.cs

* Remove obsolete ctors

* Make ContentData properties immutable

* remove obsolete static property from TestOptionAttributeBase

* Merge IMacroWithAliasService into IMacroService

* Remove IUserComposer

* remove obsolete AddOEmbedProvider method

* remove obsolete static EmbedProvidersCollectionBuilder

* remove obsolete HasFlagAll<T> method

* Remove obsolete LocalizedTextService property from BaseHttpHeaderCheck

* Remove obsolete GetDefaultFIleContent method from ViewHelper

* Remove more obsolete ctors and methods

* Remove obsolete ctor from RelationType

* Remove more obsolete methods

* Remove IExternalLoginRepository

* merge IMacroWithAliasRepository with IMacroRepository

* Remove obsolete methods from ExternalLoginRepository

* Remove obsolete method from IUserRepository

* Remove obsolete SetLastLogin, as it was NoOp

* Remove wierd SetLastLogin method from UserService

* Remove GetLogLevel from ILogViewer

* Remove more obsolete methods and ctors

* Remove more obsoletes

* Use other method in BackOfficeServerVariables.cs since GetAllTypes is now removed

* Remove obsolete ctor

* Remove ConfigureIISServerOptions

* Remove more obsolete methods

* Merge ITwoFactorLoginService2 with ITwoFactorLoginService

* Re-introduce GetCustomGenericProperties in MemberTabsAndPropertiesMapper.cs

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-06-07 11:16:30 +02:00
Nikolaj Geisle
f4e333c178 V10: fix build warnings infrastructure (#12369)
* Run code cleanup

* Run dotnet format

* Start manual fixes

* Manual fixing of warnings

* Fix nullability in columnalias

* Fix tests

* Fix up after merge

* Start updating after review

* Update editorconfig to contain new static & const rules

* Fix up editorconfig to not contain duplicate rules

* Fix up static member names

* Fix up according to review

* Update src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.DistributedCache.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/ContentIndexPopulator.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/ContentIndexPopulator.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/ContentValueSetValidator.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/ContentValueSetValidator.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/ContentValueSetValidator.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/ExamineUmbracoIndexingHandler.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Examine/PublishedContentIndexPopulator.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Extensions/InstanceIdentifiableExtensions.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Macros/MacroTagParser.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Macros/MacroTagParser.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Macros/MacroTagParser.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Migrations/Expressions/Alter/Table/IAlterTableColumnOptionBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_0_0/AddMemberPropertiesAsColumns.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Dtos/ExternalLoginDto.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/AccessMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/AuditEntryMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/MediaMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/MemberMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/PropertyGroupMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/PropertyGroupMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/PropertyTypeMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/PropertyTypeMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/RelationTypeMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Mappers/RelationTypeMapper.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/NPocoMapperCollectionBuilder.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Querying/ExpressionVisitorBase.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Fix [..] to substring

* Fix after merge with 10/dev

* Fox ContentValueSetValidator.cs

* Update LoggerConfigExtensions

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-06-02 08:18:31 +02:00
Nikolaj Geisle
882de44e38 Revert "Remove IExternalLoginService.cs"
This reverts commit 8b2557817b.
2022-05-23 10:33:32 +02:00
Nikolaj Geisle
8b2557817b Remove IExternalLoginService.cs 2022-05-23 10:26:54 +02:00
Andy Butland
735086a747 Further amends to NRT definitions (#12356)
* Ensured all GetContainers methods in IDataTypeService return non-nullable collections.

* Further amends to ensure services return non-nullable collections.

* Aligned nullability of IMediaService.GetMediaFileContentStream(string

* Removed return of nullable streams from IFileService.

* Fixed nullability mismatch.
2022-05-04 19:05:10 +02:00
Paul Johnson
95aa143db0 v10 make migration from v9 less painful WRT IScope (#12293)
* Restore IEventDispatcher

* Fix breaking changes WRT IScopeProvider and IScope

* Update internal usage.

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

* Better obsolete message

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-04-26 10:22:37 +01:00
Nikolaj Geisle
70a75d8c9b Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice
# Conflicts:
#	src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
#	src/Umbraco.Core/Models/Member.cs
#	src/Umbraco.Core/Models/Membership/User.cs
#	src/Umbraco.Core/Services/MemberService.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/MemberUserStore.cs
2022-04-22 12:32:57 +02:00
Mole
7df4f84247 V10: Migrate member properties to columns on the member table (#12205)
* Add new columns to the member table

* Add missing IsApproved column

* Add joins with nested query

* Add query for selecting new column values from existing members

* Update the member data from the same query

* Make escapes work for sqlite

* Use GetFieldNameForUpdate instead of GetFieldName

* Left join on memberDto

* Remove the now unused property types and data

* Don't create member columns as properties anymore

* Store old properties in fields on member

Also switch the dates to nullable since they can be null

* Map columns when mapping from DTO to Member object

* Display columns in the member content app

* Fix null exception when creating new user

* Hide value if user doesn't have access to sensitive data

* Remove hardcoded member properties

* Obsolete old member alias constants

* Map and persist member properties

* Correctly update LastLogin when member logs in

* Map IsApproved and IsLockedOut when saving member in backoffice

* Update the query mappers for members

* Fix member service tracks dirty changes test

* Remove no longer existing property types from member type builder

* Fix null error in UpdateMemberProperties

* Fix builder tests

* Fix SetupMemberTestData in MemberControllerUnitTests

* Let LastLoginDate be null and handle check in controller

There's no reason to default a perfectly nullable property to default(DateTime)

* Add translation key for is approved and use that instead of constant

* Obsolete old label constants

* Fix whitespace post merge

* Fix up test comments

* Apply suggestions from code review

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

* Fix member properties always being sensitive

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2022-04-21 14:47:27 +02:00
Nikolaj Geisle
060e0181a7 Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Core/Extensions/PublishedContentExtensions.cs
#	src/Umbraco.Core/Telemetry/Models/TelemetryReportData.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiUrlPickerValueConverter.cs
#	src/Umbraco.PublishedCache.NuCache/ContentStore.cs
#	src/Umbraco.Web.BackOffice/Trees/MemberTypeTreeController.cs
#	src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs
#	src/Umbraco.Web.Common/Security/MemberManager.cs
#	src/Umbraco.Web.Website/Routing/ControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/IControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformer.cs
2022-04-21 10:26:51 +02:00
Bjarke Berg
23a49161d6 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	build/build.ps1
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/dotnetcli.host.json
#	build/templates/UmbracoProject/.template.config/ide.host.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Umbraco.Core/Constants-System.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	umbraco-netcore-only.sln
2022-04-20 11:09:28 +02:00
Bjarke Berg
852305b7d1 Simplified setup of 2FA for users (#12142)
* Added functionality to enable 2FA for users..

* Do not use the obsolete ctor in tests

* cleanup

* Cleanup

* Convert User view from overlay to infinite editor

* Add support for having additional editors on top of the user (2fa) which overlay does not support
* Add controllerAs syntax in the template
* Remove unused dependencies

* Adjustments to 2fa login view

* organize elements
* add translations
* add a11y helpers
* add autocompletion = one-time-code
* change to controllerAs syntax

* add callback to cancel 2fa and fix error where submit button was not reset when all other validations were

* add a cancel/go back button to the 2fa view

* replace header with something less obstrusive

* move logout button to the footer in the new editor view

* change 'edit profile' to an umb-box and move ng-if for password fields out to reduce amount of checks

* Add umb-box to external login provider section

* add umb-box to user history section

* bug: fix bug where notificationsService would not allow new notifications if removeAll had been called

* add styling and a11y to configureTwoFactor view

- also ensure that the view reloads when changes happen in the custom user view to enable 2fa
- ensure that view updates when disabling 2fa
- add extra button to show options (disable) for each 2fa provider

* add notification when 2fa is disabled

* add data-element to support the intro tour

also changed a minor selector in the cypress test

* correct usage of umb-box with umb-box-content

* do not use the .form class twice to prevent double box-shadow

* make tranlastion for 2fa placeholder shorter

* ensure that field with 2fa provider is always visible when more than 1 provider

* move error state of 2fa field to token field

* update translation of multiple 2fa providers

* move CTA buttons to right side to follow general UI practices

* rename options to disable

* add disabled state

* add helper folders to gitignore so you can work with plugins and custom code without committing it accidentally

* move the disable functionality to its own infinite editor view

* use properties from umb-control-group correctly

* add 'track by' to repeater

* make use of umb-control-group

* remove unused functions

* clean up translations

* add Danish translations

* copy translations to english

* Only return enabled 2fa providers as expected

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-04-19 08:33:03 +02:00
Nikolaj Geisle
4571ecb0e3 More work on nullable reference types 2022-03-31 14:35:23 +02:00
Nikolaj Geisle
915e68e72e Fix last build errors 2022-02-28 13:14:02 +01:00
Nikolaj Geisle
2009f7585b Fix last build errors 2022-02-24 15:28:41 +01:00
Nikolaj Geisle
ed13237177 Fixing more errors with nullable reference types 2022-02-24 09:24:56 +01:00
Nikolaj Geisle
a8cf6ee127 More work on nullable references 2022-02-22 13:35:32 +01:00
Bjarke Berg
775bdff03b Fix after merge. 2022-01-23 15:26:17 +01:00
Bjarke Berg
e92abf7d51 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	.github/workflows/codeql-analysis.yml
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
2022-01-23 13:46:10 +01:00
Bjarke Berg
029a261476 Improve functionality for external member logins (#11855)
* Bugfix - Take ufprt from form data if the request has form content type, otherwise fallback to use the query

* External linking for members

* Changed migration to reuse old table

* removed unnecessary web.config files

* Cleanup

* Extracted class to own file

* Clean up

* Rollback changes to Umbraco.Web.UI.csproj

* Fixed migration for SqlCE

* Change notification handler to be on deleted

* Update src/Umbraco.Infrastructure/Security/MemberUserStore.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Fixed issue with errors not shown on member linking

* fixed issue with errors

* clean up

* Fix issue where external logins could not be used to upgrade Umbraco, because the externalLogin table was expected to look different. (Like after the migration)

* Fixed issue in Ignore legacy column now using result column.

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-01-19 09:21:50 +01:00
Bjarke Berg
7ba221be98 Merge remote-tracking branch 'origin/v9/dev' into v10/dev 2021-10-18 06:44:48 +02:00
Warren Buckley
243d0bba7b Implement IUserSessionStore<BackOfficeIdentityUser> to fix timeout bug #11350 (#11351) 2021-10-11 15:51:49 +02:00
Nikolaj Geisle
125247fddb Updated classes according to review
Signed-off-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2021-10-04 09:40:57 +02:00
Nikolaj Geisle
8ce66277ce Updated classes to use IOptionsMonitor or IOptionsSnapshot 2021-09-24 12:45:34 +02:00
Shannon
65cfc14cdb Fixes persisting the IsApproved for users 2021-09-21 08:56:10 -06:00
Bjarke Berg
25aae38a25 Explictly uses int.TryParse Invariant when the input is not from a user 2021-09-20 11:22:51 +02:00
Shannon
b939da3668 adds invited date to back office user 2021-07-26 11:51:54 -06:00
Bjarke Berg
b3a9730442 Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Cache/MediaCacheRefresher.cs
#	src/Umbraco.Core/Composing/ComponentCollection.cs
#	src/Umbraco.Core/Composing/Composers.cs
#	src/Umbraco.Core/Composing/TypeFinder.cs
#	src/Umbraco.Core/Composing/TypeLoader.cs
#	src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs
#	src/Umbraco.Core/Constants-SvgSanitizer.cs
#	src/Umbraco.Core/ContentApps/ContentAppFactoryCollection.cs
#	src/Umbraco.Core/Extensions/PublishedContentExtensions.cs
#	src/Umbraco.Core/Extensions/PublishedPropertyExtension.cs
#	src/Umbraco.Core/Extensions/StringExtensions.cs
#	src/Umbraco.Core/HealthChecks/Checks/Security/ExcessiveHeadersCheck.cs
#	src/Umbraco.Core/HealthChecks/HealthCheckResults.cs
#	src/Umbraco.Core/IO/FileSystems.cs
#	src/Umbraco.Core/IO/IOHelper.cs
#	src/Umbraco.Core/IO/MediaFileSystem.cs
#	src/Umbraco.Core/IO/PhysicalFileSystem.cs
#	src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs
#	src/Umbraco.Core/Logging/DisposableTimer.cs
#	src/Umbraco.Core/Logging/ILogger.cs
#	src/Umbraco.Core/Logging/LogProfiler.cs
#	src/Umbraco.Core/Logging/OwinLogger.cs
#	src/Umbraco.Core/Manifest/ManifestWatcher.cs
#	src/Umbraco.Core/Mapping/UmbracoMapper.cs
#	src/Umbraco.Core/Media/UploadAutoFillProperties.cs
#	src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
#	src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypes/PreValueMigratorCollection.cs
#	src/Umbraco.Core/Models/Mapping/ContentPropertyBasicMapper.cs
#	src/Umbraco.Core/Models/Mapping/DataTypeMapDefinition.cs
#	src/Umbraco.Core/Models/Mapping/MacroMapDefinition.cs
#	src/Umbraco.Core/Models/Member.cs
#	src/Umbraco.Core/Packaging/PackageActionRunner.cs
#	src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
#	src/Umbraco.Core/PropertyEditors/Validators/EyeDropperColorPickerConfigurationEditor.cs
#	src/Umbraco.Core/PropertyEditors/Validators/EyeDropperColorPickerPropertyEditor.cs
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
#	src/Umbraco.Core/Runtime/CoreRuntime.cs
#	src/Umbraco.Core/Runtime/MainDom.cs
#	src/Umbraco.Core/RuntimeState.cs
#	src/Umbraco.Core/Scoping/ScopeProvider.cs
#	src/Umbraco.Core/Sync/DatabaseServerMessenger.cs
#	src/Umbraco.Core/Templates/HtmlUrlParser.cs
#	src/Umbraco.Core/UriExtensions.cs
#	src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs
#	src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs
#	src/Umbraco.Infrastructure/Examine/IndexRebuilder.cs
#	src/Umbraco.Infrastructure/Manifest/DataEditorConverter.cs
#	src/Umbraco.Infrastructure/Manifest/ManifestParser.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs
#	src/Umbraco.Infrastructure/Migrations/MigrationPlan.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs
#	src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentRepositoryBase.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs
#	src/Umbraco.Infrastructure/Persistence/UmbracoDatabase.cs
#	src/Umbraco.Infrastructure/Persistence/UmbracoDatabaseFactory.cs
#	src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs
#	src/Umbraco.Infrastructure/PublishedCache/PublishedContentTypeCache.cs
#	src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs
#	src/Umbraco.Infrastructure/Scoping/Scope.cs
#	src/Umbraco.Infrastructure/Search/ExamineNotificationHandler.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Infrastructure/Services/Implement/LocalizedTextService.cs
#	src/Umbraco.Infrastructure/Services/Implement/LocalizedTextServiceFileSources.cs
#	src/Umbraco.Infrastructure/Services/Implement/MediaService.cs
#	src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs
#	src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs
#	src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComposer.cs
#	src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs
#	src/Umbraco.PublishedCache.NuCache/ContentStore.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Mapping/MappingTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/BuilderTests.cs
#	src/Umbraco.Tests/Composing/TypeLoaderTests.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/LegacyBackgroundTask/BackgroundTaskRunner.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs
#	src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs
#	src/Umbraco.Tests/Services/PerformanceTests.cs
#	src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs
#	src/Umbraco.Tests/Testing/TestingTests/MockTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs
#	src/Umbraco.Web.BackOffice/HealthChecks/HealthCheckController.cs
#	src/Umbraco.Web.BackOffice/PropertyEditors/RteEmbedController.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web.Common/Extensions/FormCollectionExtensions.cs
#	src/Umbraco.Web.Common/Install/InstallApiController.cs
#	src/Umbraco.Web.Common/Macros/MacroRenderer.cs
#	src/Umbraco.Web.Common/ModelsBuilder/PureLiveModelFactory.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/src/views/memberTypes/copy.controller.js
#	src/Umbraco.Web.UI.Client/src/views/memberTypes/copy.html
#	src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/config/splashes/noNodes.aspx
#	src/Umbraco.Web/AspNet/AspNetHttpContextAccessor.cs
#	src/Umbraco.Web/Cache/DistributedCacheBinder.cs
#	src/Umbraco.Web/Cache/DistributedCacheBinder_Handlers.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Editors/Binders/ContentModelBinderHelper.cs
#	src/Umbraco.Web/Editors/ContentControllerBase.cs
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/Editors/DictionaryController.cs
#	src/Umbraco.Web/Editors/MemberTypeController.cs
#	src/Umbraco.Web/Editors/PasswordChanger.cs
#	src/Umbraco.Web/Editors/RelationTypeController.cs
#	src/Umbraco.Web/Editors/TinyMceController.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs
#	src/Umbraco.Web/HtmlHelperRenderExtensions.cs
#	src/Umbraco.Web/HttpUrlHelperExtensions.cs
#	src/Umbraco.Web/HybridEventMessagesAccessor.cs
#	src/Umbraco.Web/ImageCropperTemplateExtensions.cs
#	src/Umbraco.Web/JavaScript/ClientDependencyConfiguration.cs
#	src/Umbraco.Web/Mvc/RenderMvcController.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
#	src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
#	src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs
#	src/Umbraco.Web/Routing/ContentFinderByIdPath.cs
#	src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs
#	src/Umbraco.Web/Routing/ContentFinderByUrl.cs
#	src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs
#	src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs
#	src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs
#	src/Umbraco.Web/Routing/PublishedRouter.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/Scheduling/KeepAlive.cs
#	src/Umbraco.Web/Scheduling/ScheduledPublishing.cs
#	src/Umbraco.Web/Scheduling/TempFileCleanup.cs
#	src/Umbraco.Web/Security/MembershipHelper.cs
#	src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs
#	src/Umbraco.Web/Trees/MemberTreeController.cs
#	src/Umbraco.Web/Trees/MemberTypeAndGroupTreeControllerBase.cs
#	src/Umbraco.Web/Trees/MemberTypeTreeController.cs
#	src/Umbraco.Web/UmbracoApplicationBase.cs
#	src/Umbraco.Web/UmbracoInjectedModule.cs
#	src/Umbraco.Web/UmbracoModule.cs
#	src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs
#	src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs
#	src/Umbraco.Web/WebApi/UnhandledExceptionLogger.cs
2021-04-20 19:34:18 +02:00
Shannon Deminick
6c660d5721 Security stamp implementation for members (#10140)
* Getting new netcore PublicAccessChecker in place

* Adds full test coverage for PublicAccessChecker

* remove PublicAccessComposer

* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller

* Implements the required methods on IMemberManager, removes old migrated code

* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops

* adds note

* adds note

* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.

* Changes name to IUmbracoEndpointBuilder

* adds note

* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect

* fixing build

* Updates user manager to correctly validate password hashing and injects the IBackOfficeUserPasswordChecker

* Merges PR

* Fixes up build and notes

* Implements security stamp and email confirmed for members, cleans up a bunch of repo/service level member groups stuff, shares user store code between members and users and fixes the user identity object so we arent' tracking both groups and roles.

* Security stamp for members is now working

* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.

* adds note

* removes unused filter, fixes build

* fixes WebPath and tests

* Looks up entities in one query

* remove usings

* Fix test, remove stylesheet

* Set status code before we write to response to avoid error

* Ensures that users and members are validated when logging in. Shares more code between users and members.

* merge changes

* oops

* Fixes RepositoryCacheKeys to ensure the keys are normalized

* oops didn't mean to commit this

* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy

* oops didn't mean to comit this

* bah, far out this keeps getting recommitted. sorry

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 09:13:40 +02:00
Shannon Deminick
a1624d26a3 Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place

* Adds full test coverage for PublicAccessChecker

* remove PublicAccessComposer

* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller

* Implements the required methods on IMemberManager, removes old migrated code

* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops

* adds note

* adds note

* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.

* Changes name to IUmbracoEndpointBuilder

* adds note

* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect

* fixing build

* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.

* adds note

* removes unused filter, fixes build

* fixes WebPath and tests

* Looks up entities in one query

* remove usings

* Fix test, remove stylesheet

* Set status code before we write to response to avoid error

* Ensures that users and members are validated when logging in. Shares more code between users and members.

* Fixes RepositoryCacheKeys to ensure the keys are normalized

* oops didn't mean to commit this

* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy

* bah, far out this keeps getting recommitted. sorry

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 07:11:45 +02:00
Shannon
8ea88a980a Fixes anti-forgery, fixes tempdata, adds front-end security/identity, gets member macro snippets and controllers all working, removes old code, adds more props to the member identity 2021-04-09 15:24:12 +10:00
Shannon
e4807c2430 New table and service to store auth tokens
Implements the auth token retrieval and storage for the identity implementation. This is now automatically done for providers and the back office user manager can be used to retreive and store all tokens.

Fixes locking on the config writer.

Removes the abstract NodeObjectTypeId from the base repo since it shouldn't be there.
2021-03-11 19:35:43 +11:00
Bjarke Berg
37ed84871a Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Cache/CacheKeys.cs
#	src/Umbraco.Core/Composing/TypeFinder.cs
#	src/Umbraco.Core/Configuration/GlobalSettings.cs
#	src/Umbraco.Core/Configuration/GlobalSettingsExtensions.cs
#	src/Umbraco.Core/Configuration/IGlobalSettings.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/ContentSectionExtensions.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/Editors/UserEditorAuthorizationHelper.cs
#	src/Umbraco.Core/Extensions/StringExtensions.cs
#	src/Umbraco.Core/Extensions/UriExtensions.cs
#	src/Umbraco.Core/IO/IOHelper.cs
#	src/Umbraco.Core/IO/PhysicalFileSystem.cs
#	src/Umbraco.Core/Media/Exif/MathEx.cs
#	src/Umbraco.Core/Media/UploadAutoFillProperties.cs
#	src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs
#	src/Umbraco.Core/Models/Membership/User.cs
#	src/Umbraco.Core/Models/UserExtensions.cs
#	src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs
#	src/Umbraco.Core/PropertyEditors/ListViewConfiguration.cs
#	src/Umbraco.Core/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
#	src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs
#	src/Umbraco.Core/Routing/AliasUrlProvider.cs
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
#	src/Umbraco.Core/Routing/UriUtility.cs
#	src/Umbraco.Core/Routing/UrlProviderExtensions.cs
#	src/Umbraco.Core/Runtime/CoreRuntime.cs
#	src/Umbraco.Core/RuntimeOptions.cs
#	src/Umbraco.Core/RuntimeState.cs
#	src/Umbraco.Core/Security/BackOfficeUserStore.cs
#	src/Umbraco.Core/Security/ContentPermissions.cs
#	src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
#	src/Umbraco.Core/Trees/TreeNode.cs
#	src/Umbraco.Core/Udi.cs
#	src/Umbraco.Examine.Lucene/BackOfficeExamineSearcher.cs
#	src/Umbraco.Examine/Umbraco.Examine.csproj
#	src/Umbraco.Infrastructure/Examine/ContentValueSetValidator.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs
#	src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
#	src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs
#	src/Umbraco.Infrastructure/Scoping/Scope.cs
#	src/Umbraco.Infrastructure/Search/ExamineComponent.cs
#	src/Umbraco.Infrastructure/Security/IdentityMapDefinition.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Infrastructure/Services/Implement/MediaService.cs
#	src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs
#	src/Umbraco.Persistence.SqlCe/SqlCeSyntaxProvider.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Models/UserExtensionsTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Examine/UmbracoContentValueSetValidatorTests.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config
#	src/Umbraco.Tests/TestHelpers/SettingsForTests.cs
#	src/Umbraco.Tests/Testing/TestDatabase.cs
#	src/Umbraco.Tests/Web/Controllers/ContentControllerUnitTests.cs
#	src/Umbraco.Tests/Web/Controllers/FilterAllowedOutgoingContentAttributeTests.cs
#	src/Umbraco.Tests/Web/Controllers/MediaControllerUnitTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs
#	src/Umbraco.Web.BackOffice/Controllers/TourController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UserGroupEditorAuthorizationHelper.cs
#	src/Umbraco.Web.BackOffice/Filters/FilterAllowedOutgoingContentAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/FilterAllowedOutgoingMediaAttribute.cs
#	src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web.BackOffice/Trees/FileSystemTreeController.cs
#	src/Umbraco.Web.BackOffice/Trees/MediaTreeController.cs
#	src/Umbraco.Web.Common/Extensions/FormCollectionExtensions.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publish.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/config/umbracoSettings.Release.config
#	src/Umbraco.Web/Cache/MemberCacheRefresher.cs
#	src/Umbraco.Web/Composing/ModuleInjector.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Editors/Binders/ContentModelBinderHelper.cs
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/Editors/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web/Editors/Filters/MediaItemSaveValidationAttribute.cs
#	src/Umbraco.Web/Editors/Filters/UserGroupAuthorizationAttribute.cs
#	src/Umbraco.Web/Editors/TinyMceController.cs
#	src/Umbraco.Web/Editors/UserGroupsController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
#	src/Umbraco.Web/ImageCropperTemplateExtensions.cs
#	src/Umbraco.Web/Logging/WebProfiler.cs
#	src/Umbraco.Web/Logging/WebProfilerProvider.cs
#	src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
#	src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs
#	src/Umbraco.Web/Mvc/JsonNetResult.cs
#	src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs
#	src/Umbraco.Web/Mvc/RenderRouteHandler.cs
#	src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
#	src/Umbraco.Web/RoutableDocumentFilter.cs
#	src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs
#	src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs
#	src/Umbraco.Web/Routing/PublishedRouter.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/Scheduling/KeepAlive.cs
#	src/Umbraco.Web/Security/AppBuilderExtensions.cs
#	src/Umbraco.Web/Security/BackOfficeClaimsIdentityFactory.cs
#	src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs
#	src/Umbraco.Web/Trees/DictionaryTreeController.cs
#	src/Umbraco.Web/Trees/LanguageTreeController.cs
#	src/Umbraco.Web/Trees/LogViewerTreeController.cs
#	src/Umbraco.Web/Trees/PackagesTreeController.cs
#	src/Umbraco.Web/UmbracoApplication.cs
#	src/Umbraco.Web/UmbracoApplicationBase.cs
#	src/Umbraco.Web/UmbracoInjectedModule.cs
#	src/Umbraco.Web/WebApi/Filters/AdminUsersAuthorizeAttribute.cs
#	src/Umbraco.Web/WebApi/Filters/CheckIfUserTicketDataIsStaleAttribute.cs
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs
#	src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs
2021-03-05 15:36:27 +01:00