Commit Graph

63 Commits

Author SHA1 Message Date
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
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
Paul Johnson
aec25d5007 Replace Composition with UmbracoBuilder 2020-11-18 17:41:57 +00:00
Bjarke Berg
e46a248832 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Infrastructure/HostedServices/ScheduledPublishing.cs
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComposer.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests/Testing/UmbracoTestBase.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeApplicationBuilderExtensions.cs
#	src/Umbraco.Web.BackOffice/Runtime/BackOfficeComposer.cs
#	src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs
#	src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs
#	src/Umbraco.Web.UI.NetCore/appsettings.json
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Runtime/WebInitialComponent.cs
2020-11-12 13:10:19 +01:00
Paul Johnson
3f5f85880e NetCore: MSDI refactor split CoreRuntime & Remove Current (#9356)
* Split Bootstrap code from CoreRuntime

* Make ContentService method signatures match interface
prevents need to hide the concrete class in tests

* Remove Current

Only bit that bugs me is TreeNode for IconFilePath
I get the feeling it's dead code, but can just use a setter in cs or work out path in js if required.

* Fix tests, remember to terminate IRuntime
2020-11-10 09:50:47 +01:00
Bjarke Berg
a6ef907427 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/bugfix/azure-devops-tests 2020-10-26 16:26:59 +01:00
Bjarke Berg
b47f946ffe Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
2020-10-26 14:34:06 +01:00
Paul Johnson
a99f625f6a Netcore: Alternate approach for MSDI refactor (#9247)
* Doesn't make much sense to have Concrete on IRegister, only on IFactory

* Handle FilesTreeController requires IFileSystem of type PhysicalFileSystem

* Handle registration of default MediaFileSystem without using RegisterUniqueFor

* Remove RegisterFor / RegisterUniqueFor from IRegister

* Switch over from LightInject to wrappers around MSDI

* Made mapper dependencies more explicit

* Remove registration for AngularJsonMediaTypeFormatter

It's dependencies aren't registered so container validation fails

* Resolve lifetime issue for EnsureValidSessionId by service locating

else resolve scoped in singleton

* Make registration more explicit for backoffice UserManager

* Make install step registrations more explicit

* Disable service provider validation so site can launch

Maybe this is a problem maybe not, we build about 8000 service providers so maybe everything is fine later...

* Further cleanup of IFactory interface

* Further cleanup of IRegister interface

* Revert "Make registration more explicit for backoffice UserManager"

This reverts commit 7215fe836103c597cd0873c66737a79b91ed4c49.

* Resolve issue where NewInstallStep would fail to reset password for "SuperUser"

Before MSDI, somehow BackOfficeIdentityOptions would be configured with token provider map from IdentityBuilder.AddDefaultTokenProviders.
After switchover those config actions are lost.

Subclass IdentityBuilder to ensure BackOfficeIdentityOptions doesn't miss config setup upstream.

* Initialize current.

* Add todo to turn container validation back on.

* Migrated ScopeFileSystemsTests to integration tests

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Resolve issue where MediaFileSystem was skipping ShadowFileSystem

* Attempt to fix ScopeFileSystemsTests on azure devops

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Be interesting to know what the actual full path is in pipeline.

* Clarify intent of CreateMediaTest

Doesn't help resolve weird UnauthorizedAccessException but it cuts so much cognitive overhead for the future.

* Use ILoggerfactory rather than mock for the manually constructed file PhysicalFileSystem

* Maybe resolve failing test on azure pipeline.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-26 11:47:14 +01:00
Shannon
d1b35deb43 Migrates remaining backofficecontroller but still a bunch of work to do , streamlines Backoffice to BackOffice (but is that what we want?) 2020-10-21 16:51:00 +11:00
Bjarke Berg
7b5012e00a Debug info for tests, to debug on Azure Devops
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-16 09:54:03 +02:00
Bjarke Berg
375a85903f Changed the UmbracoIntegrationTest setup to be sync, to avoid issue with AsyncLocal
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-05 10:02:11 +02:00
Bjarke Berg
3607dd14f1 Clean up + Removed old SignalR code
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-01 07:09:54 +02:00
Mole
cbdb96dfe6 Add SignalR in integration tests 2020-09-30 14:27:18 +02:00