Skip to content

fix(validation): disallow actor type TOOL for package supplier and originator (#848) - #911

Open
ShivanshhhG wants to merge 1 commit into
spdx:mainfrom
ShivanshhhG:fix-848-package-supplier-originator-validation
Open

ShivanshhhG wants to merge 1 commit into
spdx:mainfrom
ShivanshhhG:fix-848-package-supplier-originator-validation

Conversation

@ShivanshhhG

Copy link
Copy Markdown

Summary

SPDX 2.2 and 2.3 clauses 7.5 (Package Supplier) and 7.6 (Package Originator) specify that supplier and originator fields may only be NOASSERTION, Person, or Organization, explicitly prohibiting Tool:. Previously, validate_package did not validate supplier or originator, allowing packages with a Tool: actor to pass validation silently without detection (#848).

Changes

  • In package_validator.py:
    • Check whether package.supplier or package.originator is an Actor with actor_type == ActorType.TOOL, emitting a ValidationMessage when detected.
    • Forward non-tool actors to validate_actor.
  • In test_package_validator.py:
    • Added parametrized test test_invalid_package_actor_tool asserting that ActorType.TOOL on supplier and originator triggers validation errors.
    • Added parametrized test test_valid_package_supplier_and_originator verifying Person, Organization, NOASSERTION, and None remain valid.

Fixes #848

SPDX 2.2 and 2.3 clauses 7.5 and 7.6 disallow TOOL as an actor type
for package supplier and originator. This adds validation ensuring that
neither supplier nor originator is of type TOOL and delegates actor
validation to validate_actor.

Signed-off-by: SHIVANSH-ux-ys <singaser78@gmail.com>

This branch has not been deployed

No deployments
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.

Should I check for prohibited strings?

1 participant