Skip to content

Handle malformed KMS command output without panicking#228

Open
AnthonyRonning wants to merge 1 commit into
masterfrom
codex-opensecret-kms-errors-opensecret
Open

Handle malformed KMS command output without panicking#228
AnthonyRonning wants to merge 1 commit into
masterfrom
codex-opensecret-kms-errors-opensecret

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • parse kmstool output by its CIPHERTEXT and PLAINTEXT labels instead of indexing assumed lines
  • return operation-specific errors for execution failures, nonzero responses, non-UTF-8 output, missing fields, malformed base64, and wrong random-byte lengths
  • propagate enclave and OS randomness failures through seed and API-key generation instead of panicking

Testing

  • nix develop -c cargo fmt --all -- --check
  • nix develop -c cargo test encrypt::tests --locked (13 passed)
  • nix develop -c cargo clippy --all-targets --all-features --locked -- -D warnings
  • nix develop -c cargo test --all-targets --all-features --locked (221 passed, 16 database-dependent tests ignored)

Open in Devin Review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2343fc52-09a1-4ec0-bb75-513746347111

📥 Commits

Reviewing files that changed from the base of the PR and between a3ecc93 and f2987a1.

📒 Files selected for processing (3)
  • src/encrypt.rs
  • src/private_key.rs
  • src/web/protected_routes.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex-opensecret-kms-errors-opensecret

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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