Repository navigation
fix(db): numeric project id in DSNs (#328) - #347
Merged
Merged
Conversation
Resolves RUSTSEC-2026-0285 (rustls TLS 1.3 handshake) and the devalue, source-map-js and undici advisories that fail the Security workflow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JS SDKs require a numeric project id in the DSN path. Add a per-project
seq (migrations for SQLite and Postgres, backfilled), emit DSNs as
{key}@{host}/{seq}, and resolve the ingest path segment by seq with a
legacy UUID fallback so existing DSNs keep working. extract_dsn_key now
handles any scheme.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.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
seq(SQLite migration20260701000001_project_seq.sql, Postgres006_project_seq.sql), backfilled for existing rows (SQLite by rowid, Postgres bycreated_at).{scheme}://{key}@{host}/{seq}.rotate_dsnreuses the project's seq./api/{project_id}/envelope/resolves the segment as numeric seq first, then falls back to the legacy UUID (Store::resolve_project).extract_dsn_keyhandles anyscheme://(previously hardcodedhttps://).Why
Sentry JS SDKs require a numeric project id in the DSN; UUID project ids make
validateDsnfail, or silently truncate digit-leading UUIDs. Fixes #328.Testing
cargo test --workspace: 265 pass, 0 fail.cargo test -p trapfall_db --features postgres --test testcontainers_postgres: 12 pass against a real Postgres container (including the new seq test); migration 006 applied to a Postgres 17 container with two legacy rows (seq 1, 2 by created_at), idempotent on re-run.postgres_backend.rs(needs TEST_POSTGRES_URL); clippy with--features postgres.Notes
MAX(seq)+1, so deleting the newest project can reuse its number; the DSN key check still guards against mismatch.trapfalld/src/migrate.rs(Postgres import path) only applies migrations 001 and 002; left unchanged.🤖 Generated with Claude Code