Merge branch 'netcore/dev' into netcore/feature/users

This commit is contained in:
Scott Brady
2020-04-16 09:41:27 +01:00
1011 changed files with 18536 additions and 10369 deletions

View File

@@ -15,7 +15,7 @@ using Umbraco.Web;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
using Umbraco.Tests.Common;
namespace Umbraco.Tests.Security
{
@@ -34,15 +34,16 @@ namespace Umbraco.Tests.Security
var umbracoContext = new UmbracoContext(
httpContextAccessor,
Mock.Of<IPublishedSnapshotService>(),
new WebSecurity(httpContextAccessor, ServiceContext.UserService, globalSettings, IOHelper), globalSettings,
new WebSecurity(httpContextAccessor, ServiceContext.UserService, globalSettings, HostingEnvironment),
globalSettings,
HostingEnvironment,
new TestVariationContextAccessor(),
IOHelper,
UriUtility,
new AspNetCookieManager(httpContextAccessor));
var runtime = Mock.Of<IRuntimeState>(x => x.Level == RuntimeLevel.Install);
var mgr = new BackOfficeCookieManager(
Mock.Of<IUmbracoContextAccessor>(accessor => accessor.UmbracoContext == umbracoContext), runtime, TestObjects.GetGlobalSettings(), IOHelper, AppCaches.RequestCache);
Mock.Of<IUmbracoContextAccessor>(accessor => accessor.UmbracoContext == umbracoContext), runtime, HostingEnvironment, globalSettings, AppCaches.RequestCache);
var result = mgr.ShouldAuthenticateRequest(Mock.Of<IOwinContext>(), new Uri("http://localhost/umbraco"));
@@ -57,15 +58,15 @@ namespace Umbraco.Tests.Security
var umbCtx = new UmbracoContext(
httpContextAccessor,
Mock.Of<IPublishedSnapshotService>(),
new WebSecurity(httpContextAccessor, ServiceContext.UserService, globalSettings, IOHelper),
new WebSecurity(httpContextAccessor, ServiceContext.UserService, globalSettings, HostingEnvironment),
globalSettings,
HostingEnvironment,
new TestVariationContextAccessor(),
IOHelper,
UriUtility,
new AspNetCookieManager(httpContextAccessor));
var runtime = Mock.Of<IRuntimeState>(x => x.Level == RuntimeLevel.Run);
var mgr = new BackOfficeCookieManager(Mock.Of<IUmbracoContextAccessor>(accessor => accessor.UmbracoContext == umbCtx), runtime, TestObjects.GetGlobalSettings(), IOHelper, AppCaches.RequestCache);
var mgr = new BackOfficeCookieManager(Mock.Of<IUmbracoContextAccessor>(accessor => accessor.UmbracoContext == umbCtx), runtime, HostingEnvironment, globalSettings, AppCaches.RequestCache);
var request = new Mock<OwinRequest>();
request.Setup(owinRequest => owinRequest.Uri).Returns(new Uri("http://localhost/umbraco"));

View File

@@ -14,14 +14,6 @@ namespace Umbraco.Tests.Security
[TestFixture]
public class PasswordSecurityTests
{
[Test]
public void Get_Hash_Algorithm_Legacy()
{
var passwordSecurity = new PasswordSecurity(Mock.Of<IPasswordConfiguration>(x => x.UseLegacyEncoding == true && x.HashAlgorithmType == "HMACSHA256"));
var alg = passwordSecurity.GetHashAlgorithm("blah");
Assert.IsTrue(alg is HMACSHA1);
}
[Test]
public void Get_Hash_Algorithm_Default()
{