-
Notifications
You must be signed in to change notification settings - Fork 0
chore(maint): patch deps, tighten CORS/security headers, fail-fast config #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ira2222
wants to merge
1
commit into
main
Choose a base branch
from
codex/perform-maintenance-sweep-and-code-review
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,23 @@ | ||
| # Maintenance Sweep — November 2024 | ||
|
|
||
| ## Review highlights | ||
| - Output cache feature flag hardened so disabling the feature no longer breaks DI or endpoint caching configuration. | ||
| - Security headers middleware now runs earlier in the pipeline to guarantee headers on redirect responses. | ||
|
|
||
| ## Outstanding issues to track | ||
| 1. Minimal API endpoints always enabled output caching, which crashed when the feature flag was off (fixed in this sweep). | ||
| 2. Security headers were applied after HTTPS redirection, so redirect responses missed CSP/HSTS hardening (fixed in this sweep). | ||
| 3. Align `Microsoft.EntityFrameworkCore.Design` and `Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore` with the 8.0.11 patch that Infrastructure already consumes. | ||
| 4. `Microsoft.AspNetCore.OutputCaching.StackExchangeRedis` is still on the 8.0.0 RTM build; bump to 8.0.11 for the latest fixes. | ||
| 5. Test projects lag on EF Core packages (`InMemory`, `Microsoft.AspNetCore.Mvc.Testing`, `Microsoft.Data.Sqlite`)—all have 8.0.11 patches available. | ||
| 6. Azure SDK dependencies (`Azure.Identity`, `Azure.Core`) should be checked for the latest servicing release; Dependabot will surface once policy allows. | ||
|
|
||
| ## Dependency observations | ||
| - `.NET` — Recommend upgrading the EF Core and output caching packages noted above to their 8.0.11 service releases. | ||
| - `npm` — `npm outdated` shows React 18.x stack is current within its major; no action required now. | ||
| - Dependabot is enabled for NuGet, npm, and GitHub Actions and will keep surfacing new advisories. | ||
|
|
||
| ## Next steps | ||
| - Schedule a follow-up PR to apply the recommended package bumps and regenerate lock files once a .NET SDK is available in CI. | ||
| - Review outstanding CodeQL and Trivy SARIF reports to ensure no new actionable alerts have appeared since the last scan. | ||
| - Consider adding smoke tests that exercise the API with OutputCaching disabled to guard against regressions like the one fixed here. |
This file contains hidden or 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,15 @@ | ||
| # November 2025 Maintenance Sweep | ||
|
|
||
| ## Dependency refresh | ||
| - **Azure.Identity** → 1.17.0 ([release notes](https://github.com/Azure/azure-sdk-for-net/releases/tag/Azure.Identity_1.17.0)) | ||
| - **Microsoft.AspNetCore.OutputCaching.StackExchangeRedis** → 8.0.16 ([release notes](https://github.com/dotnet/aspnetcore/releases/tag/v8.0.16)) | ||
| - **Entity Framework Core toolchain/tests** → 8.0.11 (`Microsoft.EntityFrameworkCore.Design`, `Microsoft.EntityFrameworkCore.InMemory`, `Microsoft.AspNetCore.Mvc.Testing`, `Microsoft.Data.Sqlite`) ([release notes](https://github.com/dotnet/efcore/releases/tag/v8.0.11)) | ||
|
|
||
| ## Security & platform hygiene | ||
| - Ensure NetEscapades security headers execute first in the request pipeline for consistent coverage. | ||
| - Tighten the CORS allow-list policy to always emit `Vary: Origin` and reject wildcard origins when credentials are allowed. | ||
| - Add `DatabaseOptions` with options validation so production/startup fails fast if the selected provider lacks a connection string. | ||
|
|
||
| ## Follow-up considerations | ||
| - Monitor Azure SDK release cadence for identity/authentication improvements (next review February 2026). | ||
| - Consider onboarding `dotnet outdated` tool manifest to capture advisory metadata in future sweeps. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,28 @@ | ||
| using System; | ||
| using System.ComponentModel.DataAnnotations; | ||
|
|
||
| namespace App2.Api.Options; | ||
|
|
||
| public sealed class DatabaseOptions | ||
| { | ||
| public const string SectionName = "Data"; | ||
|
|
||
| [Required] | ||
| [RegularExpression("Sqlite|Postgres", ErrorMessage = "Data:Provider must be either 'Sqlite' or 'Postgres'.")] | ||
| public string Provider { get; set; } = "Sqlite"; | ||
|
|
||
| [Required] | ||
| public ConnectionStringsOptions ConnectionStrings { get; set; } = new(); | ||
|
|
||
| public sealed class ConnectionStringsOptions | ||
| { | ||
| public string? Sqlite { get; set; } | ||
|
|
||
| public string? Postgres { get; set; } | ||
| } | ||
|
|
||
| public string? GetConnectionStringForProvider() | ||
| => Provider.Equals("Postgres", StringComparison.OrdinalIgnoreCase) | ||
| ? ConnectionStrings.Postgres | ||
| : ConnectionStrings.Sqlite; | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Database Validation Mismatch Across Environments
The
DatabaseOptionsvalidation inProgram.csdoesn't fully align with the connection string resolution inDataExtensions.cs. For Postgres, validation passes inTestingenvironments without a configured connection string, but the application fails at runtime. Conversely, for SQLite, validation fails in non-development/testing environments even though the runtime provides an unconditional default connection string.Additional Locations (1)
src/App2.Api/Program.cs#L78-L84