Skip to content

feat: Implement SPDX Schema Validation - #101

Open
saquibsaifee wants to merge 1 commit into
GenAI-Security-Project:mainfrom
saquibsaifee:feat/spdx-schema-validation
Open

feat: Implement SPDX Schema Validation#101
saquibsaifee wants to merge 1 commit into
GenAI-Security-Project:mainfrom
saquibsaifee:feat/spdx-schema-validation

Conversation

@saquibsaifee

Copy link
Copy Markdown
Contributor

🎯 What: The code health issue addressed was a dead, unimplemented method _validate_spdx_schema_version inside CLIController.
💡 Why: Implementing the proper SPDX schema validation logic allows a clean structural mapping for downstream operations. Using an official open source tool instead of creating our own makes the codebase better and more maintainable.
Verification: Ran pytest unit tests, verified coverage, evaluated the solution structurally, and it has successfully passed the code review step.
Result: A functioning, robust method in the CLI controller ready to be connected and called whenever SPDX validation is enabled.

@saquibsaifee

Copy link
Copy Markdown
Contributor Author

@eaglei15 this PR is ready to be reviewed.

Implements _validate_spdx_schema_version inside CLIController with proper
SPDX validation logic via the official spdx-tools package.

- Modifies src/controllers/cli_controller.py to import spdx-tools as a hard dependency.
- Uses JsonLikeDictParser and validate_full_spdx_document to validate incoming SPDX dicts.
- Supports SPDX 2.2 and 2.3 schema versions.
- Adds comprehensive unit tests for both success and failure cases.
- Updates pyproject.toml with the spdx-tools dependency.

Signed-off-by: saquibsaifee <saquibsaifee2@gmail.com>
@saquibsaifee
saquibsaifee force-pushed the feat/spdx-schema-validation branch from fdf2769 to aa46c16 Compare August 31, 2026 17:04
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.

1 participant