Skip to content

Commit 2fb05da

Browse files
authored
Merge pull request package-url#666 from package-url/ecma-fixes-2
ECMA changes and corrections
2 parents 71e9042 + d1c78dc commit 2fb05da

6 files changed

Lines changed: 47 additions & 54 deletions

File tree

docs/standard/characters-and-encoding.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Permitted characters
22

3-
A canonical `purl` is composed of these permitted ASCII characters:
3+
A canonical PURL is composed of these permitted ASCII characters:
44

55
- the Alphanumeric Characters: `A to Z`, `a to z`, `0 to 9`,
66
- the Punctuation Characters: `.-_~` (period '.',
@@ -23,11 +23,11 @@ This is how each of the Separator Characters is used:
2323
`qualifier`
2424
- '&' (ampersand) is the separator between `qualifiers` (each being a
2525
`key=value` pair)
26-
- '#' (number sign) is the separator before `subpath`
26+
- '#' (hash sign) is the separator before `subpath`
2727

2828
## Character encoding
2929

30-
- In the "Rules for each `purl` component" section, each component
30+
- In the "Rules for each PURL component" section, each component
3131
defines when and how to apply percent-encoding and decoding to its content.
3232
- When percent-encoding is required by a component definition, the component
3333
string must first be encoded as UTF-8.
@@ -45,7 +45,7 @@ This is how each of the Separator Characters is used:
4545

4646
- the Alphanumeric Characters,
4747
- the Punctuation Characters,
48-
- the Separator Characters when being used as `purl` separators,
48+
- the Separator Characters when being used as PURL separators,
4949
- the colon ':', whether used as a Separator Character or otherwise, and
5050
- the percent sign '%' when used to represent a percent-encoded character.
5151

docs/standard/components.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Rules for each `purl` component
1+
## Rules for each PURL component
22

3-
A `purl` string is an ASCII URL string composed of seven components.
3+
A PURL string is an ASCII URL string composed of seven components.
44

55
Except as expressly stated otherwise in this section, each component:
66

@@ -15,7 +15,7 @@ The rules for each component are:
1515

1616
- The `scheme` is a constant with the value "pkg".
1717
- The `scheme` must be followed by an unencoded colon ':'.
18-
- `purl` parsers must accept URLs where the `scheme` and colon ':' are
18+
- PURL parsers must accept URLs where the `scheme` and colon ':' are
1919
followed by one or more slash '/' characters, such as 'pkg://', and must
2020
ignore and remove all such '/' characters.
2121

@@ -99,7 +99,7 @@ The rules for each component are:
9999

100100
- **subpath**:
101101
- The `subpath` string is prefixed by a '#' separator when not empty
102-
- This '#' is not part of the `subpath`
102+
- The '#' is not part of the `subpath`
103103
- The `subpath` contains zero or more segments, separated by slash '/'
104104
- Leading and trailing slashes '/' are not significant and should be stripped
105105
in the canonical form

docs/standard/references.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ The following referenced documents are indispensable for the application of this
44
For dated references, only the edition cited applies. For undated references, the latest
55
edition of the referenced document (including any amendments) applies.
66

7-
ASCII, *American National Standards Institute, "Coded Character Set -- 7-bit American
8-
Standard Code for Information Interchange", ANSI X3.4, 1986*
9-
https://en.wikipedia.org/wiki/ASCII
7+
INCITS 4-1986 [R2022], *Information Systems - Coded Character Sets - 7-Bit Standard Code for Information Interchange (7-Bit ASCII)*.
8+
[https://webstore.ansi.org/standards/incits/incits1986r2022](https://webstore.ansi.org/standards/incits/incits1986r2022)
109

11-
RFC 3986, *Uniform Resource Identifier (URI): Generic Syntax*.
10+
RFC 3986, *Uniform Resource Identifier (URI): Generic Syntax*.
1211
[https://datatracker.ietf.org/doc/html/rfc3986](https://datatracker.ietf.org/doc/html/rfc3986)
12+
13+
The Unicode Standard.
14+
[https://www.unicode.org/versions/latest/](https://www.unicode.org/versions/latest/)
15+
16+
ECMA-404, *The JSON Data Interchange Format*.
17+
[https://www.ecma-international.org/publications-and-standards/standards/ecma-404/](https://www.ecma-international.org/publications-and-standards/standards/ecma-404/)
18+
19+
IETF Draft, March 2018, *JSON Schema Validation: A Vocabulary for Structural Validation of JSON (Draft-07)*.
20+
[https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01)

docs/standard/summary.md

Lines changed: 21 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
1-
## What is a `purl`?
1+
## What is a PURL
22

3-
`purl` stands for **package URL**.
3+
PURL stands for **package URL**.
44

5-
A `purl` is a URL composed of seven components:
5+
A PURL is a URL composed of seven components:
66

77
scheme:type/namespace/name@version?qualifiers#subpath
88

99
Components are separated by a specific character for unambiguous parsing.
1010

11-
The definition for each component is:
12-
13-
- **scheme**: this is the URL scheme with the constant value of "pkg". One of
14-
the primary reason for this single scheme is to facilitate the future official
15-
registration of the "pkg" scheme for package URLs. Required.
16-
- **type**: the package "type" or package "protocol" such as maven, npm, nuget,
17-
gem, pypi, etc. Required.
18-
- **namespace**: some name prefix such as a Maven groupid, a Docker image owner,
19-
a GitHub user or organization. Optional and type-specific.
20-
- **name**: the name of the package. Required.
21-
- **version**: the version of the package. Optional.
22-
- **qualifiers**: extra qualifying data for a package such as an OS,
23-
architecture, a distro, etc. Optional and type-specific.
24-
- **subpath**: extra subpath within a package, relative to the package root.
25-
Optional.
26-
27-
2811
Table 1: Components of a PURL
2912

3013
| Component | Requirement | Description|
@@ -42,12 +25,12 @@ Components are designed such that they form a hierarchy from the most significan
4225
on the left to the least significant components on the right.
4326

4427

45-
A `purl` must not contain a URL Authority, i.e. there is no support for
28+
A PURL must not contain a URL Authority, i.e. there is no support for
4629
`username`, `password`, `host` and `port` components. A `namespace` segment may
4730
sometimes look like a `host`, but its interpretation is specific to a `type`.
4831

4932

50-
## Some `purl` examples
33+
## Some PURL examples
5134

5235
pkg:bitbucket/birkenfeld/pygments-main@244fd47e07d1014f0aed9c
5336
pkg:deb/debian/curl@7.50.3-1?arch=i386&distro=jessie
@@ -61,9 +44,9 @@ sometimes look like a `host`, but its interpretation is specific to a `type`.
6144
pkg:rpm/fedora/curl@7.50.3-1.fc25?arch=i386&distro=fedora-25
6245

6346

64-
## A `purl` is a URL
47+
## A PURL is a URL
6548

66-
- A `purl` is a valid URL and URI that conforms to the URL definitions or
49+
- A PURL is a valid URL and URI that conforms to the URL definitions or
6750
specifications at:
6851

6952
- https://tools.ietf.org/html/rfc3986
@@ -74,25 +57,25 @@ sometimes look like a `host`, but its interpretation is specific to a `type`.
7457
- This is a valid URL because it is a locator even though it has no Authority
7558
URL component: each `type` has a default repository location when defined.
7659

77-
- The `purl` components are mapped to these URL components:
60+
- The PURL components are mapped to these URL components:
7861

79-
- `purl` `scheme`: this is a URL `scheme` with a constant value: `pkg`
80-
- `purl` `type`, `namespace`, `name` and `version` components: these are
62+
- PURL `scheme`: this is a URL `scheme` with a constant value: `pkg`
63+
- PURL `type`, `namespace`, `name` and `version` components: these are
8164
collectively mapped to a URL `path`
82-
- `purl` `qualifiers`: this maps to a URL `query`
83-
- `purl` `subpath`: this is a URL `fragment`
84-
- In a `purl`, there is no support for a URL Authority (e.g. no
65+
- PURL `qualifiers`: this maps to a URL `query`
66+
- PURL `subpath`: this is a URL `fragment`
67+
- In a PURL, there is no support for a URL Authority (e.g. no
8568
`username`, `password`, `host` and `port` components).
8669

8770
- Special URL schemes as defined in https://url.spec.whatwg.org/ such as
88-
`file://`, `https://`, `http://` and `ftp://` are not valid `purl` types.
89-
They are valid URL or URI schemes but they are not `purl`.
90-
They may be used to reference URLs in separate attributes outside of a `purl`
91-
or in a `purl` qualifier.
71+
`file://`, `https://`, `http://` and `ftp://` are not valid PURL types.
72+
They are valid URL or URI schemes but they are not PURL.
73+
They may be used to reference URLs in separate attributes outside of a PURL
74+
or in a PURL qualifier.
9275

9376
- Version control system (VCS) URLs such `git://`, `svn://`, `hg://` or as
94-
defined in Python pip or SPDX download locations are not valid `purl` types.
95-
They are valid URL or URI schemes but they are not `purl`.
77+
defined in Python pip or SPDX download locations are not valid PURL types.
78+
They are valid URL or URI schemes but they are not PURL.
9679
They are a closely related, compact and uniform way to reference VCS URLs.
97-
They may be used as references in separate attributes outside of a `purl` or
98-
in a `purl` qualifier.
80+
They may be used as references in separate attributes outside of a PURL or
81+
in a PURL qualifier.

docs/standard/types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
## Package-URL Type definitions
1+
## Package-URL type definitions
22

33
Each package manager, platform, type, or ecosystem has its own conventions
44
and protocols to identify, locate, and provision software packages.
55

66
The package **type** is the component of a Package-URL that is used to
7-
capture this information with a short string such as ``maven``, ``npm``,
8-
``nuget``, ``gem``, ``pypi``, etc.
7+
capture this information with a short string such as `maven`, `npm`,
8+
`nuget`, `gem`, `pypi`, etc.
99

10-
These are registered ``PURL`` package type definitions.
10+
These are registered PURL package type definitions.
1111

1212
Definitions can also include types reserved for future use.
1313

schemas/purl-type-definition.schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
"optional_requirement": {
2525
"title": "Component optional requirement",
2626
"description": "States that this PURL component is optional for a PURL type.",
27+
"type": "string",
2728
"constant": "optional"
2829
},
2930
"required_requirement": {
3031
"title": "Component required requirement",
3132
"description": "States that this PURL component is required for a PURL type.",
33+
"type": "string",
3234
"constant": "required"
3335
},
3436
"purl_component_definition": {

0 commit comments

Comments
 (0)