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

Update Test Suite #52

Closed
wants to merge 1 commit into from
Closed
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
54 changes: 51 additions & 3 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
},
{
"description": "docker uses qualifiers and hash image id as versions",
"purl": "pkg:docker/customer/dockerimage@sha256:244fd47e07d1004f0aed9c?repository_url=gcr.io",
"canonical_purl": "pkg:docker/customer/dockerimage@sha256:244fd47e07d1004f0aed9c?repository_url=gcr.io",
"purl": "pkg:docker/customer/dockerimage@sha256%3A244fd47e07d1004f0aed9c?repository_url=gcr.io",
"canonical_purl": "pkg:docker/customer/dockerimage@sha256%3A244fd47e07d1004f0aed9c?repository_url=gcr.io",
Copy link
Member

Choose a reason for hiding this comment

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

This hasn't been clarified yet and is a subject of discussion in #39 which needs to be clarified before merge.

"type": "docker",
"namespace": "customer",
"name": "dockerimage",
Expand Down Expand Up @@ -252,7 +252,7 @@
"is_invalid": false
},
{
"description": "slash /// after type is not significant",
"description": "slash /// after scheme is not significant",
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the correction. This is a carryover from a time before PackageURLs began with pkg:/

"purl": "pkg:///maven/org.apache.commons/io",
"canonical_purl": "pkg:maven/org.apache.commons/io",
"type": "maven",
Expand All @@ -263,6 +263,30 @@
"subpath": null,
"is_invalid": false
},
{
"description": "slash / between version and qualifiers separator is not significant",
"purl": "pkg:maven/org.apache.commons/[email protected]/?scope=test",
Copy link
Member

Choose a reason for hiding this comment

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

The spec states that leading and trailing / is not significant on namespace and subpath only. This may be an invalid test case. Need clarification @pombredanne

Copy link
Author

Choose a reason for hiding this comment

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

This was added as part of code coverage in the java implementation. If this is invalid - then the How to parse may contain unnecessary steps. The step after Split the remainder once from left on ':' is Strip the remainder from leading and trailing '/'. Trying to figure out what other type of URL would end up with a trailing '/' at this point in parsing.

"canonical_purl": "pkg:maven/org.apache.commons/[email protected]?scope=test",
"type": "maven",
"namespace": "org.apache.commons",
"name": "io",
"version": "2.6",
"qualifiers": {"scope": "test"},
"subpath": null,
"is_invalid": false
},
{
"description": "ensure namespace allows multiple segments",
"purl": "pkg:bintray/apache/couchdb/[email protected]",
"canonical_purl": "pkg:bintray/apache/couchdb/[email protected]",
"type": "bintray",
"namespace": "apache/couchdb",
"name": "couchdb-mac",
"version": "2.3.0",
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "valid maven purl with case sensitive namespace and name",
"purl": "pkg:maven/HTTPClient/[email protected]",
Expand Down Expand Up @@ -298,5 +322,29 @@
"qualifiers": {"in production": "true"},
"subpath": null,
"is_invalid": true
},
{
"description": "invalid subpath - unencoded subpath cannot contain ..",
"purl": "pkg:GOLANG/google.golang.org/genproto@abcdedf#/googleapis/%2E%2E/api/annotations/",
"canonical_purl": "pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations",
"type": "golang",
"namespace": "google.golang.org",
"name": "genproto",
"version": "abcdedf",
"qualifiers": null,
"subpath": "googleapis/../api/annotations",
"is_invalid": true
},
{
"description": "invalid subpath - unencoded subpath cannot contain .",
"purl": "pkg:GOLANG/google.golang.org/genproto@abcdedf#/googleapis/%2E/api/annotations/",
"canonical_purl": "pkg:golang/google.golang.org/genproto@abcdedf#googleapis/api/annotations",
"type": "golang",
"namespace": "google.golang.org",
"name": "genproto",
"version": "abcdedf",
"qualifiers": null,
"subpath": "googleapis/./api/annotations",
"is_invalid": true
}
]