Repository navigation
feat(adapters)!: rind-jsonwebtoken and rind-instant-acme check the CPU in default_provider() - #445
Conversation
Quest-Claim: 2366f7f1959c7c19
…U in default_provider() Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Your OpenCode Go account is out of credit. Top it up, then re-trigger Pullfrog. OpenCode Go's response
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head 306184f against base 1dce2e7.
No actionable findings. Both adapters call rind::cpu::check before returning their private provider, wrap the error in the adapter's public MissingFeature with Display/Error implementations, and preserve the static reference needed by the upstream APIs. The changed tests, benchmark and examples consistently use default_provider; the jsonwebtoken function explicitly uses std::result::Result rather than its imported upstream error alias. Crypto callbacks and provider contents are unchanged.
Direction: land this before the 11.0.0 release as documented. Add a fresh-process required-feature-denied regression and an external consumer test without a direct rind dependency to pin the new failure path and intended dependency benefit; these are coverage suggestions, not identified implementation defects. The documentation correctly retains rind-rcgen's separate startup-check requirement.
Limits: GitHub-only static review of the full 15-file diff and the adapter/upstream interfaces inspected during the preceding plan review. No builds, doctests, CPU-denial probes, crypto tests, CI or quest context executed; reported validation was not independently reproduced. This COMMENT is not merge approval.

Finishes quest/m1/adapter-cpu-check.md.
Summary
rind-jsonwebtoken and rind-instant-acme now refuse a CPU missing a feature rind requires the same way rind-rustls, rind-dimpl, and rind-object-store have since moq-dev/rind#420:
default_provider()returns the adapter's ownMissingFeature. A user of either adapter no longer needsrindas a direct dependency just to callrind::cpu::check().pub fn default_provider() -> Result<&'static CryptoProvider, MissingFeature>and its ownMissingFeature, identical to the other adapters'. TheCryptoProviderstatic is now private, so there is one way to get it.&'static CryptoProvider(jsonwebtoken'sinstall_default(&'static self), instant-acme'sAccount::builder(.., &'static CryptoProvider)), so the&'staticreturn fits both; nothing needed another shape.default_provider().Public API
Breaking, for both crates:
rind::cpu::check()?;thenrind_jsonwebtoken::DEFAULT_PROVIDER.install_default()rind_jsonwebtoken::default_provider()?.install_default()rind::cpu::check()?;thenAccount::builder(http, &rind_instant_acme::DEFAULT_PROVIDER)Account::builder(http, rind_instant_acme::default_provider()?)DEFAULT_PROVIDER.hmacdefault_provider()?.hmacAdded:
rind_jsonwebtoken::MissingFeature,rind_instant_acme::MissingFeature. No wire impact.Release
This must merge before the release PR moq-dev/rind#424, so the break rides rind-jsonwebtoken 11.0.0, the major bump the adapter-version change (moq-dev/rind#440) already takes. release-plz refreshes #424 from this commit once it lands; the release PR itself is left alone here. rind-instant-acme is unpublished.
Choices made without asking
default_provider(), rind-ring'scpu::check(), orrind::cpu::check()) rather than telling every binary to depend onrind.KeyPairremains the one adapter surface that still needsrind::cpu::check(), since its errors are rcgen's.Follow-ups
rind::cpu::check(). Recommend drop: its README example already depends onrinddirectly forrind::rand::fillto make the serial number, andKeyPair::generate's error type is rcgen's, so a rind-rcgen check would not save the dependency.Validation
nix develop --command just check origin/main: passes (rs, msrv, bench, quest, shell, nix), including both crates' doctests, the interop/differential/install/ctgrind tests, and the pebble issuance test.(Written by Claude Opus 5.5 with high)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.01a1b484-eac1-7bc2-a80e-6fab97a8f9c7, round 1Both adapters check CPU support before returning their private providers, all repository consumers and examples use the new API, and no actionable defects were found; tests were not run in the read-only environment.