Commit Graph

74 Commits

Author SHA1 Message Date
Shannon
1ef5290576 Updates runtime hash calc to be based on the assemblies returned from the assembly provider. 2021-07-09 14:50:37 -06:00
Shannon Deminick
eba6373a12 Examine 2.0 integration (#10241)
* Init commit for examine 2.0 work, most old umb examine tests working, probably a lot that doesn't

* Gets Umbraco Examine tests passing and makes some sense out of them, fixes some underlying issues.

* Large refactor, remove TaskHelper, rename Notifications to be consistent, Gets all examine/lucene indexes building and startup ordered in the correct way, removes old files, creates new IUmbracoIndexingHandler for abstracting out all index operations for umbraco data, abstracts out IIndexRebuilder, Fixes Stack overflow with LiveModelsProvider and loading assemblies, ports some changes from v8 for startup handling with cold boots, refactors out LastSyncedFileManager

* fix up issues with rebuilding and management dashboard.

* removes old files, removes NetworkHelper, fixes LastSyncedFileManager implementation to ensure the machine name is used, fix up logging with cold boot state.

* Makes MainDom safer to use and makes PublishedSnapshotService lazily register with MainDom

* lazily acquire application id (fix unit tests)

* Fixes resource casing and missing test file

* Ensures caches when requiring internal services for PublishedSnapshotService, UseNuCache is a separate call, shouldn't be buried in AddWebComponents, was also causing issues in integration tests since nucache was being used for the Id2Key service.

* For UmbracoTestServerTestBase enable nucache services

* Fixing tests

* Fix another test

* Fixes tests, use TestHostingEnvironment, make Tests.Common use net5, remove old Lucene.Net.Contrib ref.

* Fixes up some review notes

* Fixes issue with doubly registering PublishedSnapshotService meanig there could be 2x instances of it

* Checks for parseexception when executing the query

* Use application root instead of duplicating functionality.

* Added Examine project to netcore only solution file

* Fixed casing issue with LazyLoad, that is not lowercase.

* uses cancellationToken instead of bool flag, fixes always reading lastId from the LastSyncedFileManager, fixes RecurringHostedServiceBase so that there isn't an overlapping thread for the same task type

* Fix tests

* remove legacy test project from solution file

* Fix test

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-05-18 10:31:38 +02:00
Shannon Deminick
39aeec0f1f Implement password config storage for members (#10170)
* 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

* Reducing and removing published member cache

* 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

* cannot inject IPublishedMemberCache and cannot have IPublishedMember

* splits out files, fixes build

* fix tests

* removes membership provider classes

* removes membership provider classes

* updates the identity map definition

* reverts commented out lines

* reverts commented out lines

* Implements members Password config in db, fixes members cookie auth to not interfere with the back office cookie auth, fixes Startup sequence, fixes startup pipeline

* commits change to Startup

* Rename migration from `MemberTableColumns2` to `AddPasswordConfigToMemberTable`

* Fix test

* Fix tests, but adding default passwordConfig to members

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-22 15:59:13 +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
ecbd6d1c81 Adds better support for app_plugins loading assets in a safer way and without having to pass refs 2021-03-16 19:19:03 +11:00
Shannon
e993410d2c Merge branch 'netcore/bug/minify-plugins' of https://github.com/kjac/Umbraco-CMS into kjac-netcore/bug/minify-plugins
# Conflicts:
#	src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilderExtensions.cs
2021-03-16 17:22:25 +11:00
Shannon
d72c11821f Merge remote-tracking branch 'origin/netcore/dev' into netcore/bugfix/10196-ambient-scope
# Conflicts:
#	src/Umbraco.Core/HybridAccessorBase.cs
#	src/Umbraco.Core/Security/IBackOfficeSecurityFactory.cs
#	src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.Common/Security/BackofficeSecurityFactory.cs
2021-03-04 16:57:32 +11:00
Shannon
ed5116664f kill IBackOfficeSecurityFactory and fix the broken dependency chain 2021-03-04 15:07:54 +11:00
Shannon
089d147917 Fix namespaces 2021-03-04 14:49:19 +11:00
Bjarke Berg
1c50ece986 Use c#9 + namespace fix 2021-03-02 16:20:44 +01:00
Shannon
6148336d04 Adds new event so we know when umbraco routes a value, ensure the IUmbracoWebsiteSecurity is initialized for front-end requests, cleans up some of the routing middleware, adds lots of notes 2021-03-01 12:51:07 +11:00
Emma Garland
2109bee83b Merge branch 'netcore/dev' into netcore/members-userstore
# Conflicts:
#	src/Umbraco.Core/Models/Membership/IMembershipUser.cs
#	src/Umbraco.Core/Models/Membership/IUser.cs
#	src/Umbraco.Core/Services/IMembershipRoleService.cs
#	src/Umbraco.Infrastructure/Compose/AuditEventsComponent.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.MappingProfiles.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
#	src/Umbraco.Infrastructure/Install/InstallSteps/NewInstallStep.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/IBackOfficeUserPasswordChecker.cs
#	src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs
#	src/Umbraco.Infrastructure/Security/IdentityMapDefinition.cs
#	src/Umbraco.Infrastructure/Security/SignOutAuditEventArgs.cs
#	src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
#	src/Umbraco.Infrastructure/Services/Implement/MemberService.cs
#	src/Umbraco.Tests.Integration/TestServerTest/TestAuthHandler.cs
#	src/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UmbracoBackOfficeServiceCollectionExtensionsTests.cs
#	src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactoryTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeLookupNormalizerTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/NoOpLookupNormalizerTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/UsersControllerTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/DependencyInjection/ServiceCollectionExtensions.cs
#	src/Umbraco.Web.BackOffice/Filters/CheckIfUserTicketDataIsStaleAttribute.cs
#	src/Umbraco.Web.BackOffice/Mapping/MemberMapDefinition.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficePasswordHasher.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSecurityStampValidator.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSessionIdValidator.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeUserManagerAuditer.cs
#	src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeIdentityOptions.cs
#	src/Umbraco.Web.BackOffice/Security/ExternalSignInAutoLinkOptions.cs
#	src/Umbraco.Web.BackOffice/Security/IBackOfficeSignInManager.cs
#	src/Umbraco.Web.BackOffice/Security/PasswordChanger.cs
#	src/Umbraco.Web.Common/DependencyInjection/ServiceCollectionExtensions.cs
#	src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs
#	src/Umbraco.Web.Common/Security/BackOfficeUserManager.cs
#	src/Umbraco.Web/Security/MembershipHelper.cs
#	src/Umbraco.Web/Security/MembershipProviderBase.cs
#	src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs
#	src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs
#	src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs
2021-02-22 20:55:12 +00:00
Kenn Jacobsen
da0b869229 Merged with netcore/dev 2021-02-18 14:21:57 +01:00
Kenn Jacobsen
f5f6824629 Allow serving App_Plugins files to Smidge for minification 2021-02-18 14:07:24 +01:00
Mole
bf41c2eeaa Netcore: Align namespaces (#9801)
* Rename Umbraco.Core namespace to Umbraco.Cms.Core

* Move extension methods in core project to Umbraco.Extensions

* Move extension methods in core project to Umbraco.Extensions

* Rename Umbraco.Examine namespace to Umbraco.Cms.Examine

* Move examine extensions to Umbraco.Extensions namespace

* Reflect changed namespaces in Builder and fix unit tests

* Adjust namespace in Umbraco.ModelsBuilder.Embedded

* Adjust namespace in Umbraco.Persistence.SqlCe

* Adjust namespace in Umbraco.PublishedCache.NuCache

* Align namespaces in Umbraco.Web.BackOffice

* Align namespaces in Umbraco.Web.Common

* Ensure that SqlCeSupport is still enabled after changing the namespace

* Align namespaces in Umbraco.Web.Website

* Align namespaces in Umbraco.Web.UI.NetCore

* Align namespaces in Umbraco.Tests.Common

* Align namespaces in Umbraco.Tests.UnitTests

* Align namespaces in Umbraco.Tests.Integration

* Fix errors caused by changed namespaces

* Fix integration tests

* Undo the Umbraco.Examine.Lucene namespace change

This breaks integration tests on linux, since the namespace wont exists there because it's only used on windows.

* Fix merge

* Fix Merge
2021-02-18 11:06:02 +01:00
Emma Garland
19fcbf80f4 Merge branch 'netcore/dev' into netcore/members-userstore 2021-02-09 13:22:40 +00:00
Shannon
2f97265bc0 Moves controller integration tests into correct namespace 2021-02-02 14:46:46 +11:00
Emma Garland
9ba78497a0 Merge branch 'netcore/netcore' into netcore/members-userstore
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/TestAuthHandler.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs
2021-01-19 15:29:40 +00:00
Bjarke Berg
6310ca31e3 Merge remote-tracking branch 'origin/netcore/netcore' into feature/clean-up-umbraco-integration-tests
# Conflicts:
#	src/Umbraco.Tests.Integration/DependencyInjection/UmbracoBuilderExtensions.cs
#	src/Umbraco.Tests.Integration/RuntimeTests.cs
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoBuilderExtensions.cs
#	src/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs
#	src/Umbraco.Tests.Integration/Umbraco.Core/Mapping/UmbracoMapperTests.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedRepositoryTests.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs
2021-01-18 07:34:59 +01:00
Emma Garland
ba317b24dc Merge branch 'netcore/netcore' into netcore/members-userstore
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentControllerBase.cs
#	src/Umbraco.Web.BackOffice/Extensions/UmbracoBuilderExtensions.cs
2021-01-04 17:04:05 +00:00
Shannon
4ce5dc8eff fixing tests 2021-01-04 11:32:36 +11:00
Andy Butland
cd5f5778ee Applied linting rules to tests within the Umbraco.Tests.Integration project. 2020-12-24 08:39:18 +01:00
Shannon
1a0d961e42 removes WebsiteComposer, BackOfficeComposer 2020-12-24 18:11:16 +11:00
Shannon
91486bbede Removes IServerRegistrar, new IServerRoleAccessor, removes more composers, moves more to ext, 2020-12-24 16:35:59 +11:00
Shannon
e785ac28a3 Moves more services and registrations "up", removes AspNetCoreComposer logic and moves to AddWebComponents 2020-12-24 14:29:26 +11:00
Shannon
d5a19530f3 Fixing tests, more DependencyInjection namespace 2020-12-23 13:06:22 +11:00
Shannon
7115e0a11e shuffles code with DependencyInjection namespace, forgot to commit changes to Startup 2020-12-23 12:02:01 +11:00
Shannon
f5e9441e9f renames umb builder ext class to be more explicit, no more AddAllBackOfficeComponents, just AddBackOffice, removes NuCacheComposer 2020-12-22 12:16:37 +11:00
Shannon
86adf01f88 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/front-end-routing
# Conflicts:
#	src/Umbraco.PublishedCache.NuCache/PublishedSnapshotService.cs
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs
#	src/Umbraco.Web.Common/Extensions/ApplicationBuilderExtensions.cs
2020-12-21 16:04:42 +11:00
Shannon
75796e3eae Fixing tests, removing old files, adds notes 2020-12-21 15:58:47 +11:00
Paul Johnson
a883df9d88 Use HostBuilder.UseUmbraco in same order for tests and running web app 2020-12-17 12:44:09 +00:00
Paul Johnson
6dd5e04a2b Fix broken integration test, must set ServiceProvider before using 2020-12-17 11:19:47 +00:00
Paul Johnson
431403e372 Fixup CoreRuntime so it starts after Startup.Configure
Makes integration tests play nice with Components as RuntimeLevel will be correct
2020-12-17 11:19:47 +00:00
Paul Johnson
a69739a7a2 Remove CoreInitialComponent 2020-12-17 11:17:46 +00:00
Shannon
cc1404747b Changes PublishedSnapshotService to lazily load it's caches on demand when they are required instead of relying on an external initializer to load them. 2020-12-17 16:27:28 +11:00
Paul Johnson
312ab96277 Resolve issues with AdvancedMigrationTests 2020-12-11 19:04:39 +00:00
Emma Garland
2f7766a972 Updated correct class, commented 2020-12-08 11:25:01 +00:00
emmagarland
0560bef48c Merge branch 'netcore/netcore' into netcore/members-userstore 2020-12-05 18:14:09 +00:00
Emma Garland
9c41d335ea Merge branch 'netcore/netcore' into netcore/members-userstore
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web.BackOffice/Extensions/UmbracoBuilderExtensions.cs
2020-12-01 17:37:23 +00:00
James Jackson-South
0369375d8e Merge branch 'netcore/netcore' into netcore/feature/9397 2020-12-01 12:44:10 +00:00
James Jackson-South
748cbb1f7b Normalize builder namespace 2020-12-01 12:42:14 +00:00
emmagarland
5b4b948543 Added more layers to have a vertical slice through Umbraco for CreateMember via backoffice.
Still lots to implement and test, not complete and needs early review.
2020-11-30 00:45:38 +00:00
Shannon
8e15e265fd Adds TODOs, puts back UmbracoRequireHttpsAttribute but in a nicer way, ensures test classes initialize the authz policies with the test scheme 2020-11-26 16:52:03 +11:00
Paul Johnson
5268f9d7f0 Resolve review comments 2020-11-24 09:37:52 +00:00
Paul Johnson
a62079d794 Use OptionsMonitorAdapter over AspNetCoreHostingEnvironmentWithoutOptionsMonitor
Rollback Serilog setup as I broke BASEDIR env var
2020-11-23 10:27:13 +00:00
Paul Johnson
0241649f7f Cleanup AddUmbraco & AddUmbracoCore 2020-11-21 15:22:24 +00:00
Paul Johnson
39657dea6d UmbracoBuilder now requires TypeLoader via ctor 2020-11-20 12:18:25 +00:00
Paul Johnson
8b97ce69b1 Removed CoreRuntimeBootstrapper
Establish runtime level at run time not during service registration.
2020-11-19 20:21:45 +00:00
Paul Johnson
3672a9f2f2 Add composers via extension on UmbracoBuilder
reduce scope of CoreRuntimeBootstrapper
2020-11-19 16:20:39 +00:00
Paul Johnson
48b61ec4c4 Simplify UmbracoBuilder setup 2020-11-19 09:12:39 +00:00