Skip to content

ra-rpc: populate Unix peer creds for UDS endpoints - #627

Merged
kvinwang merged 5 commits into
masterfrom
feat/remoteendpoint-unix-peer
Apr 1, 2026
Merged

ra-rpc: populate Unix peer creds for UDS endpoints#627
kvinwang merged 5 commits into
masterfrom
feat/remoteendpoint-unix-peer

Conversation

@kvinwang

@kvinwang kvinwang commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

This PR exposes Unix-domain peer credentials to RPC handlers and wires the existing Unix-socket callers to preserve that information.

Changes

  • add UnixPeerCred { pid, uid, gid } to ra-rpc
  • extend RemoteEndpoint::Unix to carry peer: Option<UnixPeerCred>
  • add UnixPeerCredListener, a small Rocket listener wrapper that reads peer credentials from accepted Unix streams via UnixStream::peer_cred()
  • use that listener in guest-agent's internal Unix-socket servers so handlers receive peer creds in CallContext.remote_endpoint
  • add unit tests for endpoint mapping and peer-cred propagation

Validation

  • cargo check -p ra-rpc -p dstack-guest-agent
  • cargo test -p ra-rpc
  • cargo clippy -p ra-rpc -p dstack-guest-agent -- -D warnings

Notes

  • This is a source-breaking API change for downstream code that pattern-matches on RemoteEndpoint::Unix(...); callers need to switch to RemoteEndpoint::Unix { path, peer }.
  • When peer credentials are unavailable, peer remains None.

@kvinwang kvinwang changed the title ra-rpc: add Unix peer cred to RemoteEndpoint::Unix ra-rpc: plumb Unix peer info into RemoteEndpoint::Unix Apr 1, 2026
@kvinwang kvinwang changed the title ra-rpc: plumb Unix peer info into RemoteEndpoint::Unix ra-rpc: populate Unix peer creds for UDS endpoints Apr 1, 2026
@kvinwang
kvinwang merged commit 0de3b67 into master Apr 1, 2026
15 checks passed
@kvinwang
kvinwang deleted the feat/remoteendpoint-unix-peer branch July 20, 2026 14:04
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