Skip to content

Commit 76b798b

Browse files
committed
Remove consistency front-end to reduce dependencies
1 parent 19f414d commit 76b798b

29 files changed

+15
-14832
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ persistence (cheap).
174174
Here's a high-level description of main projects in this repository:
175175

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

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

213213
- **[Adding a new driver](docs/new-driver.md) - a guide to help you enhance ExplorePackages to suit your needs.**
214214
- [Blog posts](docs/blog-posts.md) - blog posts about lessons learned from this project
215-
- [Consistency](docs/consistency.md) - a consistency checker for packages published to NuGet.org
216215
- [Cost](docs/cost.md) - how much it costs to run several of the implemented catalog scans
217216
- [Notable classes](docs/notable-classes.md) - interesting or useful classes supporting this project

deploy/main.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ resource website 'Microsoft.Web/sites@2020-09-01' = {
165165
clientAffinityEnabled: false
166166
httpsOnly: true
167167
siteConfig: {
168-
webSocketsEnabled: true
169168
minTlsVersion: '1.2'
170169
netFrameworkVersion: 'v5.0'
171170
appSettings: concat([

docs/consistency.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/consistency.png

-18.6 KB
Binary file not shown.

src/Website/Controllers/HomeController.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,14 @@
44
using Microsoft.AspNetCore.Authentication;
55
using Microsoft.AspNetCore.Authentication.Cookies;
66
using Microsoft.AspNetCore.Mvc;
7-
using NuGet.Versioning;
87

98
namespace Knapcode.ExplorePackages.Website.Controllers
109
{
1110
public class HomeController : Controller
1211
{
1312
public ViewResult Index()
1413
{
15-
return View(new ExploreViewModel());
16-
}
17-
18-
public ActionResult Explore(string id, string version)
19-
{
20-
if (!StrictPackageIdValidator.IsValid(id)
21-
|| !NuGetVersion.TryParse(version, out var parsedVersion))
22-
{
23-
return RedirectToAction(nameof(Index));
24-
}
25-
26-
return View(nameof(Index), new ExploreViewModel(id, version));
14+
return View();
2715
}
2816

2917
public async Task<RedirectToActionResult> SignOutAndRedirect()

src/Website/Logic/PackageReportHub.cs

Lines changed: 0 additions & 207 deletions
This file was deleted.

src/Website/Models/ExploreViewModel.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Website/Startup.cs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
22
using System.Linq;
3-
using System.Text.Json.Serialization;
4-
using Knapcode.ExplorePackages.Website.Logic;
53
using Knapcode.ExplorePackages.Worker;
64
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
75
using Microsoft.AspNetCore.Authorization;
@@ -43,15 +41,7 @@ public void ConfigureServices(IServiceCollection services)
4341
});
4442

4543
services
46-
.AddMvc()
47-
.AddRazorRuntimeCompilation();
48-
49-
services
50-
.AddSignalR()
51-
.AddJsonProtocol(options =>
52-
{
53-
options.PayloadSerializerOptions.Converters.Add(new JsonStringEnumConverter());
54-
});
44+
.AddMvc();
5545

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

114104
app.UseRouting();
115105

106+
app.UseHsts();
107+
app.Use(async (context, next) =>
108+
{
109+
context.Response.Headers.Add("X-Content-Type-Options", "nosniff");
110+
await next();
111+
});
112+
116113
app.UseAuthentication();
117114
app.UseAuthorization();
118115

119116
app.UseEndpoints(routes =>
120117
{
121-
routes.MapHub<PackageReportHub>(PackageReportHub.Path);
122-
123118
routes.MapControllerRoute(
124119
name: "default",
125-
pattern: "{controller=Home}/{action=Index}/{id?}");
126-
127-
routes.MapControllerRoute(
128-
name: "explore",
129-
pattern: "{controller=Home}/{action=Explore}/{id}/{version}");
120+
pattern: "{controller=Home}/{action=Index}");
130121
});
131122
}
132123
}

0 commit comments

Comments
 (0)