-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed Support For .NET 6; Added Support For .NET 9 (#100)
* Removed support for .NET 6 and 7; Updated csproj version numbers throughout; Upgraded NuGet packages used in Tests project; Rebuilt Example project using .NET 9; Updated Readme, NuGet specific Readme, changelog, and documentation files. * Ran dotnet-format on codebase * Upped .NET SDK version in GitHub workflows * Updated .NET SDK version in GitHub workflows to v9 * Added locked mode to .NET restore action in Github workflows * Added RestorePackagesWithLockFile to all csproj's to enhance OpenSSF Score and pin dependencies * Added project.lock.json files * Excluded packages.lock.json from NuGet package command
- Loading branch information
1 parent
1f3a692
commit 62367f4
Showing
18 changed files
with
529 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace OwaspHeaders.Core.Example.Controllers; | ||
|
||
[ApiController] | ||
[Route("/")] | ||
public class HomeController : ControllerBase | ||
{ | ||
private readonly ILogger<HomeController> _logger; | ||
|
||
public HomeController(ILogger<HomeController> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
[HttpGet(Name = "/")] | ||
public IEnumerable<string> Get() | ||
{ | ||
return HttpContext.Response.Headers.Select(h => h.ToString()).ToArray(); | ||
} | ||
} | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace OwaspHeaders.Core.Example.Controllers; | ||
|
||
[ApiController] | ||
[Route("/")] | ||
public class HomeController(ILogger<HomeController> logger) : ControllerBase | ||
{ | ||
private readonly ILogger<HomeController> _logger = logger; | ||
|
||
[HttpGet(Name = "/")] | ||
public IEnumerable<string> Get() | ||
{ | ||
return HttpContext.Response.Headers.Select(h => h.ToString()).ToArray(); | ||
} | ||
} |
34 changes: 19 additions & 15 deletions
34
OwaspHeaders.Core.Example/OwaspHeaders.Core.Example.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | ||
<PackageReference Include="ClacksMiddlware" Version="2.0.2" /> | ||
<ProjectReference Include="..\src\OwaspHeaders.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net8.0;net9.0</TargetFrameworks> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.0"/> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\src\OwaspHeaders.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
using OwaspHeaders.Core.Extensions; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
// Add services to the container. | ||
|
||
builder.Services.AddControllers(); | ||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||
builder.Services.AddEndpointsApiExplorer(); | ||
builder.Services.AddSwaggerGen(); | ||
|
||
var app = builder.Build(); | ||
|
||
// Configure the HTTP request pipeline. | ||
if (app.Environment.IsDevelopment()) | ||
{ | ||
app.UseSwagger(); | ||
app.UseSwaggerUI(); | ||
} | ||
|
||
app.UseHttpsRedirection(); | ||
|
||
app.UseAuthorization(); | ||
|
||
app.UseSecureHeadersMiddleware(); | ||
|
||
app.MapControllers(); | ||
|
||
app.Run(); | ||
using OwaspHeaders.Core.Extensions; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
// Add services to the container. | ||
|
||
builder.Services.AddControllers(); | ||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||
builder.Services.AddEndpointsApiExplorer(); | ||
builder.Services.AddSwaggerGen(); | ||
|
||
var app = builder.Build(); | ||
|
||
// Configure the HTTP request pipeline. | ||
if (app.Environment.IsDevelopment()) | ||
{ | ||
app.UseSwagger(); | ||
app.UseSwaggerUI(); | ||
} | ||
|
||
app.UseHttpsRedirection(); | ||
|
||
app.UseAuthorization(); | ||
|
||
app.UseSecureHeadersMiddleware(); | ||
|
||
app.MapControllers(); | ||
|
||
app.Run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,41 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/launchsettings.json", | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:24885", | ||
"sslPort": 44362 | ||
} | ||
}, | ||
"profiles": { | ||
"example": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "https://localhost:7001;http://localhost:5265", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} | ||
{ | ||
"$schema": "https://json.schemastore.org/launchsettings.json", | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:39531", | ||
"sslPort": 44308 | ||
} | ||
}, | ||
"profiles": { | ||
"http": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "http://localhost:5231", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"https": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "https://localhost:7090;http://localhost:5231", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"version": 1, | ||
"dependencies": { | ||
"net8.0": { | ||
"Microsoft.AspNetCore.OpenApi": { | ||
"type": "Direct", | ||
"requested": "[7.0.0, )", | ||
"resolved": "7.0.0", | ||
"contentHash": "P1mkNhZ3IwU3phNLIUkgqVXb1exnooTalIYwpSON3oKKkcRtACDgS4WpO+xnwFw4KzV0bmgkUqB3acXxIefvvg==", | ||
"dependencies": { | ||
"Microsoft.OpenApi": "1.4.3" | ||
} | ||
}, | ||
"Swashbuckle.AspNetCore": { | ||
"type": "Direct", | ||
"requested": "[6.4.0, )", | ||
"resolved": "6.4.0", | ||
"contentHash": "eUBr4TW0up6oKDA5Xwkul289uqSMgY0xGN4pnbOIBqCcN9VKGGaPvHX3vWaG/hvocfGDP+MGzMA0bBBKz2fkmQ==", | ||
"dependencies": { | ||
"Microsoft.Extensions.ApiDescription.Server": "6.0.5", | ||
"Swashbuckle.AspNetCore.Swagger": "6.4.0", | ||
"Swashbuckle.AspNetCore.SwaggerGen": "6.4.0", | ||
"Swashbuckle.AspNetCore.SwaggerUI": "6.4.0" | ||
} | ||
}, | ||
"Microsoft.Extensions.ApiDescription.Server": { | ||
"type": "Transitive", | ||
"resolved": "6.0.5", | ||
"contentHash": "Ckb5EDBUNJdFWyajfXzUIMRkhf52fHZOQuuZg/oiu8y7zDCVwD0iHhew6MnThjHmevanpxL3f5ci2TtHQEN6bw==" | ||
}, | ||
"Microsoft.OpenApi": { | ||
"type": "Transitive", | ||
"resolved": "1.4.3", | ||
"contentHash": "rURwggB+QZYcSVbDr7HSdhw/FELvMlriW10OeOzjPT7pstefMo7IThhtNtDudxbXhW+lj0NfX72Ka5EDsG8x6w==" | ||
}, | ||
"Swashbuckle.AspNetCore.Swagger": { | ||
"type": "Transitive", | ||
"resolved": "6.4.0", | ||
"contentHash": "nl4SBgGM+cmthUcpwO/w1lUjevdDHAqRvfUoe4Xp/Uvuzt9mzGUwyFCqa3ODBAcZYBiFoKvrYwz0rabslJvSmQ==", | ||
"dependencies": { | ||
"Microsoft.OpenApi": "1.2.3" | ||
} | ||
}, | ||
"Swashbuckle.AspNetCore.SwaggerGen": { | ||
"type": "Transitive", | ||
"resolved": "6.4.0", | ||
"contentHash": "lXhcUBVqKrPFAQF7e/ZeDfb5PMgE8n5t6L5B6/BQSpiwxgHzmBcx8Msu42zLYFTvR5PIqE9Q9lZvSQAcwCxJjw==", | ||
"dependencies": { | ||
"Swashbuckle.AspNetCore.Swagger": "6.4.0" | ||
} | ||
}, | ||
"Swashbuckle.AspNetCore.SwaggerUI": { | ||
"type": "Transitive", | ||
"resolved": "6.4.0", | ||
"contentHash": "1Hh3atb3pi8c+v7n4/3N80Jj8RvLOXgWxzix6w3OZhB7zBGRwsy7FWr4e3hwgPweSBpwfElqj4V4nkjYabH9nQ==" | ||
}, | ||
"owaspheaders.core": { | ||
"type": "Project" | ||
} | ||
}, | ||
"net9.0": { | ||
"Microsoft.AspNetCore.OpenApi": { | ||
"type": "Direct", | ||
"requested": "[7.0.0, )", | ||
"resolved": "7.0.0", | ||
"contentHash": "P1mkNhZ3IwU3phNLIUkgqVXb1exnooTalIYwpSON3oKKkcRtACDgS4WpO+xnwFw4KzV0bmgkUqB3acXxIefvvg==", | ||
"dependencies": { | ||
"Microsoft.OpenApi": "1.4.3" | ||
} | ||
}, | ||
"Swashbuckle.AspNetCore": { | ||
"type": "Direct", | ||
"requested": "[6.4.0, )", | ||
"resolved": "6.4.0", | ||
"contentHash": "eUBr4TW0up6oKDA5Xwkul289uqSMgY0xGN4pnbOIBqCcN9VKGGaPvHX3vWaG/hvocfGDP+MGzMA0bBBKz2fkmQ==", | ||
"dependencies": { | ||
"Microsoft.Extensions.ApiDescription.Server": "6.0.5", | ||
"Swashbuckle.AspNetCore.Swagger": "6.4.0", | ||
"Swashbuckle.AspNetCore.SwaggerGen": "6.4.0", | ||
"Swashbuckle.AspNetCore.SwaggerUI": "6.4.0" | ||
} | ||
}, | ||
"Microsoft.Extensions.ApiDescription.Server": { | ||
"type": "Transitive", | ||
"resolved": "6.0.5", | ||
"contentHash": "Ckb5EDBUNJdFWyajfXzUIMRkhf52fHZOQuuZg/oiu8y7zDCVwD0iHhew6MnThjHmevanpxL3f5ci2TtHQEN6bw==" | ||
}, | ||
"Microsoft.OpenApi": { | ||
"type": "Transitive", | ||
"resolved": "1.4.3", | ||
"contentHash": "rURwggB+QZYcSVbDr7HSdhw/FELvMlriW10OeOzjPT7pstefMo7IThhtNtDudxbXhW+lj0NfX72Ka5EDsG8x6w==" | ||
}, | ||
"Swashbuckle.AspNetCore.Swagger": { | ||
"type": "Transitive", | ||
"resolved": "6.4.0", | ||
"contentHash": "nl4SBgGM+cmthUcpwO/w1lUjevdDHAqRvfUoe4Xp/Uvuzt9mzGUwyFCqa3ODBAcZYBiFoKvrYwz0rabslJvSmQ==", | ||
"dependencies": { | ||
"Microsoft.OpenApi": "1.2.3" | ||
} | ||
}, | ||
"Swashbuckle.AspNetCore.SwaggerGen": { | ||
"type": "Transitive", | ||
"resolved": "6.4.0", | ||
"contentHash": "lXhcUBVqKrPFAQF7e/ZeDfb5PMgE8n5t6L5B6/BQSpiwxgHzmBcx8Msu42zLYFTvR5PIqE9Q9lZvSQAcwCxJjw==", | ||
"dependencies": { | ||
"Swashbuckle.AspNetCore.Swagger": "6.4.0" | ||
} | ||
}, | ||
"Swashbuckle.AspNetCore.SwaggerUI": { | ||
"type": "Transitive", | ||
"resolved": "6.4.0", | ||
"contentHash": "1Hh3atb3pi8c+v7n4/3N80Jj8RvLOXgWxzix6w3OZhB7zBGRwsy7FWr4e3hwgPweSBpwfElqj4V4nkjYabH9nQ==" | ||
}, | ||
"owaspheaders.core": { | ||
"type": "Project" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.