Summary
Migrate the relay proxy from github.com/labstack/echo/v4 to github.com/labstack/echo/v5 to benefit from the latest improvements, bug fixes, and API changes introduced in Echo v5.
Motivation
Echo v5 brings several improvements over v4:
- Cleaner, more consistent API
- Better error handling
- Improved routing
- Active development and support
Scope
The migration touches cmd/relayproxy/ and cmdhelpers/api/middleware/.
Dependencies to update
| Current |
Target |
github.com/labstack/echo/v4 v4.15.2 |
github.com/labstack/echo/v5 |
github.com/labstack/echo-contrib |
Check v5 compatibility or find alternatives |
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho |
Check v5 compatibility |
Middleware to validate
All existing middleware must keep working after the migration:
Built-in middleware (currently from echo/v4/middleware):
middleware.BodyDumpWithConfig — used for debug logging
middleware.CORSWithConfig — CORS support
middleware.Recover — panic recovery
Third-party middleware:
echoprometheus.NewMiddlewareWithConfig (from echo-contrib) — Prometheus metrics
otelecho.Middleware — OpenTelemetry tracing
Custom middleware (cmd/relayproxy/api/middleware/):
KeyAuthExtended — API key authentication (user + admin)
VersionHeader — adds version header to responses
StreamAuthorizer — SSE stream authorization
AuthMiddlewareErrHandler — custom auth error handler
Helper middleware (cmdhelpers/api/middleware/):
ZapLogger — structured request logging with Zap
Acceptance Criteria
Notes
Echo v5 introduced breaking changes from v4. Key API differences to review:
echo.Context interface changes
- Middleware signature changes
- Error handler changes
- Router API changes
Check the Echo v5 migration guide before starting.
Summary
Migrate the relay proxy from
github.com/labstack/echo/v4togithub.com/labstack/echo/v5to benefit from the latest improvements, bug fixes, and API changes introduced in Echo v5.Motivation
Echo v5 brings several improvements over v4:
Scope
The migration touches
cmd/relayproxy/andcmdhelpers/api/middleware/.Dependencies to update
github.com/labstack/echo/v4 v4.15.2github.com/labstack/echo/v5github.com/labstack/echo-contribgo.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelechoMiddleware to validate
All existing middleware must keep working after the migration:
Built-in middleware (currently from
echo/v4/middleware):middleware.BodyDumpWithConfig— used for debug loggingmiddleware.CORSWithConfig— CORS supportmiddleware.Recover— panic recoveryThird-party middleware:
echoprometheus.NewMiddlewareWithConfig(fromecho-contrib) — Prometheus metricsotelecho.Middleware— OpenTelemetry tracingCustom middleware (
cmd/relayproxy/api/middleware/):KeyAuthExtended— API key authentication (user + admin)VersionHeader— adds version header to responsesStreamAuthorizer— SSE stream authorizationAuthMiddlewareErrHandler— custom auth error handlerHelper middleware (
cmdhelpers/api/middleware/):ZapLogger— structured request logging with ZapAcceptance Criteria
echo-contribandotelechoupdated or replaced with v5-compatible alternativesapi/aws_lambda.go) still worksNotes
Echo v5 introduced breaking changes from v4. Key API differences to review:
echo.Contextinterface changesCheck the Echo v5 migration guide before starting.