Skip to content

Harden seed parsing edge cases#779

Merged
EffortlessSteven merged 1 commit into
mainfrom
codex/build-edge-case-tests-and-refactor-code
May 17, 2026
Merged

Harden seed parsing edge cases#779
EffortlessSteven merged 1 commit into
mainfrom
codex/build-edge-case-tests-and-refactor-code

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • Ensure Seed::from_env_value correctly treats short or invalid-length 0x-prefixed inputs as ordinary text rather than attempting to parse them as 64-char hex, closing a deterministic-derivation footgun for oddly formatted env seeds.

Description

  • Isolate 64-character hex candidate detection into a new helper hex_seed_candidate and simplify Seed::from_env_value to use it (file: crates/uselesskey-core/src/srp/seed.rs).
  • Preserve the existing fallback to BLAKE3 hashing for non-hex inputs and keep parse_hex_32 behavior unchanged.
  • Add two edge-case tests to validate that short 0x-prefixed strings and 0x-prefixed invalid-length hex strings are hashed as ordinary input.

Testing

  • Ran cargo test -q -p uselesskey-core srp::seed::tests and the targeted tests passed successfully.
  • Ran cargo test -q -p uselesskey-core and all uselesskey-core tests passed successfully.
  • Ran cargo clippy -q -p uselesskey-core --all-targets -- -D warnings and lint checks passed with no warnings.

Codex Task

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 58 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2fde8da8-7d79-4ed5-abc0-84940fefeaf6

📥 Commits

Reviewing files that changed from the base of the PR and between 9756a7d and 1a850ec.

📒 Files selected for processing (1)
  • crates/uselesskey-core/src/srp/seed.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/build-edge-case-tests-and-refactor-code

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven merged commit 02afbec into main May 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant