You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Credential guard tracebacks on a non-integer POSTGRES_PORT instead of reporting it #92
scripts/check_deploy_credentials.py promises "one line per problem" and reports malformed DATABASE_URL / DATABASE_READONLY_URL / REDIS_URL values instead of raising (see PR #90 / #90 review fix 713735b). The same guard still crashes with a traceback when the datastore is configured via components and POSTGRES_PORT is not an integer:
export POSTGRES_PASSWORD=app_password_9f3a
export POSTGRES_READONLY_PASSWORD=ro_password_7c21
export REDIS_PASSWORD=cache_password_4b18
export POSTGRES_PORT=abc # typo
unset DATABASE_URL DATABASE_READONLY_URL
python scripts/check_deploy_credentials.py
# ValueError: POSTGRES_PORT must be an integer, got 'abc'.
audit_credentials() calls agentkit.config.resolve_postgres_url() (twice) without guarding it, and that function raises ValueError for a non-integer POSTGRES_PORT (agentkit/config.py, documented under "Raises"). Both the application (Settings) and the guard hit the same exception; the result is a traceback in the compose migrations service instead of the actionable problem line the rest of the audit produces.
Impact
Severity: low. The deployment still fails closed — the migration service stops — so no insecure configuration can slip through; only the error presentation is wrong.
Wrap the two resolve_postgres_url() calls in audit_credentials() with a small helper that catches the ValueError and appends POSTGRES_PORT is not a valid integer. to problems, in the same style as _parse_url() / _resolve_redis_url(). Settings keeps its fail-fast behavior (a ValidationError at startup is fine there); only the guard needs the stable message. Add a regression test with POSTGRES_PORT=abc in component mode.
Relates to #86 (guard correctness follow-ups from the PR #84 review).
Activity