Skip to content

Fix PostgreSQL authentication failure logging - #5726

Open
jokrasno wants to merge 1 commit into
clockworklabs:masterfrom
jokrasno:fix/5696-pg-auth-logging
Open

Fix PostgreSQL authentication failure logging#5726
jokrasno wants to merge 1 commit into
clockworklabs:masterfrom
jokrasno:fix/5696-pg-auth-logging

Conversation

@jokrasno

Copy link
Copy Markdown

Description of Changes

Closes #5696.

  • Stop passing the supplied PostgreSQL password/token to authentication logging.
  • Categorize token validation failures as invalid credentials, identity-provider failures, or unexpected internal failures.
  • Log invalid credentials at WARN and provider/internal failures at ERROR with distinct messages.
  • Add captured-log tests proving a synthetic supplied token is absent from messages/targets and each category uses the intended level.

API and ABI breaking changes

No wire API or ABI changes. TokenValidationError gains typed variants and an operational category API; downstream Rust code that exhaustively matches this public enum may require a source update.

Expected complexity level and risk

  1. The PostgreSQL change is narrow, but the classification is defined at the token-validation source so logging does not rely on error text. The client-visible authentication response remains unchanged.

Testing

  • cargo fmt --all -- --check
  • Exact external red/green logging harness: 2 expected failures before; 3/3 passing after
  • cargo test -p spacetimedb-pg -- --test-threads=1 (6/6)
  • cargo test -p spacetimedb-core -p spacetimedb-client-api -- --test-threads=1 (151/151 core, 50/50 client-api, runnable doctests pass)
  • cargo clippy -p spacetimedb-core -p spacetimedb-client-api -p spacetimedb-pg --all-targets --no-deps -- -D warnings

The dependency-inclusive Windows Clippy invocation is blocked by an unrelated existing unused binding in crates/snapshot/src/lib.rs:1577; no unrelated fix is included.

@CLAassistant

CLAassistant commented Aug 12, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Signed-off-by: DefinitelyNotJosh1 <krasnogo27@up.edu>
@jokrasno
jokrasno force-pushed the fix/5696-pg-auth-logging branch from 3357041 to ce1d33f Compare August 12, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop logging PG tokens and classify authentication failures

2 participants