-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: detect at match node rather than root node (#466)
* refactor: determine match node at pattern compilation time * feat: make queries match at match node rather than root node * fix: add missing error handling * refactor: make detectors only return detection data
- Loading branch information
Showing
33 changed files
with
252 additions
and
376 deletions.
There are no files selected for viewing
This file contains 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
100 changes: 41 additions & 59 deletions
100
new/detector/composition/ruby/.snapshots/TestRuby-object.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,54 @@ | ||
[ | ||
{ | ||
"RuleName": "logger", | ||
"File": { | ||
"AbsolutePath": "/Users/vjeranfistric/go/src/github.com/bearer/curio/new/detector/composition/ruby/testdata/testcases/object.rb", | ||
"RelativePath": "object.rb", | ||
"FileInfo": {}, | ||
"IsGenerated": false, | ||
"Extension": ".rb", | ||
"Base": "object.rb", | ||
"IsConfiguration": false, | ||
"IsDotFile": false, | ||
"IsVendor": false, | ||
"Language": "Ruby", | ||
"LanguageType": 2 | ||
}, | ||
"Detections": [ | ||
{ | ||
"MatchNode": {}, | ||
"ContextNode": null, | ||
"Data": { | ||
"Pattern": "logger.info($\u003cDATA_TYPE\u003e)\n", | ||
"Datatypes": [ | ||
{ | ||
"MatchNode": {}, | ||
"ContextNode": {}, | ||
"Data": { | ||
"Name": "user", | ||
"DetectorType": "logger", | ||
"MatchNode": {}, | ||
"Data": { | ||
"Pattern": "logger.info($\u003cDATA_TYPE\u003e)\n", | ||
"Datatypes": [ | ||
{ | ||
"DetectorType": "datatype", | ||
"MatchNode": {}, | ||
"Data": { | ||
"Name": "user", | ||
"Classification": { | ||
"name": "user", | ||
"data_type": { | ||
"name": "Unique Identifier", | ||
"uuid": "12d44ae0-1df7-4faf-9fb1-b46cc4b4dce9", | ||
"category_uuid": "14124881-6b92-4fc5-8005-ea7c1c09592e" | ||
}, | ||
"decision": { | ||
"state": "valid", | ||
"reason": "valid_object_with_valid_properties" | ||
} | ||
}, | ||
"Properties": [ | ||
{ | ||
"Name": "name", | ||
"Detection": { | ||
"DetectorType": "object", | ||
"MatchNode": {}, | ||
"Data": { | ||
"Name": "name" | ||
} | ||
}, | ||
"Classification": { | ||
"name": "user", | ||
"name": "name", | ||
"data_type": { | ||
"name": "Unique Identifier", | ||
"uuid": "12d44ae0-1df7-4faf-9fb1-b46cc4b4dce9", | ||
"name": "Fullname", | ||
"uuid": "1617291b-bc22-4267-ad5e-8054b2505958", | ||
"category_uuid": "14124881-6b92-4fc5-8005-ea7c1c09592e" | ||
}, | ||
"decision": { | ||
"state": "valid", | ||
"reason": "valid_object_with_valid_properties" | ||
} | ||
}, | ||
"Properties": [ | ||
{ | ||
"Name": "name", | ||
"Detection": { | ||
"MatchNode": {}, | ||
"ContextNode": null, | ||
"Data": { | ||
"Name": "name" | ||
} | ||
}, | ||
"Classification": { | ||
"name": "name", | ||
"data_type": { | ||
"name": "Fullname", | ||
"uuid": "1617291b-bc22-4267-ad5e-8054b2505958", | ||
"category_uuid": "14124881-6b92-4fc5-8005-ea7c1c09592e" | ||
}, | ||
"decision": { | ||
"state": "valid", | ||
"reason": "known_pattern" | ||
} | ||
} | ||
"reason": "known_pattern" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
] |
This file contains 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
This file contains 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
Oops, something went wrong.