-
Notifications
You must be signed in to change notification settings - Fork 215
Update 'qualifiers' rule in core spec #382 #398
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
Changes from 11 commits
1c1fb31
b621d65
17685b2
654e1b9
9d849b9
ccf07c5
2a13760
42e7ec0
9a7089b
898c64b
3d2a128
a990290
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -176,25 +176,30 @@ The rules for each component are: | |||||||||
|
|
||||||||||
| - **qualifiers**: | ||||||||||
|
|
||||||||||
| - The ``qualifiers`` string is prefixed by a '?' separator when not empty | ||||||||||
| - This '?' is not part of the ``qualifiers`` | ||||||||||
| - This is a query string composed of zero or more ``key=value`` pairs each | ||||||||||
| separated by a '&' ampersand. A ``key`` and ``value`` are separated by the equal | ||||||||||
| '=' character | ||||||||||
| - These '&' are not part of the ``key=value`` pairs. | ||||||||||
| - ``key`` must be unique within the keys of the ``qualifiers`` string | ||||||||||
| - ``value`` cannot be an empty string: a ``key=value`` pair with an empty ``value`` | ||||||||||
| is the same as no key/value at all for this key | ||||||||||
| - For each pair of ``key`` = ``value``: | ||||||||||
|
|
||||||||||
| - The ``key`` must be composed only of ASCII letters and numbers, '.', '-' and | ||||||||||
| '_' (period, dash and underscore) | ||||||||||
| - A ``key`` cannot start with a number | ||||||||||
| - A ``key`` must NOT be percent-encoded | ||||||||||
| - A ``key`` is case insensitive. The canonical form is lowercase | ||||||||||
| - A ``key`` cannot contain spaces | ||||||||||
| - A ``value`` must be a percent-encoded string | ||||||||||
| - The '=' separator is neither part of the ``key`` nor of the ``value`` | ||||||||||
| - The ``qualifiers`` component MUST be prefixed by an unencoded question | ||||||||||
| mark '?' separator when not empty. This '?' separator is not part of the | ||||||||||
| ``qualifiers`` component. | ||||||||||
| - The ``qualifiers`` component is a query string composed of one or more | ||||||||||
| ``key=value`` pairs. Multiple ``key=value`` pairs MUST be separated by an | ||||||||||
| unencoded ampersand '&'. This '&' separator is not part of the | ||||||||||
| ``qualifiers`` component. | ||||||||||
|
||||||||||
| ``qualifiers`` component. | |
| ``qualifiers``' sub-components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkowalleck Let's not introduce a sub-component concept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to reword this "This '&' separator is not part of the
qualifiers component." still.
the & is definitely part of the qualifiers component, but it is not part of that "key=value" part. how do we want to call this "key=value" part?
For parth, we know path-segments as the "items". is the there a proper name we can use here? I guess "qualifier" could be fitting?
| ``qualifiers`` component. | |
| individual ``qualifier``s'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking all good to me. IMHO, the last point of discussion left is this sentence. e.g., is colon all we need as a generic rule (leaving aside the per-component rules)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnmhoran Let's move this section to a new PR for clarity as discussed in today's Ecma call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pombredanne This has been removed and replaced with the version of "Character encoding" currently in main. I opened a new issue for the current "Character encoding" work:
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ Scheme | |
|
|
||
| **QUESTION**: Can the ``scheme`` component be followed by a colon and two slashes, like a URI? | ||
|
|
||
| No. Since a ``purl`` never contains a URL Authority, its ``scheme`` should not be suffixed with double slash as in 'pkg://' and should use 'pkg:' instead. Otherwise this would be an invalid URI per RFC 3986 at https://tools.ietf.org/html/rfc3986#section-3.3:: | ||
| **ANSWER**: No. Since a ``purl`` never contains a URL Authority, its ``scheme`` should not be suffixed with double slash as in 'pkg://' and should use 'pkg:' instead. Otherwise this would be an invalid URI per RFC 3986 at https://tools.ietf.org/html/rfc3986#section-3.3:: | ||
|
|
||
| If a URI does not contain an authority component, then the path | ||
| cannot begin with two slash characters ("//"). | ||
|
|
@@ -24,9 +24,10 @@ For example, although these two purls are strictly equivalent, the first is in c | |
|
|
||
| pkg://gem/[email protected] | ||
|
|
||
|
|
||
| **QUESTION**: Is the colon between ``scheme`` and ``type`` encoded? Can it be encoded? If yes, how? | ||
|
|
||
| The "Rules for each ``purl`` component" section provides that "[t]he ``scheme`` MUST be followed by an unencoded colon ':'. | ||
| **ANSWER**: The "Rules for each ``purl`` component" section provides that the ``scheme`` MUST be followed by an unencoded colon ':'. | ||
|
|
||
| In this case, the colon ':' between ``scheme`` and ``type`` is being used as a separator, and consequently should be used as-is, never encoded and never requiring any decoding. Moreover, it should be a parsing error if the colon ':' does not come directly after 'pkg'. Tools are welcome to recover from this error to help with malformed purls, but that's not a requirement. | ||
|
|
||
|
|
@@ -37,10 +38,11 @@ Type | |
| **QUESTION**: What behavior is expected from a purl spec implementation if a | ||
| ``type`` contains a character like a slash '/' or a colon ':'? | ||
|
|
||
| The "Rules for each purl component" section provides that | ||
| **ANSWER**: The "Rules for each purl component" section provides that the | ||
| package ``type`` | ||
|
|
||
| [t]he package ``type`` MUST be composed only of ASCII letters and numbers, | ||
| '.', '+' and '-' (period, plus, and dash) | ||
| MUST be composed only of ASCII letters and numbers, '.', '+' and '-' | ||
|
||
| (period, plus, and dash). | ||
|
|
||
| As a result, a purl spec implementation must return an error when encountering | ||
| a ``type`` that contains a prohibited character. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This make sense, as the query string references does not bring anything special (though this has specific meaning in the URL specs).
What about going even simpler, as a sequence is also a new term:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, the "sequence" would mean that things are in a certain order - and this is irrelevant.
lets just use the " ... is composed of one or more ..." phrase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done -- changed to