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

Add support for extensible input enumerators #220

Merged
merged 15 commits into from
Sep 13, 2024
Merged

Conversation

bradlarsen
Copy link
Collaborator

@bradlarsen bradlarsen commented Sep 5, 2024

This adds extensible enumerators to Nosey Parker. This mechanism makes it possible to scan inputs produced by any program that can emit JSON objects to stdout, without having to first write the inputs to the filesystem.

It is invoked with the new --enumerator=FILE option, where FILE is a JSON Lines file. Each line of the enumerator file should be a JSON object with one of the following forms:

  { "content_base64": "base64-encoded bytestring to scan", "provenance": <arbitrary object> }
  { "content": "utf8 string to scan", "provenance": <arbitrary object> }

Shell process substitution can make streaming invocation ergonomic, e.g., scan --enumerator=<(my-enumerator-program).

@bradlarsen bradlarsen added enhancement New feature or request content discovery Related to enumerating or specifying content to scan ux Related to the user experience, invocation, or CLI labels Sep 5, 2024
@bradlarsen bradlarsen marked this pull request as ready for review September 13, 2024 15:18
@bradlarsen bradlarsen merged commit 5b0bd98 into main Sep 13, 2024
11 checks passed
@bradlarsen bradlarsen deleted the enumerator-input branch September 13, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content discovery Related to enumerating or specifying content to scan enhancement New feature or request ux Related to the user experience, invocation, or CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant