feat: configure gRPC UNIX socket attributes - #154
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #154 +/- ##
==========================================
+ Coverage 84.81% 85.47% +0.65%
==========================================
Files 10 10
Lines 652 654 +2
==========================================
+ Hits 553 559 +6
+ Misses 99 95 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The new UID/GID string validation is architecture-dependent (32-bit vs 64-bit) and can incorrectly reject valid IDs due to strconv.IntSize parsing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds configurable UNIX socket attributes (mode/UID/GID) for the gRPC listener by upgrading to tcplisten v1.6.0, wiring the options into listener creation, and extending the JSON schema and tests to cover validation and serving behavior.
Changes:
- Add
grpc.unix_socketto config/schema and pass options intotcplisten.CreateListenerWithOptions. - Add strict validation for
uid/gidinputs to reject weak/ambiguous decodings. - Add a new OS-gated test suite validating config decoding, ID validation, and actual socket attributes during
Serve.
File summaries
| File | Description |
|---|---|
| tests/unix_socket_test.go | Adds coverage for unix_socket config decoding, UID/GID validation edge cases, and runtime socket attribute application. |
| config.go | Introduces UnixSocket config field, validates unix_socket against the listen address, and adds strict UID/GID validation helper. |
| plugin.go | Validates unix_socket ID inputs (when present) and passes unix socket options into listener creation. |
| schema.json | Exposes unix_socket settings by referencing the shared tcplisten schema. |
| go.mod | Bumps github.com/roadrunner-server/tcplisten to v1.6.0. |
| go.sum | Updates checksums for tcplisten v1.6.0. |
| tests/go.mod | Bumps test module’s tcplisten dependency to v1.6.0. |
| tests/go.sum | Updates test module checksums for tcplisten v1.6.0. |
Review details
- Files reviewed: 6/8 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Part of roadrunner-server/roadrunner#1789.
grpc.unix_socketsettings for mode, UID, and GID.tcplisten v1.6.0and its shared schema. Omitted settings keep the current defaults.Explicit socket attributes require a filesystem UNIX listener.