Skip to content

Upgrade packages, bypass cache when no-store cache-control set, allow self-signed certs via appsettings.json for dev - #31

Closed
fluffynuts wants to merge 5 commits into
masterfrom
feat/allow-dev-ssl-certs
Closed

fluffynuts wants to merge 5 commits into
masterfrom
feat/allow-dev-ssl-certs

Conversation

@fluffynuts

@fluffynuts fluffynuts commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Does what it says on the tin:

  • when an image request with a cache-control: no-store header is retrieved, do not allow that request to be
    re-used by another with the same url. In this way, callers can pass through session identifier cookies and not
    have them potentially bleed out to other concurrent requests
  • add AllowInvalidSSLCertificates app setting (default false) - useful for testing in dev
  • fix some issues with appsettings parsing, incorporate upstream changes for merged, case-insensitive dictionary-ducking
  • update all packages to latest (except ImageSharp - v4 requires a license file to be present at compile-time, and I'm also not sure if there are any api breakages in the upgrade. I'll raise a separate PR once I'm happy with v4 and licensing as v4 offers performance improvements, and is the currently-supported release line

…ured to do so

- this would allow testing against a running local https asp.net
  application. Default is off, but that's up to the consumer to
  decide anyway
…ts, make https-invalid-cert test always runnable
- fix some issues
- add tests around the fixes
@fluffynuts
fluffynuts requested review from devonCodeo and jondrummond-codeo and a lite review from Copilot September 21, 2026 08:58
@fluffynuts
fluffynuts marked this pull request as ready for review September 21, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A critical compilation issue and additional unresolved review findings remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

This PR upgrades dependencies, adds no-store request isolation, supports configurable invalid TLS certificates for development, and improves settings parsing and tests.

Changes:

  • Adds no-store concurrency handling.
  • Adds development SSL-certificate bypass configuration.
  • Updates parsing, sanitization, packages, build configurations, and tests.

Review findings:

  • Critical (1 vote): SelfSignedImageServer.cs lacks compatible ASP.NET Core references and will not compile.
  • Moderate (1 vote): package.json uses a net7.0 path while the server targets net8.0.
  • Moderate (1 vote): A StreamAndHeaders test result is not disposed.
  • Moderate (2 votes): The WebRequest SSL-bypass path is not covered by CI.
  • Nit (1 vote): The SSL bypass setting is not documented in the README.
File Summary
src/​IRAAS/​Startup.cs Gates environment dumping.
src/​IRAAS/​Middleware/​ConcurrencyMiddleware.cs Handles no-store requests.
src/​IRAAS/​IRAAS.csproj Updates packages and configurations.
src/​IRAAS/​ImageProcessing/​UrlFetcher.cs Adds invalid SSL handling.
src/​IRAAS/​ImageProcessing/​DefaultImageResizeParameters.cs Improves parameter sanitization.
src/​IRAAS/​IAppSettings.cs Adds SSL configuration.
src/​IRAAS/​AppSettingsProvider.cs Updates parsing and defaults.
src/​IRAAS/​appsettings.json Adds the SSL setting default.
src/​IRAAS/​appsettings.deploy.json Adds the deployment placeholder.
src/​IRAAS.Tests/​TestBase.cs Clears cached settings.
src/​IRAAS.Tests/​Middleware/​TestImageProviderErrorMiddleware.cs Updates assertions and formatting.
src/​IRAAS.Tests/​Middleware/​TestConcurrencyMiddleware.cs Tests no-store behavior.
src/​IRAAS.Tests/​IRAAS.Tests.csproj Updates dependencies and configurations.
src/​IRAAS.Tests/​ImageProcessing/​TestUrlFetcher.cs Adds SSL tests and helpers.
src/​IRAAS.Tests/​ImageProcessing/​TestImageResizer.cs Updates URL assertions.
src/​IRAAS.Tests/​ImageProcessing/​TestImageResizeParameters.cs Updates URI assertions.
src/​IRAAS.Tests/​ImageProcessing/​TestDefaultImageResizeParameters.cs Adds sanitization tests.
src/​IRAAS.Tests/​ImageProcessing/​TestAppSettingsProvider.cs Adds configuration tests.
src/​IRAAS.Tests/​ImageProcessing/​SelfSignedImageServer.cs Adds an HTTPS test server.
src/​IRAAS.Tests/​ImageProcessing/​SelfSignedCertificate.cs Creates test certificates.
src/​IRAAS.StressTest/​IRAAS.StressTest.csproj Updates configurations and dependencies.
src/​IRAAS.StressTest.ImageServer/​IRAAS.StressTest.ImageServer.csproj Adds build configurations.
src/​IRAAS.sln Adds solution configurations.
package.json Updates build, start, and test scripts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +43 to +52
var builder = WebApplication.CreateSlimBuilder();
builder.Logging.ClearProviders();
var port = PortFinder.FindOpenPort();
builder.WebHost.ConfigureKestrel(
options =>
{
options.Listen(
IPAddress.Loopback,
port,
(ListenOptions listenOptions) => listenOptions.UseHttps(certificate)
Comment on lines +121 to +125
if (_appSettings.AllowInvalidSslCertificates)
{
if (req is HttpWebRequest httpRequest)
{
[HttpStatusCode.NotModified] = ThrowNotModifiedException,
};
httpRequest.ServerCertificateValidationCallback = WebRequestSslHandler;

@devonCodeo devonCodeo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just awaiting Copilot comments to be actioned, everything else looks good 👍

@fluffynuts

Copy link
Copy Markdown
Collaborator Author

superceded by #32 - closing out.

@fluffynuts fluffynuts closed this Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants