refactor: keep user-router runtime state out of options#1036
Conversation
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
|
@houyuwushang thanks for this contribution, and for your patience while I tested it out. I've identified a regression in this change that breaks the 'user remapping' feature by causing a remapped user to be sent through the incorrect user route (or the default fallthrough route), instead of the expected/configured route for the inbound username when the user is configured with The main issue is that at pkg/backends/alb/mech/ur/user_router.go:124-125, One fix might be to set an This way, the outbound username is properly remapped while the inbound username is still used for the routes map lookup. |
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
|
Thanks for catching and explaining the regression. I pushed 584ff7f to address it. The fix keeps the inbound Local validation:
|
Description
Fixes #1010.
Moves resolved user-router runtime state out of
ur/options.Options:ur.HandlerDefaultHandler,ToHandler, andToStatusfrom the user-router options structsvalidateAndStartUserRouterand applies them only after validation succeedsNoRouteStatusCodeunchanged while still using the effective startup response codeTests:
go test -count=1 ./pkg/backends/alb/mech/ur ./pkg/backends/albgo test -count=1 ./pkg/backends/alb/...go tool golangci-lint run --timeout 5m ./pkg/backends/alb/...go test -run '^$' ./...Type of Change
AI Disclosure