Enforce allow-list schema for account preferences write (BFP-4644) - #292
Merged
NidaKarim merged 3 commits intoJul 3, 2026
Conversation
Replace the PUT /api/v1/account/preferences request model with a strict
allow-list to match the server-side mass-assignment fix. The write model
now accepts only favorites, functionBarMode, onboardingCompleted and
termsAccepted; unknown fields (language/theme/market and any extra key)
are no longer emitted and are rejected by the server with 400.
- spec: UpdateAccountPreferenceRequest -> additionalProperties: false,
4 optional fields + functionBarMode enum ("all"|"Popular"|"Favorites")
- ts: drop the index signature (no passthrough), add enum
- python: drop additional_properties, add enum validator, aliased fields
- rust: new fields + FunctionBarMode enum
- update example, docs, python test fixture
- read model AccountPreference (GET) left permissive/unchanged
- major version bump (breaking): ts 3.0.0, python/rust 2.0.0
- add CHANGELOG; refresh .apigen-state hashes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
While this is "strictly" not backwards compatible, no one but our FE (and vera) should have been using this, so I think we can make this a minor version bump only |
The preferences write endpoint is effectively only consumed by our own FE and vera, so treat this as a minor bump (matching apigen's convention) rather than a major, despite the strict schema change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
While this is "strictly" not backwards compatible, no one but our FE (and vera) should have been using this endpoint, so I think we can make this a minor version bump only (ts 2.1.0, py/rust 1.18.0) rather than a major. |
nikita-seedlabs
approved these changes
Jul 3, 2026
NidaKarim
deleted the
nida/bfp-4644-authorize-preferences-writes-by-jwtsub-and-enforce-schema
branch
July 3, 2026 20:03
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.
Replace the PUT /api/v1/account/preferences request model with a strict allow-list to match the server-side mass-assignment fix. The write model now accepts only favorites, functionBarMode, onboardingCompleted and termsAccepted; unknown fields (language/theme/market and any extra key) are no longer emitted and are rejected by the server with 400.