Repository navigation
feat: route checks honour the route verb - #149
Conversation
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1d5e7e12-e079-4026-b7bb-dcc33465df09
📒 Files selected for processing: 5
README.mdhaproxy.cfg.templatehaproxy_agent.pyspoe-agent.conftests/unit/test_route_verbs.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
…he deploy test Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
AppAPI's PHP proxy checks a request against an ExApp's routes by path and HTTP method: the first route whose URL and verb both match decides the access level. HaRP only looked at the path, so the first route with a matching URL decided for every method and the
<verb>of the routes ininfo.xmlhad no effect. An ExApp that declares one URL with different verbs and access levels behaved differently behind HaRP than behind the PHP proxy, and a route that lists only GET accepted every other method as well.AppAPI sends each route's verb to HaRP from its next releases on (nextcloud/app_api#1138, backported to stable32 to stable35), so HaRP can match the way the PHP proxy does.
Changes
method=methodinspoe-agent.conf), and routes accept an optionalverb.HEADis accepted whereverGETis listed.405 Method Not Allowedwith anAllowheader. It is decided before the user lookup and does not count toward the IP ban, as link checkers, monitors and CORS preflight requests send such requests. The agent also setsnot_found, so a custom/haproxy.cfgwithout the new 405 rule answers 404.spoe-agent.confwithoutmethod) keep the path-only matching.As in the PHP proxy, a method can now also fall through to a later, broader route with a lower access level, for example to a USER catch-all after an ADMIN route that lists only some methods. I checked the routes of every ExApp in the App Store and of the public ExApps on GitHub against the requests their clients send. The only one affected is Visionatrix 1.5.1 (Nextcloud 32): the ComfyUI it embeds for admins sends
PATCHto open its Logs panel, which the ExApp's route does not list, so that panel gets 405 untilPATCHis added to the route.HaRP uses the verbs once it loads an ExApp's routes: after a restart, or when AppAPI sends them on enabling or updating the ExApp.