Skip to content

feat: validate identity trait limits - #33

Open
gagantrivedi wants to merge 3 commits into
refactor/server-runfrom
feat/validate-identity-traits
Open

gagantrivedi wants to merge 3 commits into
refactor/server-runfrom
feat/validate-identity-traits

Conversation

@gagantrivedi

Copy link
Copy Markdown
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #14

Stacked on #32.

  • Validate identity trait limits. Identifier ≤ 2000 chars, trait key ≤ 200, string (or JSON text of list/object) trait value ≤ 2000, matching Core's limits. Violations return 400 {"status": "bad_request", "message": "traits[1].trait_value: ..."}. Previously identities had no request validation. Duplicate trait keys in a POST are de-duplicated, last value wins.
  • transient flag on IdentityWithTraits and TraitModel, as sent by SDKs. Parsed (default false), never serialized, and not part of identity equality.

How did you test this code?

  • Parametrised unit tests for each limit and for transient (de)serialization.
  • Route tests for the 400 responses (POST and GET) and duplicate-key de-duplication.
  • cargo fmt, cargo clippy -- -D warnings and the full test suite pass on each commit.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9d9a5365-0512-4558-8f94-24206515db61

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@gagantrivedi
gagantrivedi marked this pull request as ready for review October 31, 2026 10:24
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