Add strict validation mode for AR resource identifier schemes #2453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change(s)
The current implementation of AR resource identifiers (URI/IRI) allows any string to be registered as the scheme component. The URI/IRI specification restricts the character set of the scheme component to ASCII alphanumeric characters plus
+
,.
, and-
. Consider handling of a scheme which contains:
as an example of where an unrestricted character set for scheme can go awry. This change adds validation, warning the user when a scheme is not valid under the specification. By default, the scheme is ignored, but users can setPXR_AR_DISABLE_STRICT_SCHEME_VALIDATION
to be more permissive.Validation could be implemented as a regular expression match, but was done with explicit checks to produce clearer error messages for users. A note is left to output the invalid characters once #2120 has been accepted.
The
test_output
scheme currently used in some of the testing is an example of an invalid scheme per the URI/IRI specifications. This scheme has been added to a list of invalid test cases and been replaced withtest-output
.Fixes Issue(s)