[codex] OPE-208 reject reserved admin create-user data fields - #199
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7021e9a39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | "role" | ||
| | "banned" | ||
| | "banReason" | ||
| | "ban_reason" |
There was a problem hiding this comment.
Reject configured physical field aliases
When an app configures custom database column names for protected user fields (for example AdminOptions.schema.user_ban_reason_field = "admin_ban_reason", or core user field_names aliases), this hard-coded alias list still allows that physical name through data. Schema-aware adapters resolve both logical and physical field names, so the create query writes the default protected value and then the request-supplied physical key maps to the same column later, overwriting it; validate against the configured schema/physical aliases as well as these default names.
Useful? React with 👍 / 👎.
Summary
Fixes OPE-208 by closing the admin create-user custom-data validation gap for snake_case reserved/generated user fields.
Root Cause
/admin/create-uservalidateddataagainst camelCase reserved field names, butAdminStore::create_userwrites customdatakeys directly into the snake_case create query after setting defaults. That allowed fields likeemail_verifiedandban_reasonto overwrite protected defaults.Changes
Validation
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest run -p rustauth-plugins --all-features(760 passed, 3 skipped)Linear: OPE-208