Skip to content

Conversation

@matt-phylum
Copy link
Collaborator

Overview

This PR tightens the validation on subpaths and package types.

Subpaths are sanitized when calling with_subpath to match the formatting rules: https://github.com/package-url/purl-spec/blob/7f7e82f73c38a4a339f88abf1f2aa031e9c7af23/PURL-SPECIFICATION.rst?plain=1#L313-L323

Subpaths with %2E segments are handled the same as . segments: https://github.com/package-url/purl-spec/blob/7f7e82f73c38a4a339f88abf1f2aa031e9c7af23/PURL-SPECIFICATION.rst?plain=1#L339-L347 (changed by package-url/purl-spec#394)

When using the string shapes instead of PackageType, the package type validation is changed to require that the type begins with a letter: https://github.com/package-url/purl-spec/blob/7f7e82f73c38a4a339f88abf1f2aa031e9c7af23/PURL-SPECIFICATION.rst?plain=1#L136

Checklist

  • Does this PR have an associated issue?
  • Have you ensured that you have met the expected acceptance criteria?
  • Have you created sufficient tests?

Issue

What issue(s) does this PR close. Use the closes #<issueNum> here.

Copy link

@Allan-Clements Allan-Clements left a comment

Choose a reason for hiding this comment

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

:shipit:

@matt-phylum matt-phylum merged commit 17a3f9b into main Mar 10, 2025
6 checks passed
@matt-phylum matt-phylum deleted the matt/validation branch March 10, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants