Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @alpe's task in 2m 5s —— View job Code Review: KMS Signer Backend
SummaryOverall the implementation is clean, well-structured, and production-oriented. The KMS signer follows solid security practices (no private key material, defers to AWS credential chain, retries with backoff, public key caching). A few issues are worth addressing before merge. Issues1. Default timeout comment vs. implementation mismatch
// Options
Timeout time.Duration // Default: 10s ← comment says 10s
// NewKmsSignerFromClient
o := Options{Timeout: 5 * time.Second, ...} // actual default: 5sThe config default in 2. Stale flag description for signer type
cmd.Flags().String(FlagSignerType, def.Signer.SignerType, "type of signer to use (file, grpc, awskms)")
3. TOCTOU window in
// Current pattern allows thundering herd on cache expiry
if expired {
// multiple goroutines can get here simultaneously
refreshCtx, cancel := context.WithTimeout(context.Background(), s.opts.timeout())
err := s.fetchPublicKey(refreshCtx) // each makes a KMS call
cancel()Consider a 4.
refreshCtx, cancel := context.WithTimeout(context.Background(), s.opts.timeout())The 5. Address not updated on key refresh
6.
7. Missing test: context cancellation stops retries
8. Timing-sensitive test may be flaky in CI
s, err := NewKmsSignerFromClient(ctx, mock, "test-key", &Options{CacheTTL: time.Nanosecond, Timeout: 20 * time.Millisecond})
time.Sleep(2 * time.Millisecond)The 20ms timeout for KMS + 200ms assertion threshold should give plenty of headroom, but the Observations (non-blocking)
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3171 +/- ##
==========================================
- Coverage 60.40% 60.37% -0.03%
==========================================
Files 115 117 +2
Lines 11902 12074 +172
==========================================
+ Hits 7189 7290 +101
- Misses 3905 3967 +62
- Partials 808 817 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚧 Resolve #3163 - early version
Overview