Skip to content

COR-1641: CLI-02: Scan-Level Metadata Tagging#124

Open
leenk7991 wants to merge 3 commits into
cor-1639-scan-sha-trackingfrom
cor-1641-scan-metadata-tagging
Open

COR-1641: CLI-02: Scan-Level Metadata Tagging#124
leenk7991 wants to merge 3 commits into
cor-1639-scan-sha-trackingfrom
cor-1641-scan-metadata-tagging

Conversation

@leenk7991

Copy link
Copy Markdown

Summary

Add repeatable --metadata KEY=VALUE on corgea scan so CI can tag a blast scan; the CLI sends it as a JSON metadata multipart part on upload.

Changes

  • src/main.rs
    • New --metadata KEY=VALUE (repeatable, blast-only)
    • Validate before packaging
    • Incompatible with --skip-if-scanned (same rule as --policy / --scan-type / …)
  • src/scanners/blast.rs
    • metadata_json_from_pairs: parse pairs → JSON object string (= split on first occurrence; duplicate keys last-wins)
    • Thread Option<String> into upload
    • Unit tests for parser behavior
  • src/utils/api.rs
    • upload_zip(..., metadata: Option<String>) — add metadata multipart part when present
    • ScanResponse.metadata for corgea list --json parity

Notes

Screenshots

  1. invalid metadata
Screenshot 2026-07-13 at 1 45 19 PM
Screenshot 2026-07-13 at 1 45 30 PM
  1. running a scan with metadata
Screenshot 2026-07-13 at 1 46 19 PM
Screenshot 2026-07-13 at 1 47 30 PM
Screenshot 2026-07-13 at 1 49 39 PM
  1. running a scan without metadata
Screenshot 2026-07-13 at 1 50 55 PM
Screenshot 2026-07-13 at 1 51 57 PM

Comment thread src/utils/api.rs

@Ibrahimrahhal Ibrahimrahhal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the use case for this? why do we need to store these tags

@yhoztak yhoztak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@leenk7991

Copy link
Copy Markdown
Author

What is the use case for this? why do we need to store these tags

i think it's one of the requirements from the meeting with TransUnion: https://linear.app/corgea/issue/COR-1641/cli-02-scan-level-metadata-tagging

@leenk7991
leenk7991 requested a review from Ibrahimrahhal July 15, 2026 08:41

@juangaitanv juangaitanv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

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.

4 participants