Repository navigation
Remove AR_ACCOUNT_L1=legacy, a second key to L1 that nobody tracked - #22
Open
sumerjohal wants to merge 1 commit into
Open
sumerjohal wants to merge 1 commit into
sumerjohal wants to merge 1 commit into
Conversation
Four identical lines in fetch_field.py turned any login into an L1 grant
on /fetch-field, /fetch-field-wkt, /fetch-field-centroid and
/geoid/{id}/eudr-export when the variable was set. It was a development
convenience, documented nowhere, and would have been a production bypass
had it ever been set there. The grant is the only thing that unlocks L1.
The lines and their local os imports are removed; nothing else reads the
variable.
Tests: the two test_api.py steps that asserted the flag unlocks L1 now
assert it does not, and fail against the previous code. A new test sets
the flag, presents a login and no grant, and requires L0 on all four
routes; its sibling adds a real grant and requires L1 on all four, so the
L0 is a refusal and not an outage.
stomata run: 12/12. Suite: 174 passed, 1 xfailed (was 172). Lint: 36, unchanged.
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
What
AR_ACCOUNT_L1=legacyturned any login into an L1 grant on the four field routes:/fetch-field,/fetch-field-wkt,/fetch-field-centroidand/geoid/{id}/eudr-export. Four identical lines infetch_field.py:It was a development convenience, documented nowhere (not in README,
.envexamples, CI or the deploy scripts), and would have been a production bypass had it ever been set there. The grant is the only thing that unlocks L1; a variable that also does is a second key nobody is tracking.Change
The four lines and their local
import osare removed. Nothing else reads the variable.Tests
test_api.pythat asserted the flag unlocks L1 now assert it does not (L0), and clean up withtry/finally. Both fail againstmain.test_the_legacy_flag_unlocks_nothing_on_any_field_route: sets the flag, presents a valid login and no grant, requires the L0 answer on all four routes. Fails againstmain.test_a_grant_still_unlocks_l1_so_the_refusal_above_is_a_refusal: same flag, same login, plus a real grant for the field; L1 on all four. So the L0 above is a refusal, not an outage.harness/bin/stomata run: 12/12. Suite 174 passed, 1 xfailed (was 172). Lint 36, unchanged.Operator note
If any deployment has
AR_ACCOUNT_L1=legacyset, its logged-in users have been seeing L1 without a grant, and will see L0 after this merges. That is the intended behaviour; issue grants through Pancake.Review finding A4, 2026-10-08.