Repository navigation
Conversation
The granular start/stop/restart/pause/unpause rules came after the `deny unless METH_GET || POST` gate, so with POST=0 they were never reached. Move them above the gate. Fixes Tecnativa#101. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Friendly ping on this one. It fixes #101, where ALLOW_START, ALLOW_STOP, ALLOW_RESTARTS, ALLOW_PAUSE and ALLOW_UNPAUSE only work with POST=1. Happy to adjust anything if you'd prefer a different approach. |
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.
Fixes #101.
ALLOW_START,ALLOW_STOP,ALLOW_RESTARTS,ALLOW_PAUSEandALLOW_UNPAUSEonly worked withPOST=1. These actions are all POST requests, and thedeny unless METH_GET || POSTline came before their allow rules, so withPOST=0they were refused. WithPOST=1, every POST to an enabled section is allowed anyway, which defeats the point of the granular flags.This moves the five granular allow rules above the POST gate. Nothing else changes order, and with the flags at their default
0the behaviour is the same as before. The linuxserver/docker-socket-proxy fork orders its rules the same way.Added
test_granular_permissions_without_post: with only the fiveALLOW_*flags set, pause/unpause/restart/stop/start/kill on a separate container succeed, whilerm,runandnetwork createare still refused. It fails on master with403 Forbiddenon the first call, and passes with this change. The full suite passes locally (6 tests,pytest --prebuild), and black 23.9.1 / isort / flake8 are clean.🤖 Generated with Claude Code