PowerShell/test/tools/WebListener/Startup.cs

55 lines
1.6 KiB
C#
Raw Normal View History

Add test WebListener module and tests for Web Cmdlet Certificate Authentication (#4622) Introduce new test module 'WebListener.psm1'. Now web HTTPS tests can use it to exclude using external sites. PowerShell/PowerShell#4609 * [Feature] Add Tests for Web Cmdlet Certificate Authentication PowerShell/PowerShell#4609 * [feature] Add new app to Publish-PSTestTools refactor tests also add ASP.NET to .spelling * [feature] spelling fix * [feature] revert badssl changes * [feature] Impliment suggestions * [feature] Spelling, var rename, port 8443 to 8083 rebase fix conflict * [feature] Rename to HttpsListener and Module-ize . * [feature] password protect ClientCert to fix macOS import issue * [feature] Rename to WebListener * Rename HttpsListener to WebListener * Switch Listener from Razor pages to MVC * Address PR feedback * Adjust tests * [feature] Address PR feedback * [feature] Replace missing smeicolons * [feature] Address PR Feedback * [feature] Cleanup and minor fix * Enum was not used * GetStatus() was not accessing the correct property chain * Added -Test param to make URL generation smoother in test code and to fix double / issues * [feature] More minor fixes * Https when it matters. * Expand property... not exclude.. * Remove superfluous and outdated ToString() override * [Feature] Move ClientCeret.pfx to WebListener Module * Move the cert * Adjust Get-WebListenerClientCertificate * Remove cert from csproj * ActionResult -> JsonResult (was mistakenly left as ActionResult during testing).. * [Feature] Move ServerCert.pfx to Module * Move cert * Upate csproj * Update module * Add/Update README.md's CI Retest.
2017-08-31 11:30:35 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace mvc
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "redirect",
template: "Redirect/{count?}",
defaults: new {controller = "Redirect", action = "Index"}
);
Add test WebListener module and tests for Web Cmdlet Certificate Authentication (#4622) Introduce new test module 'WebListener.psm1'. Now web HTTPS tests can use it to exclude using external sites. PowerShell/PowerShell#4609 * [Feature] Add Tests for Web Cmdlet Certificate Authentication PowerShell/PowerShell#4609 * [feature] Add new app to Publish-PSTestTools refactor tests also add ASP.NET to .spelling * [feature] spelling fix * [feature] revert badssl changes * [feature] Impliment suggestions * [feature] Spelling, var rename, port 8443 to 8083 rebase fix conflict * [feature] Rename to HttpsListener and Module-ize . * [feature] password protect ClientCert to fix macOS import issue * [feature] Rename to WebListener * Rename HttpsListener to WebListener * Switch Listener from Razor pages to MVC * Address PR feedback * Adjust tests * [feature] Address PR feedback * [feature] Replace missing smeicolons * [feature] Address PR Feedback * [feature] Cleanup and minor fix * Enum was not used * GetStatus() was not accessing the correct property chain * Added -Test param to make URL generation smoother in test code and to fix double / issues * [feature] More minor fixes * Https when it matters. * Expand property... not exclude.. * Remove superfluous and outdated ToString() override * [Feature] Move ClientCeret.pfx to WebListener Module * Move the cert * Adjust Get-WebListenerClientCertificate * Remove cert from csproj * ActionResult -> JsonResult (was mistakenly left as ActionResult during testing).. * [Feature] Move ServerCert.pfx to Module * Move cert * Upate csproj * Update module * Add/Update README.md's CI Retest.
2017-08-31 11:30:35 +02:00
});
}
}
}