fix: validate unsafe file name characters - #132
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30bdaad46f
ℹ️ 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".
| collection_items_max_count: 100, | ||
| file_name_min_length: 1, | ||
| file_name_max_length: 255, | ||
| file_name_invalid_chars: &['"', '\\'], |
There was a problem hiding this comment.
Export all characters rejected by file validation
Because VALIDATION_LIMITS is documented as the client-side source of truth, clients that consume fileNameInvalidChars will only reject " and \, while PubkyAppFile::validate also rejects every control character via c.is_control(). For names such as file\n.txt or file\0.txt, client-side validation built from these limits will pass data that the model then rejects, so either the exported limits need to include/represent the control-character rule or this field should not be presented as the full invalid-character set.
Useful? React with 👍 / 👎.
Summary
PubkyAppFile.nameto reject characters unsafe forContent-Dispositionheaders.",\, and control characters while preserving Unicode file names.Test plan
cargo test models::file::tests::test_validate_file_name_charsCloses #131