Skip to content

test(user): ensure secrets never appear in serialisation views - #340

Merged
stakach merged 1 commit into
masterfrom
spec/user-sensitive-fields
Nov 11, 2026
Merged

stakach merged 1 commit into
masterfrom
spec/user-sensitive-fields

Conversation

@stakach

@stakach stakach commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Adds regression specs on the model side:

  • PUBLIC_DATA / ADMIN_DATA never list password, password_digest, access_token, refresh_token, expires_at or expires
  • none of the public, admin, metadata or group views (JSON and struct) contains those keys or their values
  • admin-only fields (sys_admin, support, misc, login_name, card_number, ui_theme) are missing from the public views and present in the admin views

Test plan

  • CI: spec/user_spec.cr "sensitive field serialisation"

🤖 Generated with Claude Code

Assert password digests and SSO access / refresh tokens are absent from
every public, admin, metadata and group view (JSON and struct), and that
admin-only fields such as sys_admin stay out of the public views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stakach
stakach merged commit b14be2d into master Nov 11, 2026
8 checks passed
@stakach
stakach deleted the spec/user-sensitive-fields branch November 11, 2026 05:20
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.

1 participant