diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 41691d00..cd89369c 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -616,9 +616,9 @@ func securedCheck(user *schema.User, r *http.Request) error { } // If SplitHostPort fails, IPAddress is already just a host (no port) - // If nothing declared in config: deny all request to this api endpoint + // If nothing declared in config: Continue if len(config.Keys.APIAllowedIPs) == 0 { - return fmt.Errorf("missing configuration key ApiAllowedIPs") + return nil } // If wildcard declared in config: Continue if config.Keys.APIAllowedIPs[0] == "*" { diff --git a/internal/config/schema.go b/internal/config/schema.go index 2d068140..39c7a63c 100644 --- a/internal/config/schema.go +++ b/internal/config/schema.go @@ -6,7 +6,7 @@ package config var configSchema = ` - { +{ "type": "object", "properties": { "addr": { @@ -135,6 +135,5 @@ var configSchema = ` }, "required": ["subjectJobEvent", "subjectNodeState"] } - }, - "required": ["apiAllowedIPs"] - }` + } +}`