Skip to content

Commit 23e55e4

Browse files
committed
docs(boundarylogproxy): document wire format compatibility
Boundary uses its own proto definitions with matching field numbers, allowing direct unmarshaling into agent proto types.
1 parent df8eeec commit 23e55e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

agent/boundarylogproxy/proxy.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
// Package boundarylogproxy provides a Unix socket server that receives boundary
22
// audit logs and forwards them to coderd via the agent API.
3+
//
4+
// Wire Format:
5+
// Boundary sends length-prefixed protobuf messages over the Unix socket.
6+
// Each message is:
7+
// - 4 bytes: big-endian uint32 length of the protobuf data
8+
// - N bytes: protobuf-encoded BoundaryLogsRequest
9+
//
10+
// Boundary must generate its proto types with the same field numbers as the
11+
// agent proto (see agent/proto/agent.proto BoundaryLog and ReportBoundaryLogsRequest).
312
package boundarylogproxy
413

514
import (
@@ -138,7 +147,8 @@ func (s *Server) handleConnection(conn net.Conn) {
138147
return
139148
}
140149

141-
// Unmarshal proto message.
150+
// Unmarshal proto message. Boundary's proto wire format must match
151+
// the agent proto exactly (same field numbers and types).
142152
var req agentproto.ReportBoundaryLogsRequest
143153
if err := proto.Unmarshal(buf, &req); err != nil {
144154
s.logger.Warn(s.ctx, "unmarshal error", slog.Error(err))

0 commit comments

Comments
 (0)