If the field is allowed, continue checking remaining fields.

This commit is contained in:
2024-12-06 11:58:34 +00:00
parent 6a52a9f673
commit ed3966e577
+8 -2
View File
@@ -177,12 +177,18 @@ func checkSelections(c *fiber.Ctx, selections []ast.Selection) bool {
fieldName := strings.ToLower(sel.Name.Value)
if _, exists := introspectionQueries[fieldName]; exists {
if len(cfg.Security.IntrospectionAllowed) > 0 {
if _, allowed := introspectionAllowedQueries[fieldName]; !allowed {
// If this field is allowed, don't block and continue checking other fields
if _, allowed := introspectionAllowedQueries[fieldName]; allowed {
if sel.SelectionSet != nil {
if checkSelections(c, sel.GetSelectionSet().Selections) {
return true
}
} else {
}
continue
}
return true
}
return true
}
if sel.SelectionSet != nil {
if checkSelections(c, sel.GetSelectionSet().Selections) {