fix(security): reject empty credential secrets - #224
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a9d7501e4
ℹ️ 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".
| let length = value.trim().len(); | ||
| if length < MIN_CREDENTIAL_LENGTH_BYTES { |
There was a problem hiding this comment.
Enforce the eight-character minimum
For multibyte credentials, trim().len() counts UTF-8 bytes rather than characters, so a value such as 🔐🔐 is accepted as length 8 despite containing only two characters; the added test explicitly locks in this weaker behavior. Count characters after trimming instead, as the repository security baseline requires both credential values to contain at least eight characters.
AGENTS.md reference: AGENTS.md:L58-L62
Useful? React with 👍 / 👎.
Type of Change
Related Issues
Fixes rustfs/backlog#1096
Summary of Changes
datafield is absent or emptyChecklist
make pre-commit(fmt-check + clippy + test + e2e-check + console-lint + console-build + console-fmt-check)Impact
Verification
Additional Notes
Kubernetes Secret retrieval remains in
Context, while credential invariants are evaluated by a private pure helper. Length is measured in UTF-8 bytes after trimming to match RustFS runtime normalization. Existing byte-length compatibility is preserved, and the public contract now states that behavior explicitly.Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.