diff --git a/authbridge/authlib/plugins/registry.go b/authbridge/authlib/plugins/registry.go index fc36ab23..fc4cc0a8 100644 --- a/authbridge/authlib/plugins/registry.go +++ b/authbridge/authlib/plugins/registry.go @@ -2,6 +2,7 @@ package plugins import ( "fmt" + "log/slog" "sort" "strings" "sync" @@ -288,7 +289,11 @@ func Build(entries []config.PluginEntry, opts ...pipeline.Option) (*pipeline.Pip } factory, ok := factoryFor(e.Name) if !ok { - return nil, fmt.Errorf("unknown plugin %q (registered: %v)", e.Name, RegisteredPlugins()) + pluginNames := RegisteredPlugins() + if len(pluginNames) == 0 { + slog.Warn("No registered plugins -- Build with --tags or use `go run .` to enable") + } + return nil, fmt.Errorf("unknown plugin %q (registered: %v)", e.Name, pluginNames) } p := factory() if c, ok := p.(pipeline.Configurable); ok { @@ -331,7 +336,11 @@ func BuildWithSPIFFE(entries []config.PluginEntry, p *spiffe.Provider, opts ...p } factory, ok := factoryFor(e.Name) if !ok { - return nil, fmt.Errorf("unknown plugin %q (registered: %v)", e.Name, RegisteredPlugins()) + pluginNames := RegisteredPlugins() + if len(pluginNames) == 0 { + slog.Warn("No registered plugins -- Build with --tags or use `go run .` to enable") + } + return nil, fmt.Errorf("unknown plugin %q (registered: %v)", e.Name, pluginNames) } plugin := factory() // Inject the framework SPIFFE Provider BEFORE Configure runs so diff --git a/authbridge/cmd/authbridge-cpex/main.go b/authbridge/cmd/authbridge-cpex/main.go index 0edcd70a..c788ab5e 100644 --- a/authbridge/cmd/authbridge-cpex/main.go +++ b/authbridge/cmd/authbridge-cpex/main.go @@ -101,12 +101,12 @@ func main() { startSignalToggle() if *configPath == "" { - log.Fatal("--config is required") + log.Fatal("--config is required and must point to a YAML file") } bootCfg, err := config.Load(*configPath) if err != nil { - log.Fatalf("initial config load: %v", err) + log.Fatalf("failed to load config %q: %v", *configPath, err) } var provider *spiffe.Provider if bootCfg.SPIFFE != nil { diff --git a/authbridge/cmd/authbridge-envoy/main.go b/authbridge/cmd/authbridge-envoy/main.go index c565b43c..183c9e8e 100644 --- a/authbridge/cmd/authbridge-envoy/main.go +++ b/authbridge/cmd/authbridge-envoy/main.go @@ -99,7 +99,7 @@ func main() { startSignalToggle() if *configPath == "" { - log.Fatal("--config is required") + log.Fatal("--config is required and must point to a YAML file") } // Build the SPIFFE Provider when the spiffe block is configured. @@ -121,7 +121,7 @@ func main() { // instances. bootCfg, err := config.Load(*configPath) if err != nil { - log.Fatalf("initial config load: %v", err) + log.Fatalf("failed to load config %q: %v", *configPath, err) } var provider *spiffe.Provider if bootCfg.SPIFFE != nil { diff --git a/authbridge/cmd/authbridge-proxy/main.go b/authbridge/cmd/authbridge-proxy/main.go index 81d91614..70a09731 100644 --- a/authbridge/cmd/authbridge-proxy/main.go +++ b/authbridge/cmd/authbridge-proxy/main.go @@ -147,7 +147,7 @@ func main() { startSignalToggle() if *configPath == "" { - log.Fatal("--config is required") + log.Fatal("--config is required and must point to a YAML file") } // Build the SPIFFE Provider when the spiffe block is configured. The @@ -162,7 +162,7 @@ func main() { // freshly constructed plugin instances. bootCfg, err := config.Load(*configPath) if err != nil { - log.Fatalf("initial config load: %v", err) + log.Fatalf("failed to load config %q: %v", *configPath, err) } // Build the SPIFFE Provider only when something actually consumes it — // top-level mTLS (X509Source for the listeners) or a plugin whose identity