fix(env): allowlist JVSPATIAL_POSTGRES_* keys#22
Closed
eldonm wants to merge 1 commit into
Closed
Conversation
The Postgres backend (jvspatial/db/factory.py, jvspatial/db/postgres.py) reads JVSPATIAL_POSTGRES_DSN, JVSPATIAL_POSTGRES_MIN_POOL_SIZE, JVSPATIAL_POSTGRES_MAX_POOL_SIZE, and JVSPATIAL_POSTGRES_POOLER_MODE, but the canonical ALLOWED_ENV_KEYS set in env_adapter.py was missing all four. PG deployments printed "Unknown JVSPATIAL_* env var ignored" at boot, and JVSPATIAL_STRICT_ENV_ALLOWLIST=true would have made them fatal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Benchmark comparisonThreshold: ±25% (informational, does not block merge)
|
Member
Author
|
Closing — folding into existing WIP on dev rather than landing as standalone PR. |
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.
Summary
jvspatial/db/factory.pyandjvspatial/db/postgres.pyreadsJVSPATIAL_POSTGRES_DSN,JVSPATIAL_POSTGRES_MIN_POOL_SIZE,JVSPATIAL_POSTGRES_MAX_POOL_SIZE, andJVSPATIAL_POSTGRES_POOLER_MODE, but the canonicalALLOWED_ENV_KEYSset injvspatial/env_adapter.pydid not list them.Unknown JVSPATIAL_* env var 'JVSPATIAL_POSTGRES_DSN' ignored.at boot even though the value was honored. WithJVSPATIAL_STRICT_ENV_ALLOWLIST=truethe warning escalates to a fatalValueErrorand breaks startup.# Databaseblock inALLOWED_ENV_KEYS, alongside the existing Mongo / DynamoDB entries.Test plan
pytest tests/api/test_env_allowlist_audit.py -q→ 5 passedjvspatial/db/factory.pyandjvspatial/db/postgres.pyviagrep -rn 'JVSPATIAL_POSTGRES_' jvspatial/🤖 Generated with Claude Code