Skip to content
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

Feat: Add check-reachable command. #51

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Conversation

cerrussell
Copy link
Member

Adds checking if reachable flows exist for package and version or file and line number or line number range.

@cerrussell cerrussell force-pushed the feature/reachability-query branch from 2f432a6 to 190478c Compare June 28, 2024 03:48
Signed-off-by: Caroline Russell <[email protected]>
@cerrussell cerrussell force-pushed the feature/reachability-query branch from 190478c to e9f46dc Compare June 28, 2024 03:53
@cerrussell cerrussell merged commit 264c1d6 into main Jun 28, 2024
5 checks passed

def parse_purl_pkgs(match: re.Match) -> List[str]:
"""Extract package and version variations from purl"""
pkgs = [match.group('p1')]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we also support filter by purl?

@@ -71,6 +72,11 @@ class FilteringPatternCollection:
'{objectSlices: objectSlices[?ATTRIBUTECONDITION`TARGET_VALUE`], '
'userDefinedTypes: userDefinedTypes[?ATTRIBUTECONDITION`TARGET_VALUE`]}'
)
jmespath_purls = jmespath.compile('reachables[].purls[]')
purl_pkg = re.compile(r'(?P<p1>[^/:]+/(?P<p2>[^/]+))(?:(?:.|/)v\d+)?(?=@)')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not as simple as this since there are language specific hacks. Best to use the official python library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants