Skip to content

feat: enhance license API with comprehensive metadata and expression parsing #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

isasmendiagus
Copy link
Contributor

@isasmendiagus isasmendiagus commented Jun 11, 2025

Summary

Enhanced License API to handle complex license expressions and provide comprehensive metadata from multiple authoritative sources.

Example Response

Query: LicenseService.GetByPurl('pkg:github/example/component')

{
  "license_statement": "MIT AND GPL-2.0 WITH Classpath-exception-2.0",
  "licenses": [
    {
      "name": "MIT",
      "spdx": {
        "id": "MIT",
        "name": "MIT License",
        "is_fsf_libre": true,
        "exceptions": []
      },
      "scanoss": {
        "license_type": "PERMISSIVE",
        "risk_level": "LOW"
      }
    },
    {
      "name": "GPL-2.0 WITH Classpath-exception-2.0", 
      "spdx": {
        "id": "GPL-2.0",
        "name": "GNU General Public License v2.0",
        "exceptions": [
          {
            "id": "Classpath-exception-2.0",
            "name": "Classpath exception 2.0"
          }
        ]
      },
      "osadl": {
        "copyleft_clause": true,
        "use_cases": [...]
      },
      "scanoss": {
        "license_type": "COPYLEFT", 
        "risk_level": "MEDIUM"
      }
    }
  ]
}

@isasmendiagus isasmendiagus marked this pull request as draft June 11, 2025 14:28
// LICENSE REPRESENTATIONS
// ========================================================================

message BasicLicense {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe call it License?

string full_name = 2;
}

message License {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And here LicenseDetailed

};

// Get detailed metadata for a specific license
rpc GetDetails(LicenseRequest) returns(DetailsResponse) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method allow to query only one license. Maybe add another for querying a list of license ids?

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.

2 participants