Skip to content

Add sync engine to import licenses and obligations from LicenseDB#4292

Open
Sandipmandal25 wants to merge 1 commit into
eclipse-sw360:feat/licensedb/integrationfrom
Sandipmandal25:feat/licensedb-sync-engine
Open

Add sync engine to import licenses and obligations from LicenseDB#4292
Sandipmandal25 wants to merge 1 commit into
eclipse-sw360:feat/licensedb/integrationfrom
Sandipmandal25:feat/licensedb-sync-engine

Conversation

@Sandipmandal25

Copy link
Copy Markdown
Contributor

Summary

Adds the LicenseDB sync engine as the second part of the SW360 and LicenseDB integration.

This builds on the HTTP client added in #4268 and adds the complete flow for fetching licenses and obligations from LicenseDB and storing them in SW360.

Changes

  • added importAllLicenseDBLicenses() in LicenseDatabaseHandler
  • reads the LicenseDB URL, credentials, and enabled flag from LICENSEDB_REST
  • fetches active obligations from /api/v1/obligations/export
  • fetches active licenses from /api/v1/licenses/export
  • imports obligations first because licenses reference them by UUID
  • matches existing data using externalIds["licensedb-id"]
  • falls back to shortname matching during the first sync
  • preserves SW360 specific fields like checked, FSFLibre, whitelist, and manually added obligations
  • stores the last successful sync time in the licensedb-sync-state CouchDB document
  • added LicenseDBDataMapper to map LicenseDB DTOs to SW360 Thrift objects
  • maps obligation types like RISK, RESTRICTION, RIGHT, and OBLIGATION

Endpoint

  • added ADMIN only endpoint POST /api/licenses/import/LicenseDB

Suggested reviewers

@Sandipmandal25 Sandipmandal25 force-pushed the feat/licensedb-sync-engine branch 2 times, most recently from 168db4d to 1a3d626 Compare June 24, 2026 18:42

@GMishx GMishx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor code refactoring suggestions. Rest looks good.

@Sandipmandal25 Sandipmandal25 force-pushed the feat/licensedb-sync-engine branch from 1a3d626 to 5c1db3d Compare June 25, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants