Skip to content

Commit d4feb98

Browse files
authored
Various bug fixes (#126)
* fix Github Pages deploy use .NET 9 for OpenAPI builds * exclude Prometheus from X-Super-* do not require X-Super-* for Prometheus endpoints * fix SpaceStation.Show OpenAPI annotations * add CodeQL yaml file to solution view * add SpaceStation to the json serializers
1 parent 4a96610 commit d4feb98

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/pages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
- uses: actions/checkout@v4
2929
- name: Initial static JSON schema submodule
3030
run: git submodule update --init ./src/Helldivers-2-Models/json
31+
- name: Setup .NET
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 9.0.x
3135
- name: Generate OpenAPI JSON files
3236
run: dotnet build -c Debug
3337
- name: Copy README

Helldivers-2.sln

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helldivers-2-API", "src\Hel
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C0ECDBEB-FC7B-4F3C-AF8F-D0961BD22F61}"
99
ProjectSection(SolutionItems) = preProject
10+
.dockerignore = .dockerignore
1011
.editorconfig = .editorconfig
1112
.gitattributes = .gitattributes
1213
.gitignore = .gitignore
1314
Directory.Build.props = Directory.Build.props
1415
fly.toml = fly.toml
15-
.dockerignore = .dockerignore
1616
EndProjectSection
1717
EndProject
1818
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Helldivers-2-Models", "src\Helldivers-2-Models\Helldivers-2-Models.csproj", "{9B017849-C756-4B98-9B98-885AEBE9EAD4}"
@@ -27,19 +27,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helldivers-2-SourceGen", "s
2727
EndProject
2828
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Github", "Github", "{18D4A0EA-02CE-4FEA-A641-848A13603040}"
2929
ProjectSection(SolutionItems) = preProject
30+
.github\CODEOWNERS = .github\CODEOWNERS
3031
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
32+
CONTRIBUTING.md = CONTRIBUTING.md
33+
LICENSE = LICENSE
3134
README.md = README.md
3235
SECURITY.md = SECURITY.md
33-
LICENSE = LICENSE
34-
CONTRIBUTING.md = CONTRIBUTING.md
35-
.github\CODEOWNERS = .github\CODEOWNERS
3636
EndProjectSection
3737
EndProject
3838
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{9D663AC9-2CD8-4114-A802-D12284662FF0}"
3939
ProjectSection(SolutionItems) = preProject
40+
.github\workflows\codeql.yml = .github\workflows\codeql.yml
41+
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
4042
.github\workflows\fly.yml = .github\workflows\fly.yml
4143
.github\workflows\pages.yml = .github\workflows\pages.yml
42-
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
4344
EndProjectSection
4445
EndProject
4546
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{FD5B9284-4689-48BE-B520-633C7269F97C}"
@@ -85,17 +86,17 @@ Global
8586
GlobalSection(SolutionProperties) = preSolution
8687
HideSolutionNode = FALSE
8788
EndGlobalSection
88-
GlobalSection(ExtensibilityGlobals) = postSolution
89-
SolutionGuid = {3511FD7F-508F-4E9A-ABEB-7F7656961728}
90-
EndGlobalSection
9189
GlobalSection(NestedProjects) = preSolution
92-
{939EFFA5-462B-4F5F-969A-61B4C424407A} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
9390
{9B017849-C756-4B98-9B98-885AEBE9EAD4} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
9491
{CB53B78C-7AB2-4B39-98B0-394778AF882F} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
92+
{939EFFA5-462B-4F5F-969A-61B4C424407A} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
9593
{32AE19FB-7D9E-4AC7-A0A5-80DED3680369} = {154421CC-393F-4BDC-8D6D-7EECB28FD874}
9694
{18D4A0EA-02CE-4FEA-A641-848A13603040} = {C0ECDBEB-FC7B-4F3C-AF8F-D0961BD22F61}
9795
{9D663AC9-2CD8-4114-A802-D12284662FF0} = {18D4A0EA-02CE-4FEA-A641-848A13603040}
9896
{FD5B9284-4689-48BE-B520-633C7269F97C} = {18D4A0EA-02CE-4FEA-A641-848A13603040}
9997
{1A2CFD82-2D8E-4DA3-97A3-403BB478B6EB} = {C0ECDBEB-FC7B-4F3C-AF8F-D0961BD22F61}
10098
EndGlobalSection
99+
GlobalSection(ExtensibilityGlobals) = postSolution
100+
SolutionGuid = {3511FD7F-508F-4E9A-ABEB-7F7656961728}
101+
EndGlobalSection
101102
EndGlobal

src/Helldivers-2-API/Controllers/V1/SpaceStationController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public static async Task<IResult> Index(HttpContext context, IStore<SpaceStation
2323
/// <summary>
2424
/// Fetches a specific <see cref="SpaceStation" /> identified by <paramref name="index" />.
2525
/// </summary>
26+
[ProducesResponseType<SpaceStation>(StatusCodes.Status200OK)]
2627
public static async Task<IResult> Show(HttpContext context, IStore<SpaceStation, int> store, [FromRoute] int index)
2728
{
2829
var station = await store.GetAsync(index, context.RequestAborted);

src/Helldivers-2-API/Middlewares/RateLimitMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
5959
/// </summary>
6060
private bool IsValidRequest(HttpContext context)
6161
{
62-
if (options.Value.ValidateClients is false)
62+
if (options.Value.ValidateClients is false || context.Request.Path.StartsWithSegments("/metrics"))
6363
return true;
6464

6565
return context.Request.Headers.ContainsKey(Constants.CLIENT_HEADER_NAME)

src/Helldivers-2-Models/V1SerializerContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Helldivers.Models;
1818
[JsonSerializable(typeof(SteamNews))]
1919
[JsonSerializable(typeof(List<SteamNews>))]
2020
[JsonSerializable(typeof(War))]
21+
[JsonSerializable(typeof(List<SpaceStation>))]
2122
[JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true, UseStringEnumConverter = true)]
2223
public sealed partial class V1SerializerContext : JsonSerializerContext
2324
{

0 commit comments

Comments
 (0)