fix(relay): authenticate endpoints and fail closed on missing routes

This commit is contained in:
sagitchu
2026-11-08 23:31:08 +08:00
parent 46bfb86c1b
commit 7f0177491b
50 changed files with 5405 additions and 277 deletions
+6 -1
View File
@@ -327,10 +327,15 @@ func ParseService(cfg *config.ServiceConfig) (service.Service, error) {
)
}
handlerRouter := xchain.NewRouter(routerOpts...)
if mdutil.GetBool(metadata.NewMetadata(cfg.Handler.Metadata), "chain.strict") {
handlerRouter.WithRequiredChain()
}
var h handler.Handler
if rf := registry.HandlerRegistry().Get(cfg.Handler.Type); rf != nil {
h = rf(
handler.RouterOption(xchain.NewRouter(routerOpts...)),
handler.RouterOption(handlerRouter),
handler.AutherOption(auther),
handler.AuthOption(auth_parser.Info(cfg.Handler.Auth)),
handler.BypassOption(xbypass.BypassGroup(bypass_parser.List(cfg.Bypass, cfg.Bypasses...)...)),