rpc: gate the claim skip process-wide for every server - #1729
Draft
erikhortsch wants to merge 1 commit into
Draft
Conversation
Wires psrpc's WithServerSkipClaim into WithServerObservability, which is the one seam every server constructor shares -- WithDefaultServerOptions calls it, and the constructors that take only a logger reach it too. The setting is process-wide because the claim is a transport policy rather than a per-service one, and it is read per request so callers may set it before or after their servers exist and revoke it without a redeploy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires psrpc's new
WithServerSkipClaim(livekit/psrpc#122) intoWithServerObservability.WithServerObservabilityis the one seam every server constructor shares:WithDefaultServerOptionscalls it, and the constructors that take only a loggerreach it too. In cloud that is 33 server sites — 23 via
WithDefaultServerOptionsand 10 via
WithServerObservabilitydirectly — covered by a single edit.The setting is process-wide rather than per-service because the claim is a
transport policy, and it is read per request, so callers may set it before or
after their servers are constructed and revoke it at runtime without a redeploy.
Why not per-config
WithDefaultServerOptionsalready receivesPSRPCConfig, so a field there wasthe obvious home — but
PSRPCConfigis passed by value at construction, whichwould lose the runtime kill switch that motivated the client-side version
(livekit/cloud#4567). It also would not reach the 10 logger-only sites. A
process-wide setter keeps both properties.
Verification
go build ./...— cleango test -race ./rpc/... ./utils/...— passesTestServerSkipClaimcovers the three properties the call sites depend on:unset means claim, the func is consulted per call rather than captured, and it
stays revocable.
Depends on
livekit/psrpc#122.
go.modcurrently pins the pseudo-versionv0.7.5-0.20260819230101-cbf56a2f6872from that branch — needs re-pinning tothe released tag before merge.
🤖 Generated with Claude Code