Skip to content

Validate the reco counts report database ID - #3367

Merged
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/database-id-validation
Aug 9, 2026
Merged

Validate the reco counts report database ID#3367
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/database-id-validation

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Real Vuforia rejects a reco counts request whose path names a database its server keys do not belong to with a 401 AuthenticationFailure — observed against the real service in #3366, including when the database name is passed in place of the ID — where the mock accepted any ID, so code which built the path from a database name or a stale ID passed against the mock and failed for real.

CloudDatabase now has a database_id which defaults to a random string and round-trips through CloudDatabaseDict, to_dict, from_dict and the target manager's create-database route, so the in-process and Flask/Docker backends do not disagree, and a new validate_database_id_matches_keys validator runs immediately after authorization, before the month is looked at, matching the ordering observed from real Vuforia.

The tests drop the per-backend ID helper and the redundant vuforia_database_id fixture in favour of reading vuforia_database.database_id, and add verified cases for an ID belonging to no database and for a database name given in the ID's place; differences-to-vws.rst drops the note that the mock cannot make this check.

All 26 cases pass across the three mock backends, but the real-Vuforia leg has only been run here against placeholder credentials, so it is unverified until credentialed CI runs.

Closes#3362.

🤖 Generated with Claude Code

Closes#3362.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous wording described only behaviour which matches real Vuforia,
which does not belong in this document.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for freeto 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.

Give CloudDatabase a database ID and validate it in the reco counts path

1 participant

@adamtheturtle