Repository navigation
Allow parsing of graphQL queries - #14
Merged
Merged
Conversation
graphql(params.body) parses a GraphQL-over-HTTP request body into
{valid, error, operations, queries, mutations, subscriptions}. Each root
field carries its real name, alias, and args with variables and variable
defaults substituted. Every operation is reported regardless of
operationName, root fragment spreads and inline fragments are expanded,
and directives are ignored, so rules see every root field the document
contains. Malformed input returns valid=false with empty lists.
The function is registered for the original-params rewrite so it parses
the body as sent, even in case-insensitive scopes: GraphQL names and node
IDs are case-sensitive.
The rewrite now skips call text inside string literals and at the end of
longer identifiers; previously `'hasSecrets(x)'` in a literal was
rewritten and corrupted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181tDqDyMAGnCcqMAd2JEWf
Engine.RequiresBodyFor(scope, call) narrows RequiresBody by operation: a rule that reads params.body counts only when its operation glob matches the call (normalized as Evaluate normalizes it). Pinning a body rule to one endpoint, e.g. `post api.github.com/graphql`, lets a gatekeeper buffer bodies for that endpoint alone instead of making the whole scope JSON-only. An unknown scope returns true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0181tDqDyMAGnCcqMAd2JEWf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0181tDqDyMAGnCcqMAd2JEWf
ValidateRuleBytes compiled each when expression as written, without substituting defs or injecting original-case params, so a rule file that LoadFromBytes accepts failed validation with "undeclared reference". Both paths now prepare expressions through keepcel.PrepareWhen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0181tDqDyMAGnCcqMAd2JEWf
|
Claude finished @dpup's task in 34s —— View job Review of #14:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.