-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure Headless protocol accesses flow protocol variables #6003
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThe changes in the Changes
Assessment against linked issues
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/protocols/headless/request.go (1)
85-85
: Consider precedence of merged maps
Mergingvalue
withvars
may cause key collisions. Ifvalue
is intended to take priority over the globalvars
, consider swapping the merge order or clarifying the logic to avoid unexpected overwrites.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/protocols/headless/request.go
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Tests (macOS-latest)
- GitHub Check: Tests (windows-latest)
- GitHub Check: Tests (ubuntu-latest)
🔇 Additional comments (6)
pkg/protocols/headless/request.go (6)
55-55
: Initialize optionVars with user-provided options
Renaming frompayloads
tooptionVars
improves clarity. This is a well-structured approach to incorporate the user's runtime options into the request workflow.
58-58
: Double-check variable precedence
When mergingvars
,metadata
,optionVars
, and template context, be mindful that later maps can overshadow earlier ones. Confirm that the final order of merges reflects the intended precedence.
60-60
: Evaluate user variables carefully
Evaluate(vars)
can introduce or transform user-supplied data. Verify it correctly processes all variables and handles potential edge cases or security implications, especially if expansions can be influenced by untrusted inputs.
61-61
: Confirm final constants ordering
Merging the evaluatedvariablesMap
withrequest.options.Constants
means constants override certain runtime variables. If this is your intended design, the current approach is good to go.
73-73
: Validate fuzzing variable usage
When callingexecuteFuzzingRule
, ensurevars
contains all necessary flow protocol variables for fuzzing. Any overshadowed or missing keys might reduce the fuzzing effectiveness.
91-91
: Confirm necessity of shallow clone
maps.Clone(vars)
creates a shallow copy. If you anticipate nested structures or side effects through reference sharing, consider a deeper approach to avoid unintentional mutations.
Proposed changes
Closes #6001
Checklist
Summary by CodeRabbit