Add InProc ANCM support and react to deployer changes.
This commit is contained in:
parent
664649bda9
commit
3ffb75f896
|
|
@ -5,6 +5,7 @@
|
||||||
<PropertyGroup Label="Package Versions">
|
<PropertyGroup Label="Package Versions">
|
||||||
<MicrosoftAspNetCoreAllPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAllPackageVersion>
|
<MicrosoftAspNetCoreAllPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAllPackageVersion>
|
||||||
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
||||||
|
<MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
|
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>
|
||||||
|
|
@ -19,7 +20,8 @@
|
||||||
<MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>
|
<MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>
|
||||||
<MicrosoftAspNetCorePackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCorePackageVersion>
|
<MicrosoftAspNetCorePackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCorePackageVersion>
|
||||||
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreServerHttpSysPackageVersion>
|
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreServerHttpSysPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-preview1-34326</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
<MicrosoftAspNetCoreServerIISPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreServerIISPackageVersion>
|
||||||
|
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-a-preview1-tratcher-exp-17051</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
||||||
<MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreSessionPackageVersion>
|
<MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreSessionPackageVersion>
|
||||||
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
||||||
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34326</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,24 @@ using System.IO;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
|
||||||
namespace MusicStore.Mocks.OpenIdConnect
|
namespace MusicStore.Mocks.OpenIdConnect
|
||||||
{
|
{
|
||||||
internal class OpenIdConnectBackChannelHttpHandler : HttpMessageHandler
|
internal class OpenIdConnectBackChannelHttpHandler : HttpMessageHandler
|
||||||
{
|
{
|
||||||
|
private IHostingEnvironment _env;
|
||||||
|
|
||||||
|
public OpenIdConnectBackChannelHttpHandler(IHostingEnvironment env)
|
||||||
|
{
|
||||||
|
_env = env;
|
||||||
|
}
|
||||||
|
|
||||||
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var response = new HttpResponseMessage();
|
var response = new HttpResponseMessage();
|
||||||
|
|
||||||
var basePath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "ForTesting", "Mocks", "OpenIdConnect"));
|
var basePath = Path.GetFullPath(Path.Combine(_env.ContentRootPath, "ForTesting", "Mocks", "OpenIdConnect"));
|
||||||
|
|
||||||
if (request.RequestUri.AbsoluteUri == "https://login.windows.net/[tenantName].onmicrosoft.com/.well-known/openid-configuration")
|
if (request.RequestUri.AbsoluteUri == "https://login.windows.net/[tenantName].onmicrosoft.com/.well-known/openid-configuration")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,11 @@ namespace MusicStore
|
||||||
|
|
||||||
Configuration = builder.Build();
|
Configuration = builder.Build();
|
||||||
_platform = new Platform();
|
_platform = new Platform();
|
||||||
|
Env = env;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IConfiguration Configuration { get; private set; }
|
public IConfiguration Configuration { get; private set; }
|
||||||
|
public IHostingEnvironment Env { get; }
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
|
@ -66,7 +68,7 @@ namespace MusicStore
|
||||||
{
|
{
|
||||||
options.Authority = "https://login.windows.net/[tenantName].onmicrosoft.com";
|
options.Authority = "https://login.windows.net/[tenantName].onmicrosoft.com";
|
||||||
options.ClientId = "c99497aa-3ee2-4707-b8a8-c33f51323fef";
|
options.ClientId = "c99497aa-3ee2-4707-b8a8-c33f51323fef";
|
||||||
options.BackchannelHttpHandler = new OpenIdConnectBackChannelHttpHandler();
|
options.BackchannelHttpHandler = new OpenIdConnectBackChannelHttpHandler(Env);
|
||||||
options.StringDataFormat = new CustomStringDataFormat();
|
options.StringDataFormat = new CustomStringDataFormat();
|
||||||
options.StateDataFormat = new CustomStateDataFormat();
|
options.StateDataFormat = new CustomStateDataFormat();
|
||||||
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
|
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
|
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
|
||||||
<PackageReference Include="Microsoft.AspNetCore.AspNetCoreModule" Version="$(MicrosoftAspNetCoreAspNetCoreModulePackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.AspNetCoreModule" Version="$(MicrosoftAspNetCoreAspNetCoreModulePackageVersion)" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.AspNetCoreModuleV2" Version="$(MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp' AND '$(Configuration)' == 'RuntimeStore' ">
|
<ItemGroup Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp' AND '$(Configuration)' == 'RuntimeStore' ">
|
||||||
|
|
@ -35,6 +36,7 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" PrivateAssets="All" Version="$(MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" PrivateAssets="All" Version="$(MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.HttpSys" Version="$(MicrosoftAspNetCoreServerHttpSysPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.HttpSys" Version="$(MicrosoftAspNetCoreServerHttpSysPackageVersion)" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Server.IIS" Version="$(MicrosoftAspNetCoreServerIISPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Session" Version="$(MicrosoftAspNetCoreSessionPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Session" Version="$(MicrosoftAspNetCoreSessionPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(MicrosoftEntityFrameworkCoreInMemoryPackageVersion)" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(MicrosoftEntityFrameworkCoreInMemoryPackageVersion)" />
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ namespace MusicStore
|
||||||
builder.UseKestrel();
|
builder.UseKestrel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In Proc
|
||||||
|
builder.UseIIS();
|
||||||
|
|
||||||
builder.ConfigureLogging(factory =>
|
builder.ConfigureLogging(factory =>
|
||||||
{
|
{
|
||||||
factory.AddConsole();
|
factory.AddConsole();
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -177,6 +177,8 @@
|
||||||
|
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
|
|
||||||
|
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" hostingModel="[HostingModel]" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
|
||||||
|
|
||||||
<serverRuntime />
|
<serverRuntime />
|
||||||
|
|
||||||
<asp scriptErrorSentToBrowser="true">
|
<asp scriptErrorSentToBrowser="true">
|
||||||
|
|
@ -931,6 +933,7 @@
|
||||||
<add name="AspNetCoreModule" />
|
<add name="AspNetCoreModule" />
|
||||||
</modules>
|
</modules>
|
||||||
<handlers accessPolicy="Read, Script">
|
<handlers accessPolicy="Read, Script">
|
||||||
|
<add name="aspNetCore" path="*" verb="*" modules="[AspNetCoreModule]" resourceType="Unspecified" />
|
||||||
<!-- <add name="WebDAV" path="*" verb="PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" /> -->
|
<!-- <add name="WebDAV" path="*" verb="PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" /> -->
|
||||||
<add name="AXD-ISAPI-4.0_64bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
<add name="AXD-ISAPI-4.0_64bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
<add name="PageHandlerFactory-ISAPI-4.0_64bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
<add name="PageHandlerFactory-ISAPI-4.0_64bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,9 @@ namespace E2ETests
|
||||||
var deploymentParameters = new DeploymentParameters(variant)
|
var deploymentParameters = new DeploymentParameters(variant)
|
||||||
{
|
{
|
||||||
ApplicationPath = Helpers.GetApplicationPath(),
|
ApplicationPath = Helpers.GetApplicationPath(),
|
||||||
PublishApplicationBeforeDeployment = true,
|
|
||||||
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
||||||
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
|
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
|
||||||
ServerConfigTemplateContent = (variant.Server == ServerType.IISExpress) ? File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "NtlmAuthentation.config")) : null,
|
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "NtlmAuthentation.config"),
|
||||||
SiteName = "MusicStoreNtlmAuthentication", //This is configured in the NtlmAuthentication.config
|
SiteName = "MusicStoreNtlmAuthentication", //This is configured in the NtlmAuthentication.config
|
||||||
UserAdditionalCleanup = parameters =>
|
UserAdditionalCleanup = parameters =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,7 @@ namespace E2ETests
|
||||||
var deploymentParameters = new DeploymentParameters(variant)
|
var deploymentParameters = new DeploymentParameters(variant)
|
||||||
{
|
{
|
||||||
ApplicationPath = Helpers.GetApplicationPath(),
|
ApplicationPath = Helpers.GetApplicationPath(),
|
||||||
PublishApplicationBeforeDeployment = true,
|
|
||||||
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "Http.config"),
|
|
||||||
SiteName = "MusicStoreTestSite",
|
|
||||||
EnvironmentName = "OpenIdConnectTesting",
|
EnvironmentName = "OpenIdConnectTesting",
|
||||||
UserAdditionalCleanup = parameters =>
|
UserAdditionalCleanup = parameters =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ namespace E2ETests
|
||||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys)
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys)
|
||||||
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461)
|
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461)
|
||||||
.WithAllApplicationTypes()
|
.WithAllApplicationTypes()
|
||||||
|
.WithAllAncmVersions()
|
||||||
|
.WithAllHostingModels()
|
||||||
.WithAllArchitectures();
|
.WithAllArchitectures();
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
|
|
@ -35,8 +37,6 @@ namespace E2ETests
|
||||||
ApplicationPath = Helpers.GetApplicationPath(),
|
ApplicationPath = Helpers.GetApplicationPath(),
|
||||||
PublishApplicationBeforeDeployment = true,
|
PublishApplicationBeforeDeployment = true,
|
||||||
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "Http.config"),
|
|
||||||
SiteName = "MusicStoreTestSite",
|
|
||||||
UserAdditionalCleanup = parameters =>
|
UserAdditionalCleanup = parameters =>
|
||||||
{
|
{
|
||||||
DbUtils.DropDatabase(musicStoreDbName, logger);
|
DbUtils.DropDatabase(musicStoreDbName, logger);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ namespace E2ETests
|
||||||
public static TestMatrix TestVariants
|
public static TestMatrix TestVariants
|
||||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys)
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys)
|
||||||
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461)
|
.WithTfms(Tfm.NetCoreApp22, Tfm.NetCoreApp21, Tfm.NetCoreApp20, Tfm.Net461)
|
||||||
.WithAllApplicationTypes();
|
.WithAllApplicationTypes()
|
||||||
|
.WithAllAncmVersions()
|
||||||
|
.WithAllHostingModels();
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
|
|
@ -34,9 +36,6 @@ namespace E2ETests
|
||||||
{
|
{
|
||||||
ApplicationPath = Helpers.GetApplicationPath(),
|
ApplicationPath = Helpers.GetApplicationPath(),
|
||||||
EnvironmentName = "SocialTesting",
|
EnvironmentName = "SocialTesting",
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "Http.config"),
|
|
||||||
SiteName = "MusicStoreTestSite",
|
|
||||||
PublishApplicationBeforeDeployment = true,
|
|
||||||
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
||||||
UserAdditionalCleanup = parameters =>
|
UserAdditionalCleanup = parameters =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,9 @@ namespace E2ETests
|
||||||
Helpers.GetApplicationPath(), serverType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
|
Helpers.GetApplicationPath(), serverType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
|
||||||
{
|
{
|
||||||
EnvironmentName = "SocialTesting",
|
EnvironmentName = "SocialTesting",
|
||||||
SiteName = "MusicStoreTestSiteUsingStore",
|
|
||||||
PublishApplicationBeforeDeployment = true,
|
PublishApplicationBeforeDeployment = true,
|
||||||
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
PreservePublishedApplicationForDebugging = Helpers.PreservePublishedApplicationForDebugging,
|
||||||
TargetFramework = Tfm.NetCoreApp20, // There's only a Store on 2.0
|
TargetFramework = Tfm.NetCoreApp20, // There's only a Store on 2.0
|
||||||
ApplicationType = ApplicationType.Portable,
|
|
||||||
UserAdditionalCleanup = parameters =>
|
UserAdditionalCleanup = parameters =>
|
||||||
{
|
{
|
||||||
DbUtils.DropDatabase(musicStoreDbName, logger);
|
DbUtils.DropDatabase(musicStoreDbName, logger);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue