mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-15 13:09:45 +02:00
fix(entrypoint): log global inbound mTLS errors instead of panicking
When resolveInboundMTLSProfileForRoute fails for the global profile, emit a zerolog error and continue without applying that pool. Apply inbound mTLS from the global profile only when err is nil and pool is non-nil. Add yaml struct tags to InboundMTLSProfile alongside json for YAML config loading. Clarify no-op stub methods in inbound_mtls_validation_test with comments.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/yusing/godoxy/internal/types"
|
||||
gperr "github.com/yusing/goutils/errs"
|
||||
)
|
||||
@@ -88,9 +89,9 @@ func (srv *httpServer) mutateServerTLSConfig(base *tls.Config) *tls.Config {
|
||||
}
|
||||
pool, err := srv.resolveInboundMTLSProfileForRoute(nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Err(err).Msg("inbound mTLS: failed to resolve global profile, falling back to per-route mTLS")
|
||||
}
|
||||
if pool != nil {
|
||||
if pool != nil && err == nil {
|
||||
return applyInboundMTLSProfile(base, pool)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user