fix(security): Do not allow invalid security configs (#1531)

* fix: Do not allow invalid security configs

* test: Fix empty security config test

* test: Add missing security config test scenarios
This commit is contained in:
PythonGermany authored and GitHub committed 2026-03-23 17:35:42 -04:00
1 parent 593826ec5f
commit a2fc5ab9bb
2 files changed
+76 -6

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ type Config struct {
// ValidateAndSetDefaults returns whether the security configuration is valid or not and sets default values.
func (c *Config) ValidateAndSetDefaults() bool {
return (c.Basic != nil && c.Basic.isValid()) || (c.OIDC != nil && c.OIDC.ValidateAndSetDefaults())
return (c.Basic == nil || c.Basic.isValid()) && (c.OIDC == nil || c.OIDC.ValidateAndSetDefaults())
}
// RegisterHandlers registers all handlers required based on the security configuration