Skip to content

Conversation

@awyeth
Copy link
Contributor

@awyeth awyeth commented Jan 6, 2026

If the SPDXRef- or DocumentRef- prefix isn't present in an ID, then fail parsing. In addition, if stripping the prefix leaves an empty ID then also fail.

This is in line with the spec:

https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#6.3
https://spdx.github.io/spdx-spec/v2.3/package-information/#7.2
https://spdx.github.io/spdx-spec/v2.3/file-information/#8.2

See #274 for more details about the issue being fixed.

awyeth added 2 commits January 6, 2026 14:27
If the `SPDXRef-` or `DocumentRef-` prefix isn't present in an ID, then
fail parsing. In addition, if stripping the prefix leaves an empty ID
then also fail.

This is in line with the spec:

https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#6.3
https://spdx.github.io/spdx-spec/v2.3/package-information/#7.2
https://spdx.github.io/spdx-spec/v2.3/file-information/#8.2

See #274 for more details
about the issue being fixed.

Signed-off-by: Andrew Wyeth <[email protected]>
If the `SPDXRef-` or `DocumentRef-` prefix isn't present in an ID, then
fail parsing. In addition, if stripping the prefix leaves an empty ID
then also fail.

This is in line with the spec:

https://spdx.github.io/spdx-spec/v2.3/document-creation-information/#6.3
https://spdx.github.io/spdx-spec/v2.3/package-information/#7.2
https://spdx.github.io/spdx-spec/v2.3/file-information/#8.2

See #274 for more details
about the issue being fixed.

Signed-off-by: Andrew Wyeth <[email protected]>
This version matches the version in go.mod.

Signed-off-by: Andrew Wyeth <[email protected]>
Copy link
Collaborator

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

LGTM

@kzantow kzantow merged commit 28116d2 into spdx:main Jan 7, 2026
6 checks passed
@awyeth awyeth deleted the id-parsing branch January 7, 2026 15:49
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