Add HTTP method matching to resource rules - #89
Open
Blacks-Army wants to merge 1 commit into
Open
Conversation
A rule with match "METHOD" carries a comma-separated list of HTTP methods in its value, e.g. "POST,PUT", and applies when the request method is in that list.
This was referenced Sep 5, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Node-side half of fosrl/pangolin#3704, which resolves fosrl/pangolin#1408 and supersedes fosrl/pangolin#2131.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
AI Disclosure
Claude Code (Opus) helped me with this one, including the implementation. I set the design constraints, went through every hunk myself and verified the result before opening this.
Description
This repo carries its own copy of
checkRules, so without this change aMETHODrule would be honoured or ignored depending on which side handled the request.A rule with match
METHODcarries a comma-separated list of HTTP methods in its existing value, e.g."POST,PUT", and applies when the request method is in that list. Matching is case-insensitive on both sides.Same shape as the hub change: one
else ifat the end of the chain plus one short helper. No new columns, no migration. Validation and the UI live in the hub, so none of that is duplicated here.Merge alongside fosrl/pangolin#3704. A
METHODrule can only be created over there, and this side ignores match types it does not know, so neither order breaks anything in the meantime.How to test?
With fosrl/pangolin#3704 applied to the hub, create a
PASS/METHOD/POST,PUTrule on an HTTP resource served through a node, then confirmcurl -X GETis served andcurl -X POSTis sent to auth.npx tsc --noEmitreports nothing beyond the twotsconfig.jsondeprecation errors that are already present ondev.