feat: add auth proxy mode#112
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 581c5a5fb2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new auth-proxy mode to the erpc CLI that authenticates incoming JSON-RPC requests using configured eRPC auth/rate-limits and then reverse-proxies the request to a configured upstream. This extends the CLI surface area and updates build packaging so the new subcommand ships in standard binaries/images.
Changes:
- Add an
auth-proxysubcommand tocmd/erpcthat performs auth checks and then reverse-proxies to an upstream URL. - Update build/run entrypoints to build the full
./cmd/erpcpackage (Makefile, Dockerfile, GoReleaser) so the new subcommand is included. - Add initial unit test coverage for the auth-proxy’s secret auth + rate-limit behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Build/run targets now build the full cmd/erpc package so new subcommands are included. |
| Dockerfile | Container build now compiles ./cmd/erpc (with and without pprof tag). |
| cmd/erpc/main.go | Registers the new auth-proxy CLI subcommand and --upstream flag. |
| cmd/erpc/auth_proxy.go | Implements auth-checking reverse proxy server/handler. |
| cmd/erpc/auth_proxy_test.go | Adds a test verifying secret auth and rate-limit enforcement before proxying. |
| .goreleaser.yaml | GoReleaser build entrypoint changed to ./cmd/erpc to include all subcommands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
auth-proxysubcommand that checks configured eRPC auth before reverse-proxying to an upstreamcmd/erpcpackage so the new subcommand is included in Docker/GoReleaser/Makefile buildsTests
go test ./cmd/... -count=1go test ./auth ./upstream -count=1make buildPLA-1781