Skip to content

Commit

Permalink
Incorporate comments and modify/add tests #378
Browse files Browse the repository at this point in the history
Reference: #378
Signed-off-by: John M. Horan <johnmhoran@gmail.com>
  • Loading branch information
johnmhoran committed Feb 17, 2025
1 parent 2303575 commit 17a74ea
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
19 changes: 1 addition & 18 deletions faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,7 @@ In this case, the colon ':' between ``scheme`` and ``type`` is being used as a s


Type
----

**QUESTION**: Can the ``type`` component start with a number?

No. As the "Rules for each purl component" section provides, "The ``type``
MUST start with an ASCII letter."

**QUESTION**: Can the ``type`` component contain spaces?

No. See the "Rules for each purl component" section:

The package ``type`` MUST be composed only of ASCII letters and numbers,
'.', '+' and '-' (period, plus, and dash).

**QUESTION**: Does the ``type`` need to be percent-encoded?

No. This is addressed in the "Rules for each purl component" section:
"The ``type`` MUST be unencoded."
~~~~

**QUESTION**: What behavior is expected from a purl spec implementation if a
``type`` contains a character like a slash '/' or a colon ':'?
Expand Down
42 changes: 39 additions & 3 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"type": null,
"namespace": null,
"name": "EnterpriseLibrary.Common",
"version": null,
"version": "6.0.1304",
"qualifiers": null,
"subpath": null,
"is_invalid": true
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",
"purl": "pkg:///maven/org.apache.commons/io",
"canonical_purl": "pkg:maven/org.apache.commons/io",
"type": "maven",
Expand Down Expand Up @@ -638,13 +638,49 @@
{
"description": "invalid encoded colon : between scheme and type",
"purl": "pkg%3Amaven/org.apache.commons/io",
"canonical_purl": "pkg:maven/org.apache.commons/io",
"canonical_purl": null,
"type": "maven",
"namespace": "org.apache.commons",
"name": "io",
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "check for invalid character in type",
"purl": "pkg:n&g?inx/nginx@0.8.9",
"canonical_purl": null,
"type": null,
"namespace": null,
"name": "nginx",
"version": "0.8.9",
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "check for type that starts with number",
"purl": "pkg:3nginx/nginx@0.8.9",
"canonical_purl": null,
"type": null,
"namespace": null,
"name": "nginx",
"version": "0.8.9",
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "check for colon in type",
"purl": "pkg:nginx:a/nginx@0.8.9",
"canonical_purl": null,
"type": null,
"namespace": null,
"name": "nginx",
"version": "0.8.9",
"qualifiers": null,
"subpath": null,
"is_invalid": true
}
]

0 comments on commit 17a74ea

Please sign in to comment.