You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When processing a JSON extractor, compiling occurs prior to runtime (compile.go#L33), and as such, templated variables are not processed.
Template example:
id: catapiinfo:
name: catapi test templateauthor: Stellaseverity: criticaldescription: test template call that should always return as criticaltags: meow,meowmeow,meowmeowmeowvariables:
catid: '[a-zA-Z0-9]'http:
- id: bulk-sisid-takeovermethod: GETpath:
- "https://api.thecatapi.com/v1/images/search?limit=10"extractors:
- type: jsonpart: bodyname: id# Find a URL based on a catid specified in a variable or extractor, if it exists, extract it. json:
- '(.[] | select(.id | test("{{catid}}")) | .url)'
Expected behavior:
This always returns a finding as this regular expression is checking if the URL contains any letters/numbers.
Actual behavior:
Never returns, as it is testing for {{catid}} literally rather than filling the variable.
Proposed fixes:
Clearly document that this is a limitation of this (and ALL) extractors (this limitation also applies to extractors, built-in variables like {{BaseURL}}, etc)
Perform Just-In-Time compilation of extractors with the variables substituted in
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When processing a JSON extractor, compiling occurs prior to runtime (compile.go#L33), and as such, templated variables are not processed.
Template example:
Expected behavior:
This always returns a finding as this regular expression is checking if the URL contains any letters/numbers.
Actual behavior:
Never returns, as it is testing for
{{catid}}
literally rather than filling the variable.Proposed fixes:
Beta Was this translation helpful? Give feedback.
All reactions