Skip to content

Commit

Permalink
Remove consistency front-end to reduce dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed May 16, 2021
1 parent 19f414d commit 76b798b
Show file tree
Hide file tree
Showing 29 changed files with 15 additions and 14,832 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ persistence (cheap).
Here's a high-level description of main projects in this repository:

- [`Worker`](src/Worker) - the Azure Function itself, a thin adapter between core logic and Azure Functions
- [`Website`](src/Website) - a website for checking [consistency](docs/consistency.md) and an admin panel for starting scans
- [`Website`](src/Website) - a website for an admin panel to managed scans
- [`Worker.Logic`](src/Worker.Logic) - all of the catalog scan and driver logic, this is the most interesting project
- [`Logic`](src/Logic) - contains more generic logic related to NuGet.org protocol and is not directly related to distributed processing

Expand Down Expand Up @@ -212,6 +212,5 @@ Several message processors exist to emit other useful data:

- **[Adding a new driver](docs/new-driver.md) - a guide to help you enhance ExplorePackages to suit your needs.**
- [Blog posts](docs/blog-posts.md) - blog posts about lessons learned from this project
- [Consistency](docs/consistency.md) - a consistency checker for packages published to NuGet.org
- [Cost](docs/cost.md) - how much it costs to run several of the implemented catalog scans
- [Notable classes](docs/notable-classes.md) - interesting or useful classes supporting this project
1 change: 0 additions & 1 deletion deploy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ resource website 'Microsoft.Web/sites@2020-09-01' = {
clientAffinityEnabled: false
httpsOnly: true
siteConfig: {
webSocketsEnabled: true
minTlsVersion: '1.2'
netFrameworkVersion: 'v5.0'
appSettings: concat([
Expand Down
11 changes: 0 additions & 11 deletions docs/consistency.md

This file was deleted.

Binary file removed docs/consistency.png
Binary file not shown.
14 changes: 1 addition & 13 deletions src/Website/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,14 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
using NuGet.Versioning;

namespace Knapcode.ExplorePackages.Website.Controllers
{
public class HomeController : Controller
{
public ViewResult Index()
{
return View(new ExploreViewModel());
}

public ActionResult Explore(string id, string version)
{
if (!StrictPackageIdValidator.IsValid(id)
|| !NuGetVersion.TryParse(version, out var parsedVersion))
{
return RedirectToAction(nameof(Index));
}

return View(nameof(Index), new ExploreViewModel(id, version));
return View();
}

public async Task<RedirectToActionResult> SignOutAndRedirect()
Expand Down
207 changes: 0 additions & 207 deletions src/Website/Logic/PackageReportHub.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/Website/Models/ExploreViewModel.cs

This file was deleted.

27 changes: 9 additions & 18 deletions src/Website/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Linq;
using System.Text.Json.Serialization;
using Knapcode.ExplorePackages.Website.Logic;
using Knapcode.ExplorePackages.Worker;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Authorization;
Expand Down Expand Up @@ -43,15 +41,7 @@ public void ConfigureServices(IServiceCollection services)
});

services
.AddMvc()
.AddRazorRuntimeCompilation();

services
.AddSignalR()
.AddJsonProtocol(options =>
{
options.PayloadSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
.AddMvc();

var microsoftIdentityBuilder = services
.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
Expand Down Expand Up @@ -113,20 +103,21 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

app.UseRouting();

app.UseHsts();
app.Use(async (context, next) =>
{
context.Response.Headers.Add("X-Content-Type-Options", "nosniff");
await next();
});

app.UseAuthentication();
app.UseAuthorization();

app.UseEndpoints(routes =>
{
routes.MapHub<PackageReportHub>(PackageReportHub.Path);
routes.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
routes.MapControllerRoute(
name: "explore",
pattern: "{controller=Home}/{action=Explore}/{id}/{version}");
pattern: "{controller=Home}/{action=Index}");
});
}
}
Expand Down
Loading

0 comments on commit 76b798b

Please sign in to comment.