Skip to content

only the first erroneous Purl is reported #1564

@ElectricNroff

Description

@ElectricNroff

Submitting this container:

{"cnaContainer":{"affected":[
{"vendor":"v","product":"p2","defaultStatus":"affected","packageURL":"pkg:pypi/django#%3A"},
{"vendor":"v","product":"p2","defaultStatus":"affected","packageURL":"https://a.us"}
],"descriptions":[{"lang":"en","value":"d"}],"references":[{"url":"https://a.us"}]}}

results in only this error:

{"error":"BAD_INPUT","message":"Parameters were invalid","details":[
{"msg":"Percent-encoded colons are not allowed in a PURL: pkg:pypi/django#%3A",
"param":"cnaContainer.affected","location":"body"}]}

whereas submitting this container:

{"cnaContainer":{"affected":[
{"vendor":"v","product":"p2","defaultStatus":"affected","packageURL":"https://a.us"},
{"vendor":"v","product":"p2","defaultStatus":"affected","packageURL":"pkg:pypi/django#%3A"}
],"descriptions":[{"lang":"en","value":"d"}],"references":[{"url":"https://a.us"}]}}

results in only this error:

{"error":"BAD_INPUT","message":"Parameters were invalid","details":[{"msg":
"Invalid purl: missing required \"pkg\" scheme component: \"https://a.us\"",
"param":"cnaContainer.affected","location":"body"}]}

In other words, producers may need to make separate submissions to discover each of a series of mistakes in composing their Purl strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions