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

Extend test suite with a range of additional invalid Package URLs #248

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,5 +550,173 @@
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "qualifiers with empty values are ignored",
"purl": "pkg:npm/test?key=",
"canonical_purl": "pkg:npm/test",
"type": "npm",
"namespace": "",
"name": "test",
"version": "",
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "qualifiers with empty values and missing = are ignored",
"purl": "pkg:npm/test?key",
"canonical_purl": "pkg:npm/test",
"type": "npm",
"namespace": "",
"name": "test",
"version": "",
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "subpath containing '.' are invalid",
"purl": "pkg:npm/test#invalid/./path",
"canonical_purl": "pkg:npm/test#invalid/./path",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "subpath containing '..' are invalid",
"purl": "pkg:npm/test#invalid/../path",
"canonical_purl": "pkg:npm/test#invalid/../path",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "subpath with percent encoded / are invalid",
"purl": "pkg:npm/test#invalid/%2F/path",
"canonical_purl": "pkg:npm/test#invalid/%2F/path",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "key must be unique within the keys of the qualifiers string",
"purl": "pkg:npm/test?k=v1&k=v2",
"canonical_purl": "pkg:npm/test?k=v1&k=v2",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "qualifier keys must not start with numbers",
"purl": "pkg:npm/test?1k=v1",
"canonical_purl": "pkg:npm/test?1k=v1",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "qualifier keys must not be percent encoded",
"purl": "pkg:npm/test?k%25=v1",
"canonical_purl": "pkg:npm/test?k%25=v1",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "The package type is composed only of ASCII letters and numbers, '.', '+' and '-'",
"purl": "pkg:n@m/test",
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this valid according to the rules in the description?

"canonical_purl": "pkg:n@m/test",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "The type cannot start with a number",
"purl": "pkg:7npm/test",
"canonical_purl": "pkg:7npm/test",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "The type cannot contain spaces",
"purl": "pkg:n pm/test",
"canonical_purl": "pkg:n pm/test",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "A namespace segment must not be empty",
"purl": "pkg:npm/some//org/pkg",
"canonical_purl": "pkg:npm/some//org/pkg",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "A namespace segment must not contain a percent-encoded '/'",
"purl": "pkg:npm/some/%25/org/pkg",
"canonical_purl": "pkg:npm/some/%25/org/pkg",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "Non-unicode characters must be percent encoded",
"purl": "pkg:npm/раƈκąġе",
"canonical_purl": "pkg:npm/раƈκąġе",
"type": null,
"namespace": null,
"name": null,
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
}
]