Skip to content

Enforce allow-list schema for account preferences write (BFP-4644) - #292

Merged
NidaKarim merged 3 commits into
mainfrom
nida/bfp-4644-authorize-preferences-writes-by-jwtsub-and-enforce-schema
Jul 3, 2026
Merged

Enforce allow-list schema for account preferences write (BFP-4644)#292
NidaKarim merged 3 commits into
mainfrom
nida/bfp-4644-authorize-preferences-writes-by-jwtsub-and-enforce-schema

Conversation

@NidaKarim

Copy link
Copy Markdown
Contributor

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

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>
@NidaKarim
NidaKarim requested review from a team, alawrenc and lucasfronza as code owners July 3, 2026 19:45
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alawrenc

alawrenc commented Jul 3, 2026

Copy link
Copy Markdown
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>
@NidaKarim

Copy link
Copy Markdown
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.

@NidaKarim
NidaKarim merged commit 278abc5 into main Jul 3, 2026
8 checks passed
@NidaKarim
NidaKarim deleted the nida/bfp-4644-authorize-preferences-writes-by-jwtsub-and-enforce-schema branch July 3, 2026 20:03
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.

3 participants