-
Notifications
You must be signed in to change notification settings - Fork 20
refactor: streamline public key retrieval by consolidating procedures into ServerService #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughPublic key retrieval was refactored: the cached/local procedure was removed from core, leaving only direct remote fetching. The SDK introduces ServerService.getPublicKey with local/cached/remote resolution, updates EventService and EventAuthorizationService to use it, and modifies ConfigService to cache in-memory signing keys and expose a base64 public key accessor. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant ES as EventService
participant SS as ServerService
participant Cache as Local Key Cache
participant Core as federation-core
participant Remote as Remote Server
Client->>ES: deliver event (origin, signatures)
ES->>SS: getPublicKey(origin, keyId)
alt origin == local server
SS-->>ES: return local public key (base64)
else
SS->>Cache: lookup(origin, keyId)
alt cache hit & valid
Cache-->>SS: cached public key
SS-->>ES: return cached key
else cache miss/expired
SS->>Core: getPublicKeyFromRemoteServer(origin, serverName, keyId)
Core->>Remote: fetch signed key & metadata
Remote-->>Core: signed key + validUntil
Core-->>SS: public key + validUntil
SS->>Cache: store(key, validUntil)
SS-->>ES: return fetched key
end
end
ES-->>Client: continue verification with obtained key
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (6)
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 |
… into ServerService
ba5fb73 to
5d9e401
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 81.07% 81.67% +0.59%
==========================================
Files 63 63
Lines 4719 4682 -37
==========================================
- Hits 3826 3824 -2
+ Misses 893 858 -35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… into ServerService
Summary by CodeRabbit
New Features
Refactor
Chores