Source the local PostgreSQL password from .env instead of hardcoding it - #1540
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Remediates two SonarCloud
secrets:S6698findings (issue keysAZ6OP-dvRoUIIbwnU9kaindocker-compose.yml,AZ6OP-ORRoUIIbwnU9duinservices/document-service/app/config.py): the shared Postgres dev password was hardcoded in the compose stack and in the document-service defaultdatabase_url.Root-cause fix: the password now lives in a single, gitignored
.envconsumed by compose and the Makefile.docker-compose.infra.yml(postgres) and every service block indocker-compose.yml:otterworks_dev→${POSTGRES_PASSWORD:?...}(required; compose fails fast with a pointer to.env.exampleif unset)..env.examplewith an emptyPOSTGRES_PASSWORD=; newmake .envtarget generates.envwithopenssl rand -hex 16on first use.up/infra-up/build/dev-backenddepend on it, somake upstill works out of the box.-include .env+export POSTGRES_PASSWORD/DB_PASSWORD ?= $(POSTGRES_PASSWORD)somake seed,testdata-*andscripts/seed.py/testdata/harness/validate.pypick the same password (theirotterworks_devfallbacks removed).dast-scan.ymlrunsmake .envbefore bringing the stack up (no change to what the gate checks).Settings.database_urldefault drops the credential:postgresql+asyncpg://otterworks@localhost:5432/otterworks; the real URL comes fromDOC_SVC_DATABASE_URLas compose already sets it.tests/test_config.pyasserts the default carries no password (fails on the old code) and that the env override is honored.Not touched:
services/document-service/alembic.iniand other services' own config defaults (separate findings),docker-compose.procs.yml/docker-compose.insurance.yml.Verified:
poetry run pytest tests/test_config.py(2 passed),ruff check,docker compose ... configpasses with.envand fails with the expected message without it.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/6d478d16034b42838ca75e162a476901
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/6d478d16034b42838ca75e162a476901?variant=devin
Requested by: @mbatchelor81