Skip to content

feat/opt in authorized post - #32

Merged
fluffynuts merged 18 commits into
masterfrom
feat/opt-in-authorized-post
Oct 2, 2026
Merged

fluffynuts merged 18 commits into
masterfrom
feat/opt-in-authorized-post

Conversation

@fluffynuts

@fluffynuts fluffynuts commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Changes:

  • 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
  • add ability for the ImageResizeController to accept a POST request with an image to resize in a JSON body. The JSON payload can also contain all image resize parameters that the GET request would accept
  • POST handling has to be enabled via the appsetting AllowPostRequests which is false by default
  • POST requests either have to be authorised via a known token in PostAuthTokens, or, if the user is brave, by setting this to "*". The default setting here is empty, meaning that even if AllowPostRequests is set to true, POST requests won't be allowed - either tokens must be filled in, or the deployer can actively choose to allow POST requests from anywhere (eg if the service is deployed on a known-safe network with no access from the outside world)

I added POST support because where we're using it, issuing a GET request to IRAAS means that the IRAAS fetch has to go through all the intermediate network infrastructure, making it tricky when setting headers - we'd want auth headers, for example, but network agents like cloudflare and nginx will also observe other headers like Host. Instead of trying to get clever with what headers we sent, I figured we could skip the entire round-trip with an authorized POST.

@fluffynuts
fluffynuts merged commit c14d322 into master Oct 2, 2026
2 checks passed
@fluffynuts
fluffynuts deleted the feat/opt-in-authorized-post branch October 2, 2026 09:12
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.

2 participants