├── .gitattributes ├── src ├── LCT.PackageIdentifier.UTest │ └── PackageIdentifierUTTestFiles │ │ ├── PythonTestProject │ │ ├── tests │ │ │ └── __init__.py │ │ ├── example_package │ │ │ └── __init__.py │ │ ├── README.md │ │ └── pyproject.toml │ │ ├── SW360ProjectInfo.xml │ │ ├── packages.config │ │ ├── Nuget.csproj │ │ ├── NugetSelfContainedProject │ │ └── Nuget-SelfContained.csproj │ │ ├── SBOMTemplates │ │ ├── SBOM_MavenCATemplate.cdx.json │ │ ├── SBOM_ConanCATemplate.cdx.json │ │ └── SBOM_NpmCATemplate.cdx.json │ │ └── TestDir │ │ ├── DupDir │ │ └── package.json │ │ ├── SubDir │ │ └── package.json │ │ └── package.json ├── UnitTestUtilities │ ├── appsettingsUnitTest.json │ ├── UnitTestUtilities.csproj │ └── UTParams.cs ├── LCT.SW360PackageCreator.UTest │ └── ComponentCreatorUTFiles │ │ ├── cthackers.zip │ │ ├── adduser_3.118-debian10-combined.tar.bz2 │ │ ├── patched-file_022.tar.gz │ │ ├── TestComponent-1.0-sources.jar │ │ └── Attachment.json ├── LCT.APICommunications.UTest │ ├── Usings.cs │ ├── JfrogApicommunicationUTest.cs │ └── LCT.APICommunications.UTest.csproj ├── LCT.Common │ ├── Interface │ │ ├── IEnvironmentHelper.cs │ │ ├── IFileParser.cs │ │ ├── ISpdxBomParser.cs │ │ ├── ICycloneDXBomParser.cs │ │ ├── IPrintWarning.cs │ │ ├── IPrintRecommendation.cs │ │ ├── IChecker.cs │ │ ├── ISettingsManager.cs │ │ └── IFolderAction.cs │ ├── Model │ │ ├── CatoolInfo.cs │ │ ├── ListofPerametersForCli.cs │ │ ├── SW360ConnectionSettings.cs │ │ ├── ComponentsRequireAction.cs │ │ ├── MultipleVersionValues.cs │ │ └── Config.cs │ ├── Runtime │ │ └── EnvironmentType.cs │ ├── Parallel.cs │ ├── ComplianceValidator │ │ └── ComplianceSettings.json │ ├── FileParser.cs │ ├── EnvironmentHelper.cs │ ├── Result.cs │ ├── ComponentEqualityComparer.cs │ ├── Logging │ │ └── LoggerFactory.cs │ └── Constants │ │ └── TelemetryConstant.cs ├── LCT.Services.UTest │ └── ServiceUTestFiles │ │ └── Test.json ├── LCT.APICommunications │ ├── Model │ │ ├── PackageType.cs │ │ ├── ArtifactoryCredentials.cs │ │ ├── Roles.cs │ │ ├── Checksum.cs │ │ ├── Releasestatus.cs │ │ ├── Foss │ │ │ ├── Content.cs │ │ │ ├── AttachBy.cs │ │ │ ├── TriggerJobParams.cs │ │ │ ├── FossTriggerStatus.cs │ │ │ ├── SW360DownloadHref.cs │ │ │ ├── ReleaseAttachments.cs │ │ │ ├── SW360DownloadLinks.cs │ │ │ ├── FossologyProcessInfo.cs │ │ │ ├── CheckFossologyProcess.cs │ │ │ ├── UploadParams.cs │ │ │ ├── AttachCreatedBy.cs │ │ │ ├── SW360Releases.cs │ │ │ ├── FossologyJobs.cs │ │ │ ├── GenReportResponse.cs │ │ │ ├── UploadComponentModel.cs │ │ │ ├── Sw360AttachmentHash.cs │ │ │ ├── ProcessSteps.cs │ │ │ ├── FolderModel.cs │ │ │ ├── FileUploadHash.cs │ │ │ ├── Reuse.cs │ │ │ ├── Decider.cs │ │ │ ├── FileUpload.cs │ │ │ ├── MultipleUploadComponentModel.cs │ │ │ └── Analysis.cs │ │ ├── ComponentStatus.cs │ │ ├── UpdateLinkedRelease.cs │ │ ├── UploadInfo.cs │ │ ├── ComponentTypeData.cs │ │ ├── UploadArgs.cs │ │ ├── Links.cs │ │ ├── Sw360Href.cs │ │ ├── Self.cs │ │ ├── Docupdate.cs │ │ ├── Sw360Component.cs │ │ ├── EccInformation.cs │ │ ├── LinkedReleases.cs │ │ ├── ProjectsMapper.cs │ │ ├── ComponentsModel.cs │ │ ├── ComponentsRelease.cs │ │ ├── AllProjectsMapper.cs │ │ ├── UpdateReleaseAdditinoalData.cs │ │ ├── UpdateRelease.cs │ │ ├── AddLinkedRelease.cs │ │ ├── UpdateReleaseExternalId.cs │ │ ├── AQL │ │ │ ├── AqlResponse.cs │ │ │ └── AqlResult.cs │ │ ├── AdditionalData.cs │ │ ├── CreatedBy.cs │ │ ├── AttachmentLinks.cs │ │ ├── JfrogInfo.cs │ │ ├── AttachmentEmbedded.cs │ │ ├── ComponentEmbedded.cs │ │ ├── ReleaseAdditionalData.cs │ │ ├── ReleaseEmbedded.cs │ │ ├── AllProjectsEmbedded.cs │ │ ├── ComponentPurlId.cs │ │ ├── ProjectEmbedded.cs │ │ ├── ComponentsDetailEmbedded.cs │ │ ├── ReleasesDetails.cs │ │ ├── ReleaseLinks.cs │ │ ├── Cury.cs │ │ ├── ExternalIds.cs │ │ ├── AttachReport.cs │ │ ├── ReleaseLinked.cs │ │ ├── Sw360Releases.cs │ │ ├── CreateComponent.cs │ │ ├── Sw360Attachments.cs │ │ ├── Sw360Components.cs │ │ ├── ExternalToolProcess.cs │ │ ├── AttachmentJson.cs │ │ ├── Sw360LinkedRelease.cs │ │ ├── Sw360Projects.cs │ │ ├── ProjectReleases.cs │ │ ├── Sw360AllProjects.cs │ │ └── Releases.cs │ └── Interfaces │ │ └── IJFrogApiCommunication.cs ├── LCT.ArtifactPublisher │ ├── LCT.ArtifactPublisher.csproj │ └── Interface │ │ └── IPublish.cs ├── TestUtilities │ ├── appSettingsSW360IntegrationTest.json │ └── JsonManager.cs ├── LCT.PackageIdentifier │ ├── Model │ │ ├── BundledComponents.cs │ │ ├── AlpinePackage.cs │ │ ├── SpdxComponentInfo.cs │ │ ├── MavenPackage.cs │ │ ├── ComponentIdentification.cs │ │ ├── ReferenceDetails.cs │ │ ├── NugetModel │ │ │ ├── NugetComponent.cs │ │ │ └── Container.cs │ │ ├── NugetPackage.cs │ │ ├── PythonPackage.cs │ │ ├── CycloneDxBomData.cs │ │ ├── DebianPackage.cs │ │ ├── RuntimeInfo.cs │ │ └── ComponentsInfo.cs │ ├── Interface │ │ ├── IRuntimeIdentifier.cs │ │ ├── ICompositionBuilder.cs │ │ ├── IFrameworkPackages.cs │ │ ├── IProcessor.cs │ │ ├── IBomCreator.cs │ │ ├── IParser.cs │ │ └── IBomHelper.cs │ ├── CLIUsageNpkg.txt │ ├── Constants │ │ └── BomConstant.cs │ └── BomValidator.cs ├── LCT.SW360PackageCreator │ ├── Interfaces │ │ ├── IDebianPatcher.cs │ │ ├── IPackageDownloader.cs │ │ ├── IRepository.cs │ │ └── IComponentCreator.cs │ ├── Model │ │ ├── MavenPackage.cs │ │ ├── DebianFileInfo.cs │ │ ├── PythonPackage.cs │ │ ├── DownloadedSourceInfo.cs │ │ ├── AlpinePackage.cs │ │ ├── DebianPackage.cs │ │ └── ConanSources.cs │ └── Constants │ │ └── CreatorConstant.cs ├── LCT.Telemetry │ ├── ITelemetryProvider.cs │ ├── LCT.Telemetry.csproj │ └── HashUtility.cs ├── ArtifactoryUploader │ ├── Model │ │ └── JfrogKey.cs │ ├── Constants │ │ └── ArtifactoryConstant.cs │ ├── LCT.ArtifactoryUploader.csproj │ └── ArtifactoryValidator.cs ├── LCT.Services │ ├── Model │ │ ├── ComponentCreateStatus.cs │ │ └── ReleaseCreateStatus.cs │ ├── Interface │ │ ├── ISw360ProjectService.cs │ │ └── ISW360Service.cs │ └── LCT.Services.csproj ├── LCT.CycloneDxProcessor │ ├── App.config │ └── LCT.CycloneDxProcessor.csproj ├── LCT.Facade │ └── LCT.Facade.csproj ├── Telemetry.UTest │ └── LCT.Telemetry.UTest.csproj ├── LCT.Common.UTests │ ├── EnvironmentTypeTests.cs │ └── LCT.Common.UTest.csproj └── LCT.Facade.UTest │ └── LCT.Facade.UTest.csproj ├── doc ├── usagedocimg │ ├── WF.png │ ├── Items.png │ ├── sw360.PNG │ ├── folder.PNG │ ├── output.PNG │ ├── npminstall.PNG │ ├── piplinepic.PNG │ ├── srcpackage.PNG │ ├── dockerimages.PNG │ ├── postmanimge.PNG │ ├── downloadresult.PNG │ ├── snapshotdebian.PNG │ ├── DebianImg │ │ ├── SnapShot.PNG │ │ ├── FolderCheck.PNG │ │ ├── ListofFiles.PNG │ │ ├── SnapShotResult.PNG │ │ └── SnapShotSource.PNG │ ├── artifactoryuploader.PNG │ ├── packagecreatordebian.PNG │ ├── packageCreatirnpmnuget.PNG │ ├── ComponentcreaterforAlpine.PNG │ ├── packageIdentifierdebian.PNG │ ├── packageIdentifiernpmnuget.PNG │ ├── packageIdentifierdebianalpine.PNG │ └── PackageidentifierBasicSBOMflowdiagram.png ├── gifs │ ├── DockerBuild.gif │ └── NugetBuild.gif ├── img │ ├── sw360workflow.png │ ├── image1-redesign.png │ ├── image2-redesign.png │ └── fossologyworklow.png └── UsageDoc │ └── CLIUsageNpkg.txt ├── MAINTAINERS ├── GitVersion.yml ├── DemoProject ├── NPMProject │ ├── package.json │ └── package-lock.json └── LicenseClearingTool.bat ├── TestFiles └── IntegrationTestFiles │ ├── SystemTest1stIterationData │ ├── Nuget │ │ └── packages.config │ ├── ComplienceCheckNugetFolder │ │ └── packages.config │ └── Npm │ │ └── package.json │ └── SystemTest2ndIterationData │ └── Npm │ ├── package-lock.json │ └── package.json ├── LICENSE ├── .github └── workflows │ └── nuget-publish.yml └── Scripts ├── json_update_ut.ps1 ├── json_update.ps1 └── Create_Nuget_Config.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-detectable=false 2 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/PythonTestProject/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/usagedocimg/WF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/WF.png -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/PythonTestProject/example_package/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/gifs/DockerBuild.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/gifs/DockerBuild.gif -------------------------------------------------------------------------------- /doc/gifs/NugetBuild.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/gifs/NugetBuild.gif -------------------------------------------------------------------------------- /doc/img/sw360workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/img/sw360workflow.png -------------------------------------------------------------------------------- /doc/usagedocimg/Items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/Items.png -------------------------------------------------------------------------------- /doc/usagedocimg/sw360.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/sw360.PNG -------------------------------------------------------------------------------- /doc/img/image1-redesign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/img/image1-redesign.png -------------------------------------------------------------------------------- /doc/img/image2-redesign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/img/image2-redesign.png -------------------------------------------------------------------------------- /doc/usagedocimg/folder.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/folder.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/output.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/output.PNG -------------------------------------------------------------------------------- /doc/img/fossologyworklow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/img/fossologyworklow.png -------------------------------------------------------------------------------- /doc/usagedocimg/npminstall.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/npminstall.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/piplinepic.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/piplinepic.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/srcpackage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/srcpackage.PNG -------------------------------------------------------------------------------- /src/UnitTestUtilities/appsettingsUnitTest.json: -------------------------------------------------------------------------------- 1 | { 2 | "SW360URL": "", 3 | "FossologyURL": "", 4 | "JFrogURL": "" 5 | } -------------------------------------------------------------------------------- /doc/usagedocimg/dockerimages.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/dockerimages.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/postmanimge.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/postmanimge.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/downloadresult.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/downloadresult.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/snapshotdebian.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/snapshotdebian.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/DebianImg/SnapShot.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/DebianImg/SnapShot.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/artifactoryuploader.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/artifactoryuploader.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/packagecreatordebian.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/packagecreatordebian.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/DebianImg/FolderCheck.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/DebianImg/FolderCheck.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/DebianImg/ListofFiles.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/DebianImg/ListofFiles.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/packageCreatirnpmnuget.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/packageCreatirnpmnuget.PNG -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/PythonTestProject/README.md: -------------------------------------------------------------------------------- 1 | Test project for python package dependency identification -------------------------------------------------------------------------------- /doc/usagedocimg/ComponentcreaterforAlpine.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/ComponentcreaterforAlpine.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/DebianImg/SnapShotResult.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/DebianImg/SnapShotResult.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/DebianImg/SnapShotSource.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/DebianImg/SnapShotSource.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/packageIdentifierdebian.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/packageIdentifierdebian.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/packageIdentifiernpmnuget.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/packageIdentifiernpmnuget.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/packageIdentifierdebianalpine.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/packageIdentifierdebianalpine.PNG -------------------------------------------------------------------------------- /doc/usagedocimg/PackageidentifierBasicSBOMflowdiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/doc/usagedocimg/PackageidentifierBasicSBOMflowdiagram.png -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/cthackers.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/cthackers.zip -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Siemens AG 2 | # SPDX-License-Identifier: MIT 3 | 4 | Vijayalakshmi027 5 | karthika-g 6 | sumanthkb44 -------------------------------------------------------------------------------- /GitVersion.yml: -------------------------------------------------------------------------------- 1 | mode: Mainline 2 | branches: 3 | master: 4 | regex: ^master$|^main$ 5 | ignore: 6 | sha: [408943429d1788227ad19ef6434d1fb44257263c, 51eaa765411149f8411676ed421b6274b38aeb4b,d0aa8cbdab2a03b0cb34eda9022e8ffd87655260] 7 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/adduser_3.118-debian10-combined.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemens/continuous-clearing/HEAD/src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/adduser_3.118-debian10-combined.tar.bz2 -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/SW360ProjectInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 42e86178b3b4fe8b8623788052002a6c 4 | CCT 5 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/patched-file_022.tar.gz: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LCT.SW360PackageCreator.UTest.ComponentCreatorUTFiles 8 | { 9 | class patched_file_022 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/TestComponent-1.0-sources.jar: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LCT.SW360PackageCreator.UTest.ComponentCreatorUTFiles 8 | { 9 | class TestComponent_1 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/LCT.APICommunications.UTest/Usings.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | global using NUnit.Framework; -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/PythonTestProject/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "example-package" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["karthika"] 6 | readme = "README.md" 7 | packages = [{include = "example_package"}] 8 | 9 | [tool.poetry.dependencies] 10 | python = "^3.11" 11 | pendulum = "^2.1.2" 12 | 13 | 14 | [build-system] 15 | requires = ["poetry-core"] 16 | build-backend = "poetry.core.masonry.api" 17 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/IEnvironmentHelper.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Interface 8 | { 9 | public interface IEnvironmentHelper 10 | { 11 | void CallEnvironmentExit(int exitCode); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator.UTest/ComponentCreatorUTFiles/Attachment.json: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | { 8 | "filename": "Attachment.json", 9 | "attachmentContentId": "b92d068f-5814-4617-bdcd-ccaa02881c1d", 10 | "attachmentType": "SOURCE" 11 | } -------------------------------------------------------------------------------- /src/LCT.Common/Interface/IFileParser.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Tommy; 8 | 9 | namespace LCT.Common.Interface 10 | { 11 | internal interface IFileParser 12 | { 13 | public TomlTable ParseTomlFile(string filePath); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/LCT.Services.UTest/ServiceUTestFiles/Test.json: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | { 8 | "exclude": [ 9 | "**/bin", 10 | "**/bower_components", 11 | "**/jspm_packages", 12 | "**/node_modules", 13 | "**/obj", 14 | "**/platforms" 15 | ] 16 | } -------------------------------------------------------------------------------- /DemoProject/NPMProject/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ssep", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "gettext": "0.0.8", 12 | "requirejs": "^2.3.5", 13 | "charts": "1.0.2" 14 | }, 15 | "devDependencies": {}, 16 | "postcss": { 17 | "plugins": { 18 | "autoprefixer": {} 19 | } 20 | }, 21 | "browserslist": [ 22 | "> 1%", 23 | "last 2 versions" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/PackageType.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | //--------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | public enum PackageType 10 | { 11 | ClearedThirdParty, 12 | Internal, 13 | Development, 14 | Unknown 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/ISpdxBomParser.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | // Ignore Spelling: Spdx Bom LCT 8 | 9 | using CycloneDX.Models; 10 | 11 | namespace LCT.Common.Interface 12 | { 13 | public interface ISpdxBomParser 14 | { 15 | public Bom ParseSPDXBom(string filePath); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ArtifactoryCredentials.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 10 | public class ArtifactoryCredentials 11 | { 12 | public string Token { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/LCT.ArtifactPublisher/LCT.ArtifactPublisher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8.0.0 8 | 9 | 10 | 11 | ..\..\out 12 | 13 | 14 | 15 | ..\..\out 16 | 17 | 18 | -------------------------------------------------------------------------------- /TestFiles/IntegrationTestFiles/SystemTest1stIterationData/Nuget/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Roles.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | /// 10 | /// Roles model 11 | /// 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class Roles 14 | { 15 | // implement here 16 | } 17 | } -------------------------------------------------------------------------------- /src/LCT.Common/Model/CatoolInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | 8 | namespace LCT.Common.Model 9 | { 10 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 11 | public class CatoolInfo 12 | { 13 | public string CatoolVersion { get; set; } 14 | public string CatoolRunningLocation { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/TestUtilities/appSettingsSW360IntegrationTest.json: -------------------------------------------------------------------------------- 1 | { 2 | "Fossologyurl": "", 3 | "RemoveDevDependency": true, 4 | "EnableFossologyTrigger": false, 5 | "TelemetryEnable": false, 6 | "SW360AuthTokenType": "Token", 7 | "SW360ProjectID": "036ec371847b4b199dd21c3494ccb108", 8 | "SW360ProjectName": "Test", 9 | "SW360URL": "", 10 | "JfrogNugetDestRepoName": "nuget-test", 11 | "JfrogNpmDestRepoName": "npm-test", 12 | "JfrogMavenDestRepoName": "maven-test", 13 | "JfrogConanDestRepoName": "conan-test", 14 | "ArtifactoryUploadApiKey": "", 15 | "ArtifactoryUploadUser": "", 16 | "JFrogApi": "", 17 | "SW360AuthTokenValue": "" 18 | } 19 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Checksum.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 12 | public class Checksum 13 | { 14 | [JsonProperty("sha1")] 15 | public string Sha1 { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Releasestatus.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 10 | public class Releasestatus 11 | { 12 | public Sw360Releases sw360Releases { get; set; } 13 | public bool isReleaseExist { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/ICycloneDXBomParser.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | 9 | namespace LCT.Common 10 | { 11 | /// 12 | /// CycloneDX BomParser interface 13 | /// 14 | public interface ICycloneDXBomParser 15 | { 16 | public Bom ParseCycloneDXBom(string filePath); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LCT.Common/Runtime/EnvironmentType.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Runtime 8 | { 9 | /// 10 | /// The EnvironmentType enum 11 | /// 12 | public enum EnvironmentType 13 | { 14 | Unknown = 0, 15 | GitLab = 1, 16 | AzurePipeline = 2, 17 | AzureRelease = 3 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/BundledComponents.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.PackageIdentifier.Model 10 | { 11 | [ExcludeFromCodeCoverage] 12 | public class BundledComponents 13 | { 14 | public string Name { get; set; } 15 | public string Version { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/Content.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class Content 14 | { 15 | [JsonProperty("message")] 16 | public string Message { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/IRuntimeIdentifier.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common; 8 | using LCT.PackageIdentifier.Model; 9 | 10 | namespace LCT.PackageIdentifier.Interface 11 | { 12 | public interface IRuntimeIdentifier 13 | { 14 | void Register(); 15 | RuntimeInfo IdentifyRuntime(CommonAppSettings appSettings); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Interfaces/IDebianPatcher.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common; 8 | using LCT.Common.Model; 9 | 10 | namespace LCT.SW360PackageCreator.Interfaces 11 | { 12 | public interface IDebianPatcher 13 | { 14 | public Result ApplyPatch(ComparisonBomData component, string localDownloadPath, string fileName); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/LCT.Telemetry/ITelemetryProvider.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | namespace LCT.Telemetry 7 | { 8 | public interface ITelemetryProvider 9 | { 10 | void TrackEvent(string eventName, Dictionary? properties = null); 11 | void TrackException(Exception ex, Dictionary? properties = null); 12 | void Flush(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/ArtifactoryUploader/Model/JfrogKey.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.ArtifactoryUploader.Model 8 | { 9 | /// 10 | /// The Model class for JfrogAPiKey 11 | /// 12 | 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | public class JfrogKey 15 | { 16 | public string Token { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentStatus.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | 10 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 11 | public class ComponentStatus 12 | { 13 | public Sw360Components Sw360components { get; set; } 14 | public bool isComponentExist { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/AttachBy.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 12 | public class AttachBy 13 | { 14 | [JsonProperty("createdBy")] 15 | public AttachCreatedBy CreatedBy { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/UpdateLinkedRelease.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class UpdateLinkedRelease 14 | { 15 | [JsonProperty("comment")] 16 | public string Comment { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/UploadInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCD.Common.Models 8 | { 9 | 10 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 11 | public class UploadInfo 12 | { 13 | public string uploadId { get; set; } 14 | public string folderId { get; set; } 15 | public string userId { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Interfaces/IPackageDownloader.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common.Model; 8 | using System.Threading.Tasks; 9 | 10 | namespace LCT.SW360PackageCreator.Interfaces 11 | { 12 | public interface IPackageDownloader 13 | { 14 | public Task DownloadPackage(ComparisonBomData component, string localPathforDownload); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentTypeData.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 12 | public class ComponentTypeData 13 | { 14 | [JsonProperty("_embedded")] 15 | public ComponentEmbedded Embedded { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/UploadArgs.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 10 | public class UploadArgs 11 | { 12 | public string PackageName { get; set; } 13 | public string ReleaseName { get; set; } 14 | public string Version { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/AlpinePackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.PackageIdentifier.Model 8 | { 9 | 10 | public class AlpinePackage 11 | { 12 | public string Name { get; set; } 13 | 14 | public string Version { get; set; } 15 | 16 | public string PurlID { get; set; } 17 | public SpdxComponentInfo SpdxComponentDetails { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Links.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The Link model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class Links 17 | { 18 | [JsonProperty("self")] 19 | public Self Self { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360Href.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The Sw360Href model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360Href 16 | { 17 | [JsonProperty("href")] 18 | public string Href { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/IPrintWarning.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Interface 8 | { 9 | public interface IPrintWarning 10 | { 11 | /// 12 | /// Prints a warning message to the output. 13 | /// 14 | /// The warning message to be displayed. Cannot be null or empty. 15 | void PrintWarning(string content); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Self.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The Self model class 13 | /// 14 | /// 15 | 16 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public class Self 18 | { 19 | [JsonProperty("href")] 20 | public string Href { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Docupdate.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// DocUpdate model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class DocUpdate 17 | { 18 | [JsonProperty("_embedded")] 19 | public AttachmentEmbedded Embedded { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360Component.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The SW360Component Model class 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360Component 16 | { 17 | [JsonProperty("href")] 18 | public string Href { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/SpdxComponentInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | namespace LCT.PackageIdentifier.Model 9 | { 10 | [ExcludeFromCodeCoverage] 11 | public class SpdxComponentInfo 12 | { 13 | public bool SpdxComponent { get; set; } = false; 14 | public string SpdxFilePath { get; set; } 15 | public bool DevComponent { get; set; } = false; 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/EccInformation.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The EccInformation model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class EccInformation 16 | { 17 | [JsonProperty("eccStatus")] 18 | public string EccStatus { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/TriggerJobParams.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model.Foss 8 | { 9 | /// 10 | /// The TriggerJob params model 11 | /// 12 | 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | public class TriggerJobParams 15 | { 16 | public string FolderId { get; set; } 17 | public string UploadId { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/LinkedReleases.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// THe LinkedRelases Class 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class LinkedReleases 16 | { 17 | [JsonProperty("release")] 18 | public string Release { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/IPrintRecommendation.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Interface 8 | { 9 | public interface IPrintRecommendation 10 | { 11 | /// 12 | /// Prints a specific recommendation message. 13 | /// 14 | /// param name="content">The content of the recommendation message to be printed. 15 | void PrintRecommendation(string content); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ProjectsMapper.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The ProjectsMapper model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class ProjectsMapper 16 | { 17 | [JsonProperty("_embedded")] 18 | public ProjectEmbedded Embedded { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/LCT.Services/Model/ComponentCreateStatus.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.Services.Model 10 | { 11 | /// 12 | /// ComponentCreateStatus 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class ComponentCreateStatus 16 | { 17 | public bool IsCreated { get; set; } 18 | public ReleaseCreateStatus ReleaseStatus { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentsModel.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// ComponentsModel 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class ComponentsModel 17 | { 18 | [JsonProperty("_embedded")] 19 | public ComponentEmbedded Embedded { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentsRelease.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// ComponentsRelease model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class ComponentsRelease 16 | { 17 | [JsonProperty("_embedded")] 18 | public ReleaseEmbedded Embedded { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AllProjectsMapper.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The ProjectsMapper class 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class AllProjectsMapper 16 | { 17 | [JsonProperty("_embedded")] 18 | public AllProjectsEmbedded Embedded { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/FossTriggerStatus.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 12 | public class FossTriggerStatus 13 | { 14 | [JsonProperty("content")] 15 | public Content Content { get; set; } 16 | 17 | [JsonProperty("_links")] 18 | public Links Links { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/UpdateReleaseAdditinoalData.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | public class UpdateReleaseAdditinoalData 15 | { 16 | [JsonProperty("additionalData")] 17 | public Dictionary AdditionalData { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LCT.Common/Model/ListofPerametersForCli.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.Common.Model 10 | { 11 | [ExcludeFromCodeCoverage] 12 | public class ListofPerametersForCli 13 | { 14 | public string InternalRepoList { get; set; } 15 | public string Include { get; set; } 16 | public string Exclude { get; set; } 17 | public string ExcludeComponents { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/ArtifactoryUploader/Constants/ArtifactoryConstant.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace ArtifactoryUploader.Constants 10 | { 11 | /// 12 | /// Artifactory Constants 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public static class ArtifactoryConstant 16 | { 17 | public const string Log4netArtifactoryUploaderConfigFileName = "log4netArtifactoryUploader.config"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/SW360DownloadHref.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// The SW360DownloadHref model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class SW360DownloadHref 17 | { 18 | 19 | [JsonProperty("href")] 20 | public string DownloadUrl { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/UpdateRelease.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The UpdateRelease model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class UpdateRelease 17 | { 18 | [JsonProperty("clearingState")] 19 | public string ClearingState { get; set; } = string.Empty; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/ICompositionBuilder.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using LCT.PackageIdentifier.Model; 9 | using NuGet.Versioning; 10 | using System.Collections.Generic; 11 | 12 | namespace LCT.PackageIdentifier.Interface 13 | { 14 | public interface ICompositionBuilder 15 | { 16 | void AddCompositionsToBom(Bom bom, Dictionary> frameworkPackages, RuntimeInfo runtimeInfo); 17 | } 18 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/MavenPackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.PackageIdentifier.Model 10 | { 11 | /// 12 | /// MavenPackage constants 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class MavenPackage 16 | { 17 | public string ID { get; set; } 18 | public string Version { get; set; } 19 | public string GroupID { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.Telemetry/LCT.Telemetry.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 8.3.0 6 | enable 7 | enable 8 | 9 | 10 | ..\..\out 11 | 12 | 13 | 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/UnitTestUtilities/UnitTestUtilities.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | net8.0 6 | 7 | 8 | 9 | ..\..\out 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AddLinkedRelease.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class AddLinkedRelease 14 | { 15 | [JsonProperty("releaseRelation")] 16 | public string ReleaseRelation { get; set; } 17 | 18 | [JsonProperty("comment")] 19 | public string Comment { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/UpdateReleaseExternalId.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class UpdateReleaseExternalId 14 | { 15 | [JsonProperty("externalIds")] 16 | public Dictionary ExternalIds { get; set; } = new Dictionary(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/ComponentIdentification.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.PackageIdentifier.Model 11 | { 12 | 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | public class ComponentIdentification 15 | { 16 | public List comparisonBOMData { get; set; } 17 | public List internalComponents { get; set; } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/MavenPackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.SW360PackageCreator.Model 10 | { 11 | /// 12 | /// MavenPackage constants 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class MavenPackage 16 | { 17 | public string ID { get; set; } 18 | 19 | public string Version { get; set; } 20 | public string GroupID { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/ReleaseAttachments.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Release Attachment model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class ReleaseAttachments 17 | { 18 | [JsonProperty("_embedded")] 19 | public AttachmentEmbedded Embedded { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/DebianFileInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | 10 | namespace LCT.SW360PackageCreator.Model 11 | { 12 | [ExcludeFromCodeCoverage] 13 | public class DebianFileInfo 14 | { 15 | public string name { get; set; } 16 | 17 | public string archive_name { get; set; } 18 | 19 | public string path { get; set; } 20 | 21 | public string first_seen { get; set; } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/ReferenceDetails.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.PackageIdentifier.Model 10 | { 11 | /// 12 | /// Reference Details 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class ReferenceDetails 16 | { 17 | public string Library { get; set; } 18 | public string Version { get; set; } 19 | public bool Private { get; set; } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.Common/Model/SW360ConnectionSettings.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Model 8 | { 9 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 10 | public class SW360ConnectionSettings 11 | { 12 | public string SW360URL { get; set; } 13 | public string SW360AuthTokenType { get; set; } 14 | public string Sw360Token { get; set; } 15 | public bool IsTestMode { get; set; } 16 | public int Timeout { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AQL/AqlResponse.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model.AQL 11 | { 12 | /// 13 | /// The AqlResponse model class 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class AqlResponse 17 | { 18 | [JsonProperty("results")] 19 | public IList Results { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AdditionalData.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Runtime.Serialization; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// AdditionalData model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | [DataContract] 17 | public class AdditionalData 18 | { 19 | [DataMember(Name = "package download url")] 20 | public string Download_url { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/IFrameworkPackages.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using NuGet.ProjectModel; 8 | using NuGet.Versioning; 9 | using System.Collections.Generic; 10 | 11 | namespace LCT.PackageIdentifier.Interface 12 | { 13 | public interface IFrameworkPackages 14 | { 15 | Dictionary> GetFrameworkPackages(List lockFilePaths); 16 | 17 | string[] GetFrameworkReferences(LockFile lockFile, LockFileTarget target); 18 | } 19 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/SW360DownloadLinks.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// The SW360DownloadLinks model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class SW360DownloadLinks 17 | { 18 | [JsonProperty("sw360:downloadLink")] 19 | public SW360DownloadHref Sw360DownloadLink { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/CreatedBy.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// the created by model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class CreatedBy 16 | { 17 | [JsonProperty("email")] 18 | public string Email { get; set; } 19 | 20 | [JsonProperty("_links")] 21 | public Links Links { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AttachmentLinks.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// AttachmentLinks model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class AttachmentLinks 16 | { 17 | public Sw360Href Sw360component { get; set; } 18 | public Self Self { get; set; } 19 | public IList Curies { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/FossologyProcessInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class FossologyProcessInfo 14 | { 15 | 16 | [JsonProperty("externalTool")] 17 | public string ExternalTool { get; set; } 18 | 19 | [JsonProperty("processSteps")] 20 | public ProcessSteps[] ProcessSteps { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/JfrogInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | namespace LCT.APICommunications.Model 9 | { 10 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 11 | public class JfrogInfo 12 | { 13 | [JsonProperty("repo")] 14 | public string Repo { get; set; } 15 | [JsonProperty("path")] 16 | public string Path { get; set; } 17 | [JsonProperty("checksums")] 18 | public Checksum Checksum { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Constants/CreatorConstant.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.SW360PackageCreator.Constants 10 | { 11 | /// 12 | /// Creaates the constant 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public static class CreatorConstant 16 | { 17 | public const string Log4NetCreatorConfigFileName = "log4netComponentCreator.config"; 18 | public const int MaxDegreeOfParallelism = 2; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AttachmentEmbedded.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// AttachmentEmbedded model 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class AttachmentEmbedded 17 | { 18 | [JsonProperty("sw360:attachments")] 19 | public IList Sw360attachments { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentEmbedded.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// ComponentEmbedded model 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class ComponentEmbedded 17 | { 18 | [JsonProperty("sw360:components")] 19 | public IList Sw360components { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/CheckFossologyProcess.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class CheckFossologyProcess 14 | { 15 | [JsonProperty("fossologyProcessInfo")] 16 | public FossologyProcessInfo FossologyProcessInfo { get; set; } 17 | [JsonProperty("status")] 18 | public string Status { get; set; } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/UploadParams.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model.Foss 8 | { 9 | /// 10 | /// The fossology upload package params model 11 | /// 12 | 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | public class UploadParams 15 | { 16 | public string FolderId { get; set; } 17 | 18 | public string UploadDescription { get; set; } 19 | 20 | public string Public { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ReleaseAdditionalData.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Runtime.Serialization; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The ReleaseAdditionalData model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | [DataContract] 16 | public class ReleaseAdditionalData 17 | { 18 | [DataMember(Name = "fossology url")] 19 | public string Fossology_url { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ReleaseEmbedded.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// ReleaseEmbedded model 14 | /// 15 | /// 16 | 17 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public class ReleaseEmbedded 19 | { 20 | [JsonProperty("sw360:releases")] 21 | public IList Sw360Releases { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/PythonPackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.SW360PackageCreator.Model 10 | { 11 | [ExcludeFromCodeCoverage] 12 | internal class PythonPackage 13 | { 14 | public string Name { get; set; } 15 | 16 | public string Version { get; set; } 17 | 18 | public string PurlID { get; set; } 19 | 20 | public string SourceUrl { get; set; } 21 | 22 | public string WheelUrl { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AllProjectsEmbedded.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// The ProjectsEmbedded class 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class AllProjectsEmbedded 17 | { 18 | [JsonProperty("sw360:projects")] 19 | public IList Sw360Allprojects { get; set; } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentPurlId.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// The Component Level Purl id model 14 | /// 15 | /// 16 | 17 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public class ComponentPurlId 19 | { 20 | [JsonProperty("externalIds")] 21 | public Dictionary ExternalIds { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/LCT.Common/Interface/IChecker.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common.ComplianceValidator; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Threading.Tasks; 11 | 12 | namespace LCT.Common.Interface 13 | { 14 | public interface IChecker : IPrintRecommendation, IPrintWarning 15 | { 16 | Task LoadSettingsAsync(string jsonFilePath); 17 | 18 | bool Check(ComplianceSettingsModel settings, Object data); 19 | 20 | List GetResults(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ProjectEmbedded.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | 8 | using Newtonsoft.Json; 9 | using System.Collections.Generic; 10 | 11 | namespace LCT.APICommunications.Model 12 | { 13 | /// 14 | /// ProjectEmbeded json mapping model class 15 | /// 16 | 17 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public class ProjectEmbedded 19 | { 20 | [JsonProperty("sw360:projects")] 21 | public IList Sw360projects { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ComponentsDetailEmbedded.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class ComponentsDetailEmbedded 14 | { 15 | [JsonProperty("createdBy")] 16 | public CreatedBy CreatedBy { get; set; } 17 | 18 | [JsonProperty("sw360:releases")] 19 | public IList Sw360Releases { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ReleasesDetails.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 12 | public class ReleasesDetails 13 | { 14 | [JsonProperty("name")] 15 | public string Name { get; set; } 16 | [JsonProperty("version")] 17 | public string Version { get; set; } 18 | [JsonProperty("_embedded")] 19 | public AttachmentEmbedded Embedded { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/AttachCreatedBy.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// AttachCreatedBy model class 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class AttachCreatedBy 17 | { 18 | [JsonProperty("name")] 19 | public string Name { get; set; } 20 | 21 | [JsonProperty("_links")] 22 | public Links Links { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ReleaseLinks.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The ReleaseLinks Model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class ReleaseLinks 16 | { 17 | [JsonProperty("self")] 18 | public Self Self { get; set; } 19 | 20 | [JsonProperty("sw360:component")] 21 | public Sw360Component Sw360Component { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/NugetModel/NugetComponent.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using PackageUrl; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.PackageIdentifier.Model.NugetModel 11 | { 12 | [ExcludeFromCodeCoverage] 13 | public class NuGetComponent : BuildInfoComponent 14 | { 15 | public NuGetComponent(string id, string version) : base(id, version) 16 | { 17 | } 18 | 19 | public override string PackageUrl => new PackageURL("nuget", null, Name, Version, null, null).ToString(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Cury.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// Cury model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Cury 16 | { 17 | [JsonProperty("href")] 18 | public string Href { get; set; } 19 | [JsonProperty("name")] 20 | public string Name { get; set; } 21 | [JsonProperty("templated")] 22 | public bool Templated { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /src/LCT.Services/Model/ReleaseCreateStatus.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.Services.Model 10 | { 11 | /// 12 | /// ReleaseCreateStatus model 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class ReleaseCreateStatus 16 | { 17 | public bool IsCreated { get; set; } 18 | 19 | public string ReleaseIdToLink { get; set; } 20 | 21 | public string AttachmentApiUrl { get; set; } 22 | public bool ReleaseAlreadyExist { get; set; } = false; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ExternalIds.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Runtime.Serialization; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// ExternalIds model 13 | /// 14 | /// 15 | 16 | 17 | [DataContract] 18 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 19 | public class ExternalIds 20 | { 21 | [DataMember(Name = "purl.id")] 22 | public string Purl_Id { get; set; } 23 | 24 | [DataMember(Name = "package-url")] 25 | public string Package_Url { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/LCT.Telemetry/HashUtility.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | using System.Security.Cryptography; 7 | using System.Text; 8 | 9 | namespace LCT.Telemetry 10 | { 11 | public static class HashUtility 12 | { 13 | public static string GetHashString(string input) 14 | { 15 | if (string.IsNullOrEmpty(input)) 16 | { 17 | return string.Empty; 18 | } 19 | byte[] hashBytes = SHA256.HashData(Encoding.UTF8.GetBytes(input)); 20 | return BitConverter.ToString(hashBytes).Replace("-", "").ToLowerInvariant(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/LCT.CycloneDxProcessor/App.config: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/CLIUsageNpkg.txt: -------------------------------------------------------------------------------- 1 | Usage: 2 | [flags] 3 | [command] 4 | 5 | Examples for Nuget Package: 6 | PackageIdentifier.exe --settingsfilepath /CAToolConfigPath/appSettings.json Creates Bom file by identifying packages in input 7 | 8 | Available Commands: 9 | PackageIdentifier.exe --settingsfilepath /CAToolConfigPath/appSettings.json Creates Bom file by identifying packages in input 10 | SW360PackageCreator.exe --settingsfilepath /CAToolConfigPath/appSettings.json Creates Components and Release in SW360 11 | ArtifactoryUploader.exe --settingsfilepath /CAToolConfigPath/appSettings.json Uploads source package to JFrog Artifactory 12 | 13 | Flags: 14 | --settingsfilepath Path of application config file 15 | 16 | For more examples refer the Clearing Automation Usage Document. 17 | 18 | Note : For Docker run replace .exe with .dll -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/SW360Releases.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// SW360Releases Model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class SW360Releases 17 | { 18 | 19 | [JsonProperty("name")] 20 | public string Name { get; set; } 21 | 22 | [JsonProperty("version")] 23 | public string Version { get; set; } 24 | 25 | [JsonProperty("_links")] 26 | public Links Links { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/NugetPackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.PackageIdentifier.Model 11 | { 12 | /// 13 | /// Nuget Package 14 | /// 15 | [ExcludeFromCodeCoverage] 16 | public class NugetPackage 17 | { 18 | public string ID { get; set; } 19 | 20 | public string Version { get; set; } 21 | public List Dependencies { get; set; } 22 | 23 | public string Filepath { get; set; } 24 | public string IsDev { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/PythonPackage.cs: -------------------------------------------------------------------------------- 1 | 2 | // -------------------------------------------------------------------------------------------------------------------- 3 | // SPDX-FileCopyrightText: 2025 Siemens AG 4 | // 5 | // SPDX-License-Identifier: MIT 6 | 7 | // -------------------------------------------------------------------------------------------------------------------- 8 | 9 | using System.Diagnostics.CodeAnalysis; 10 | 11 | namespace LCT.PackageIdentifier.Model 12 | { 13 | [ExcludeFromCodeCoverage] 14 | public class PythonPackage 15 | { 16 | public string PurlID { get; set; } 17 | public string Name { get; set; } 18 | public string Version { get; set; } 19 | public bool Isdevdependent { get; set; } 20 | public string FoundType { get; set; } 21 | public string Filepath { get; set; } 22 | public SpdxComponentInfo SpdxComponentDetails { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/DownloadedSourceInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.SW360PackageCreator.Model 10 | { 11 | /// 12 | /// Downloaded Source Info 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class DownloadedSourceInfo 16 | { 17 | public string Name { get; set; } 18 | 19 | public string Version { get; set; } 20 | 21 | public string SourceRepoUrl { get; set; } 22 | 23 | public string DownloadedPath { get; set; } 24 | 25 | public string TaggedVersion { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/FossologyJobs.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Fossology Jobs model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class FossologyJobs 17 | { 18 | [JsonProperty("analysis")] 19 | public Analysis Analysis { get; set; } 20 | 21 | [JsonProperty("decider")] 22 | public Decider Decider { get; set; } 23 | 24 | [JsonProperty("reuse")] 25 | public Reuse Reuse { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/GenReportResponse.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// The GenReportResponse Model Class 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class GenReportResponse 16 | { 17 | [JsonProperty("code")] 18 | public int Code { get; set; } 19 | 20 | [JsonProperty("message")] 21 | public string Message { get; set; } 22 | 23 | [JsonProperty("type")] 24 | public string Type { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/UploadComponentModel.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// The UploadComponentModel 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class UploadComponentModel 17 | { 18 | [JsonProperty("code")] 19 | public string Code { get; set; } 20 | 21 | [JsonProperty("message")] 22 | public string UploadId { get; set; } 23 | 24 | [JsonProperty("type")] 25 | public string Type { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AttachReport.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | /// 10 | /// Attach report to sw360 model 11 | /// 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class AttachReport 14 | { 15 | public string ReleaseId { get; set; } 16 | 17 | public string AttachmentType { get; set; } 18 | 19 | public string AttachmentFile { get; set; } 20 | 21 | public string AttachmentCheckStatus { get; set; } 22 | 23 | public string AttachmentReleaseComment { get; set; } = string.Empty; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/LCT.Common/Model/ComponentsRequireAction.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.Common.Model 11 | { 12 | [ExcludeFromCodeCoverage] 13 | public class ComponentsRequireAction 14 | { 15 | public List ListofComponentsWithoutSourceAttachment { get; set; } = new List(); 16 | 17 | public List ListofComponentsWithoutSrcDownloadUrl { get; set; } = new List(); 18 | 19 | public List ListofComponentsNotUploaded { get; set; } = new List(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ReleaseLinked.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model 8 | { 9 | /// 10 | /// The ReleasesLinked info class 11 | /// 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class ReleaseLinked 14 | { 15 | public string Name { get; set; } = string.Empty; 16 | 17 | public string Version { get; set; } = string.Empty; 18 | 19 | public string ReleaseId { get; set; } = string.Empty; 20 | 21 | public string Comment { get; set; } = string.Empty; 22 | public string Relation { get; set; } = string.Empty; 23 | } 24 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/CycloneDxBomData.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.PackageIdentifier.Model 11 | { 12 | /// 13 | /// CycloneDx Data 14 | /// 15 | [ExcludeFromCodeCoverage] 16 | internal class CycloneDxBomData 17 | { 18 | [JsonProperty("bomFormat")] 19 | public string BomFormat { get; set; } 20 | 21 | [JsonProperty("specVersion")] 22 | public string SpecVersion { get; set; } 23 | 24 | [JsonProperty("components")] 25 | public ComponentsInfo[] ComponentsInfo { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/Sw360AttachmentHash.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.APICommunications.Model.Foss 8 | { 9 | /// 10 | /// The Sw360 AttachmentHash Model 11 | /// 12 | 13 | 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360AttachmentHash 16 | { 17 | public string AttachmentLink { get; set; } 18 | 19 | public string HashCode { get; set; } 20 | 21 | public string SourceDownloadUrl { get; set; } 22 | 23 | public string SW360AttachmentName { get; set; } 24 | public bool isAttachmentSourcenotAvailableInSw360 { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/ProcessSteps.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | 12 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 13 | public class ProcessSteps 14 | { 15 | [JsonProperty("stepName")] 16 | public string StepName { get; set; } 17 | 18 | [JsonProperty("stepStatus")] 19 | public string StepStatus { get; set; } 20 | 21 | [JsonProperty("processStepIdInTool")] 22 | public string ProcessStepIdInTool { get; set; } 23 | 24 | [JsonProperty("result")] 25 | public string Result { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/AlpinePackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.SW360PackageCreator.Model 10 | { 11 | /// 12 | /// Alpine Package Class 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class AlpinePackage 16 | { 17 | public string Name { get; set; } 18 | 19 | public string Version { get; set; } 20 | 21 | public string PurlID { get; set; } 22 | 23 | public string SourceUrl { get; set; } 24 | 25 | public string DownloadUrl { get; set; } 26 | 27 | public string SourceDataForAlpine { get; set; } 28 | 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/LCT.Common/Parallel.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Diagnostics.CodeAnalysis; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | 13 | namespace LCT.Common 14 | { 15 | /// 16 | /// DefinedParallel 17 | /// 18 | [ExcludeFromCodeCoverage] 19 | public static class DefinedParallel 20 | { 21 | public static Task ParallelForEachAsync(this IEnumerable totalreleases, Func body) 22 | { 23 | return Task.WhenAll( 24 | from item in totalreleases 25 | select Task.Run(() => body(item))); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/LCT.Common/ComplianceValidator/ComplianceSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "complianceExceptionComponents": [ 3 | { 4 | "id": "cef", 5 | "name": "Chromium Embedded Framework", 6 | "description": "Framework for embedding Chromium-based browsers", 7 | "purl": [ 8 | "pkg:nuget/CefSharp.Common.NETCore", 9 | "pkg:nuget/CefSharp.Common", 10 | "pkg:nuget/CefSharp.WinForms.NETCore", 11 | "pkg:nuget/CefSharp.WinForms", 12 | "pkg:nuget/chromiumembeddedframework.runtime.win-x64", 13 | "pkg:nuget/chromiumembeddedframework.runtime.win-x86" 14 | ], 15 | "complianceInstructions": { 16 | "warningMessage": "Component 'Chromium Embedded Framework' source code must be manually uploaded", 17 | "recommendation": "Use Microsoft Edge WebView2 as a modern alternative to Chromium dependencies. For further details, refer to the Wiki at: https://github.com/siemens/continuous-clearing/wiki#component-compliance-guidance." 18 | } 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /src/LCT.Facade/LCT.Facade.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 8.3.0 6 | 7 | 8 | 9 | ..\..\out 10 | 11 | 12 | 13 | ..\..\out 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360Releases.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// Sw360Releases model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360Releases 16 | { 17 | [JsonProperty("name")] 18 | public string Name { get; set; } 19 | 20 | [JsonProperty("version")] 21 | public string Version { get; set; } 22 | 23 | [JsonProperty("externalIds")] 24 | public ExternalIds ExternalIds { get; set; } 25 | 26 | [JsonProperty("_links")] 27 | public Links Links { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/FolderModel.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// The folder model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class FolderModel 17 | { 18 | [JsonProperty("id")] 19 | public string Id { get; set; } 20 | 21 | [JsonProperty("name")] 22 | public string Name { get; set; } 23 | 24 | [JsonProperty("description")] 25 | public string Description { get; set; } 26 | 27 | [JsonProperty("parent")] 28 | public string Parent { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/IProcessor.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using LCT.APICommunications.Model; 9 | using LCT.Common; 10 | using System.Collections.Generic; 11 | using System.Threading.Tasks; 12 | 13 | namespace LCT.PackageIdentifier.Interface 14 | { 15 | public interface IProcessor 16 | { 17 | public Task> CheckInternalComponentsInJfrogArtifactory(CommonAppSettings appSettings, ArtifactoryCredentials artifactoryUpload, Component component, string repo); 18 | public Task> GetJfrogArtifactoryRepoInfo(CommonAppSettings appSettings, ArtifactoryCredentials artifactoryUpload, Component component, string repo); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/FileUploadHash.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Then File upload hash code model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class FileUploadHash 17 | { 18 | [JsonProperty("sha1")] 19 | public string Sha1 { get; set; } 20 | 21 | [JsonProperty("md5")] 22 | public string Md5 { get; set; } 23 | 24 | [JsonProperty("sha256")] 25 | public string Sha256 { get; set; } 26 | 27 | [JsonProperty("size")] 28 | public string Size { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LCT.Common/FileParser.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common.Interface; 8 | using System.IO; 9 | using Tommy; 10 | 11 | namespace LCT.Common 12 | { 13 | public class FileParser : IFileParser 14 | { 15 | public TomlTable ParseTomlFile(string filePath) 16 | { 17 | TomlTable table; 18 | try 19 | { 20 | using StreamReader reader = File.OpenText(filePath); 21 | // Parsing the table 22 | table = TOML.Parse(reader); 23 | return table; 24 | } 25 | catch (TomlParseException) 26 | { 27 | return new TomlTable(); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Constants/BomConstant.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.PackageIdentifier.Constants 10 | { 11 | /// 12 | /// Bom Constants 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public static class BomConstant 16 | { 17 | public const string Log4netBomCreatorConfigFileName = "log4netPackageIdentifier.config"; 18 | public const string PackageLockFileName = "package-lock.json"; 19 | public const string PackageConfigFileName = "packages.config"; 20 | public const string PackageLockJsonFileName = "packages.lock.json"; 21 | public const int MaxDegreeOfParallelism = 2; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/CreateComponent.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// CreateComponent model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class CreateComponent 16 | { 17 | [JsonProperty("name")] 18 | public string Name { get; set; } 19 | 20 | [JsonProperty("componentType")] 21 | public string ComponentType { get; set; } 22 | 23 | [JsonProperty("categories")] 24 | public string[] Categories { get; set; } 25 | [JsonProperty("externalIds")] 26 | public ExternalIds ExternalIds { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360Attachments.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// Sw360Attachments model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360Attachments 16 | { 17 | [JsonProperty("filename")] 18 | public string Filename { get; set; } 19 | 20 | [JsonProperty("sha1")] 21 | public string Sha1 { get; set; } 22 | 23 | [JsonProperty("attachmentType")] 24 | public string AttachmentType { get; set; } 25 | 26 | [JsonProperty("_links")] 27 | public AttachmentLinks Links { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360Components.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// The Sw360Components Model class 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360Components 16 | { 17 | [JsonProperty("name")] 18 | public string Name { get; set; } 19 | 20 | [JsonProperty("componentType")] 21 | public string ComponentType { get; set; } 22 | 23 | [JsonProperty("_links")] 24 | public Links Links { get; set; } 25 | 26 | [JsonProperty("externalIds")] 27 | public ExternalIds ExternalIds { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/Reuse.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Reuse scanner model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class Reuse 17 | { 18 | [JsonProperty("reuse_upload")] 19 | public int Reuse_upload { get; set; } 20 | 21 | [JsonProperty("reuse_group")] 22 | public int Reuse_group { get; set; } 23 | 24 | [JsonProperty("reuse_main")] 25 | public bool Reuse_main { get; set; } 26 | 27 | [JsonProperty("reuse_enhanced")] 28 | public bool Reuse_enhanced { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/Nuget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | SEPP.Nuget 6 | SEPP.Nuget 7 | 8 | Library 9 | 10 | x64 11 | 12 | 13 | 14 | 15 | 16 | all 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/UnitTestUtilities/UTParams.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Microsoft.Extensions.Configuration; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace UnitTestUtilities 11 | { 12 | /// 13 | /// The UTConstant class 14 | /// 15 | [ExcludeFromCodeCoverage] 16 | public static class UTParams 17 | { 18 | public static readonly IConfiguration config = new ConfigurationBuilder().AddJsonFile("appsettingsUnitTest.json", true, true).Build(); 19 | 20 | public static readonly string SW360URL = config["SW360URL"]; 21 | public static readonly string FossologyURL = config["FossologyURL"]; 22 | public static readonly string JFrogURL = config["JFrogURL"]; 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/ISettingsManager.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Interface 8 | { 9 | /// 10 | /// ISettingsManager interface 11 | /// 12 | public interface ISettingsManager 13 | { 14 | /// 15 | /// Reads the Configuration from input args and json setting file 16 | /// 17 | /// args 18 | /// jsonSettingsFileName 19 | /// AppSettings 20 | public T ReadConfiguration(string[] args, string jsonSettingsFileName); 21 | 22 | public void CheckRequiredArgsToRun(CommonAppSettings appSettings, string currentExe); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/LCT.CycloneDxProcessor/LCT.CycloneDxProcessor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 8.3.0 6 | 7 | 8 | 9 | ..\..\out 10 | 11 | 12 | 13 | true 14 | true 15 | 16 | 17 | 18 | ..\..\out 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Always 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/LCT.Common/EnvironmentHelper.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common.Interface; 8 | using System; 9 | 10 | namespace LCT.Common 11 | { 12 | public class EnvironmentHelper : IEnvironmentHelper 13 | { 14 | public void CallEnvironmentExit(int exitCode) 15 | { 16 | if (exitCode == -1 || exitCode == 0) 17 | { 18 | PipelineArtifactUploader.UploadLogs(); 19 | EnvironmentExit(exitCode); 20 | } 21 | else if (exitCode == 2) 22 | { 23 | Environment.ExitCode = 2; 24 | } 25 | } 26 | private static void EnvironmentExit(int exitCode) 27 | { 28 | Environment.Exit(exitCode); 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/DebianPackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.SW360PackageCreator.Model 10 | { 11 | /// 12 | /// Debian Package Class 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class DebianPackage 16 | { 17 | public string Name { get; set; } 18 | 19 | public string Version { get; set; } 20 | 21 | public string PurlID { get; set; } 22 | 23 | public string SourceUrl { get; set; } 24 | 25 | public string[] PatchURLs { get; set; } 26 | 27 | public string DownloadUrl { get; set; } 28 | 29 | public string JsonText { get; set; } 30 | 31 | public bool IsRetryRequired { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /TestFiles/IntegrationTestFiles/SystemTest1stIterationData/ComplienceCheckNugetFolder/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/LCT.Common/Result.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.Common 10 | { 11 | /// 12 | /// Run process result 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class Result 16 | { 17 | /// 18 | /// Exit code 19 | /// If NULL, process exited due to timeout 20 | /// 21 | public int? ExitCode { get; set; } = null; 22 | 23 | /// 24 | /// Standard error stream 25 | /// 26 | public string StdErr { get; set; } = ""; 27 | 28 | /// 29 | /// Standard output stream 30 | /// 31 | public string StdOut { get; set; } = ""; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/LCT.Common/Model/MultipleVersionValues.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.Common.Model 11 | { 12 | /// 13 | /// MultipleVersionValues model 14 | /// 15 | [ExcludeFromCodeCoverage] 16 | public class MultipleVersionValues 17 | { 18 | public string ComponentName { get; set; } 19 | public string ComponentVersion { get; set; } 20 | public string PackageFoundIn { get; set; } 21 | 22 | } 23 | 24 | public class MultipleVersions 25 | { 26 | public List Npm { get; set; } 27 | public List Nuget { get; set; } 28 | public List Conan { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/Decider.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Fossoloygy decider model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class Decider 17 | { 18 | [JsonProperty("nomos_monk")] 19 | public bool Nomos_monk { get; set; } 20 | 21 | [JsonProperty("bulk_reused")] 22 | public bool Bulk_reused { get; set; } 23 | 24 | [JsonProperty("new_scanner")] 25 | public bool New_scanner { get; set; } 26 | 27 | [JsonProperty("ojo_decider")] 28 | public bool Ojo_decider { get; set; } 29 | 30 | public Decider() 31 | { 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/NugetSelfContainedProject/Nuget-SelfContained.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | SEPP.Nuget 6 | SEPP.Nuget 7 | 8 | Library 9 | 10 | x64 11 | 12 | 13 | 14 | 15 | 16 | all 17 | 18 | 19 | 20 | 21 | true 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT LICENSE 2 | 3 | Copyright (c) Siemens AG 2024 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included 13 | in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/DebianPackage.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Diagnostics.CodeAnalysis; 8 | 9 | namespace LCT.PackageIdentifier.Model 10 | { 11 | /// 12 | /// Debian Package Class 13 | /// 14 | [ExcludeFromCodeCoverage] 15 | public class DebianPackage 16 | { 17 | public string Name { get; set; } 18 | 19 | public string Version { get; set; } 20 | 21 | public string PurlID { get; set; } 22 | 23 | public string SourceUrl { get; set; } 24 | 25 | public string[] PatchURLs { get; set; } 26 | 27 | public string DownloadUrl { get; set; } 28 | 29 | public string JsonText { get; set; } 30 | 31 | public bool IsRetryRequired { get; set; } 32 | public SpdxComponentInfo SpdxComponentDetails { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Interfaces/IJFrogApiCommunication.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Model; 8 | using System.Net.Http; 9 | using System.Threading.Tasks; 10 | 11 | namespace LCT.APICommunications.Interfaces 12 | { 13 | public interface IJFrogApiCommunication 14 | { 15 | Task GetPackageInfo(ComponentsToArtifactory component); 16 | 17 | Task DeletePackageFromJFrogRepo(string repoName, string componentName); 18 | 19 | Task CopyFromRemoteRepo(ComponentsToArtifactory component); 20 | 21 | Task MoveFromRepo(ComponentsToArtifactory component); 22 | 23 | Task GetApiKey(); 24 | 25 | void UpdatePackagePropertiesInJfrog(string sw360releaseUrl, string destRepoName, UploadArgs uploadArgs); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TestFiles/IntegrationTestFiles/SystemTest2ndIterationData/Npm/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clearingtest", 3 | "version": "0.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@angular/common": { 8 | "version": "9.1.12", 9 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/@angular/common/-/common-9.1.12.tgz", 10 | "integrity": "sha1-cxcB+uY66OLuLOAOfVH0WOzQDHw=" 11 | }, 12 | "rxjs": { 13 | "version": "6.5.5", 14 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/rxjs/-/rxjs-6.5.5.tgz", 15 | "integrity": "sha1-xciE4wlMjP7jG/J+uH5UzPyH+ew=", 16 | "requires": { 17 | "tslib": "^1.9.0" 18 | } 19 | }, 20 | "tslib": { 21 | "version": "1.13.0", 22 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/tslib-1.13.0.tgz", 23 | "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM=" 24 | }, 25 | "zone.js": { 26 | "version": "0.10.3", 27 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/zone.js/-/zone.js-0.10.3.tgz", 28 | "integrity": "sha1-Pl5NoDxgfJ3NkuN901aHoUoUDBY=" 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ExternalToolProcess.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Model.Foss; 8 | using Newtonsoft.Json; 9 | using System.Collections.Generic; 10 | 11 | namespace LCT.APICommunications.Model 12 | { 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | public class ExternalToolProcess 15 | { 16 | [JsonProperty("externalTool")] 17 | public string ExternalTool { get; set; } 18 | 19 | [JsonProperty("processStatus")] 20 | public string ProcessStatus { get; set; } 21 | 22 | [JsonProperty("attachmentId")] 23 | public string AttachmentId { get; set; } 24 | 25 | [JsonProperty("attachmentHash")] 26 | public string AttachmentHash { get; set; } 27 | 28 | [JsonProperty("processSteps")] 29 | public List ProcessSteps { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/BomValidator.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Model; 8 | using LCT.Common; 9 | using LCT.Services.Interface; 10 | using System.Threading.Tasks; 11 | 12 | namespace LCT.PackageIdentifier 13 | { 14 | /// 15 | /// Validates the input params 16 | /// 17 | public static class BomValidator 18 | { 19 | public static async Task ValidateAppSettings(CommonAppSettings appSettings, ISw360ProjectService bomService, ProjectReleases projectReleases) 20 | { 21 | string sw360ProjectName = await bomService.GetProjectNameByProjectIDFromSW360(appSettings.SW360.ProjectID, appSettings.SW360.ProjectName, projectReleases); 22 | 23 | return CommonHelper.ValidateSw360Project(sw360ProjectName, projectReleases?.ClearingState, projectReleases?.Name, appSettings); 24 | } 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/IBomCreator.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Model; 8 | using LCT.Common; 9 | using LCT.Common.Interface; 10 | using LCT.Common.Model; 11 | using LCT.Services.Interface; 12 | using System.Threading.Tasks; 13 | 14 | namespace LCT.PackageIdentifier.Interface 15 | { 16 | /// 17 | /// BomCreator interface 18 | /// 19 | public interface IBomCreator 20 | { 21 | public IJFrogService JFrogService { get; set; } 22 | 23 | public IBomHelper BomHelper { get; set; } 24 | 25 | public Task GenerateBom(CommonAppSettings appSettings, IBomHelper bomHelper, IFileOperations fileOperations, 26 | ProjectReleases projectReleases, CatoolInfo caToolInformation); 27 | 28 | public Task CheckJFrogConnection(CommonAppSettings appSettings); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LCT.ArtifactPublisher/Interface/IPublish.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2024 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.ArtifactPublisher.Interface 8 | { 9 | /// 10 | /// Represents an artifact publisher. 11 | /// 12 | public interface IPublish 13 | { 14 | /// 15 | /// Gets or sets the path to the CATool log file. 16 | /// 17 | string CatoolLogPath { get; set; } 18 | 19 | /// 20 | /// Gets or sets the path to the CATool BOM (Bill of Materials) file. 21 | /// 22 | string CatoolBomFilePath { get; set; } 23 | 24 | /// 25 | /// Publishes the logs. 26 | /// 27 | void UploadLogs(); 28 | 29 | /// 30 | /// Publishes the BOM (Bill of Materials). 31 | /// 32 | void UploadBom(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/LCT.Services/Interface/ISw360ProjectService.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Model; 8 | using System.Collections.Generic; 9 | using System.Threading.Tasks; 10 | 11 | namespace LCT.Services.Interface 12 | { 13 | /// 14 | /// The ISw360ProjectService interface 15 | /// 16 | public interface ISw360ProjectService 17 | { 18 | /// 19 | /// Gets the ProjectName By ProjectID From SW360 20 | /// 21 | /// projectId 22 | /// projectName 23 | /// string 24 | Task GetProjectNameByProjectIDFromSW360(string projectId, string projectName, ProjectReleases projectReleases); 25 | 26 | Task> GetAlreadyLinkedReleasesByProjectId(string projectId); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DemoProject/NPMProject/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ssep", 3 | "version": "0.1.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "UiBuildingBlocks": { 8 | "version": "1.0.82", 9 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/UiBuildingBlocks/-/UiBuildingBlocks-1.0.82.tgz", 10 | "integrity": "sha1-QyV3dFzk//uPNkbB9WIPpPLa2R4=", 11 | "requires": { 12 | "gettext": "0.0.8", 13 | "requirejs": "^2.3.5" 14 | } 15 | }, 16 | "gettext": { 17 | "version": "0.0.8", 18 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/gettext/-/gettext-0.0.8.tgz", 19 | "integrity": "sha1-9mZZLeGExCWoJE9OxDqytWhbMmc=" 20 | }, 21 | "requirejs": { 22 | "version": "2.3.6", 23 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/requirejs/-/requirejs-2.3.6.tgz", 24 | "integrity": "sha1-5Qk9lgHCgpJRJYwLlEXU0Z+p58k=" 25 | }, 26 | "charts": { 27 | "version": "1.0.2", 28 | "resolved": "https://testserver/artifactory/api/npm/energy-dev-npm/charts/-/charts-1.0.2.tgz", 29 | "integrity": "sha1-8LDrToBhpGcExxQkI3dGhup5zQ4=" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AttachmentJson.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// AttachmentJson model 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | [Serializable] 17 | public class AttachmentJson 18 | { 19 | [JsonProperty("filename")] 20 | public string Filename { get; set; } 21 | 22 | [JsonProperty("attachmentContentId")] 23 | public string AttachmentContentId { get; set; } 24 | 25 | [JsonProperty("attachmentType")] 26 | public string AttachmentType { get; set; } 27 | 28 | [JsonProperty("checkStatus")] 29 | public string CheckStatus { get; set; } 30 | 31 | [JsonProperty("createdComment")] 32 | public string CreatedComment { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360LinkedRelease.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// SW360LinkedReleases model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Sw360LinkedRelease 16 | { 17 | [JsonProperty("createdBy")] 18 | public string CreatedBy { get; set; } 19 | 20 | [JsonProperty("release")] 21 | public string Release { get; set; } 22 | 23 | [JsonProperty("mainlineState")] 24 | public string MainlineState { get; set; } 25 | 26 | [JsonProperty("comment")] 27 | public string Comment { get; set; } 28 | 29 | [JsonProperty("createdOn")] 30 | public string CreatedOn { get; set; } 31 | 32 | [JsonProperty("relation")] 33 | public string Relation { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /.github/workflows/nuget-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish NuGet Packages 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | permissions: 8 | packages: write 9 | contents: read 10 | 11 | jobs: 12 | publish: 13 | runs-on: windows-latest 14 | 15 | steps: 16 | - name: Download NuGet Packages from Release 17 | run: | 18 | Write-Host "GITHUB_REF: '$($env:GITHUB_REF)'" 19 | $prefix = "refs/tags/" 20 | $name = $($env:GITHUB_REF).Substring($prefix.Length) 21 | Write-Host "name: '$name'" 22 | gh release download $name --repo siemens/continuous-clearing --pattern '*.nupkg' --clobber 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | 26 | - name: Publish to github packages 27 | run: | 28 | dotnet nuget add source --username ${{ secrets.USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/SIEMENS/index.json" 29 | dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source github 30 | env: 31 | USERNAME: ${{ secrets.USERNAME }} 32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | -------------------------------------------------------------------------------- /src/LCT.Common/ComponentEqualityComparer.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace LCT.Common 12 | { 13 | /// 14 | /// Comparer class 15 | /// 16 | public class ComponentEqualityComparer : IEqualityComparer 17 | { 18 | public bool Equals(Component x, Component y) 19 | { 20 | if (x == null && y == null) 21 | return true; 22 | else if (x == null || y == null) 23 | return false; 24 | else if ((x.Name == y.Name) && (x.Version == y.Version) && (x.Purl == y.Purl)) 25 | return true; 26 | else 27 | return false; 28 | } 29 | 30 | public int GetHashCode(Component obj) 31 | { 32 | return HashCode.Combine(obj.Name, obj.Version, obj.Purl); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/LCT.Common/Logging/LoggerFactory.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | 6 | // -------------------------------------------------------------------------------------------------------------------- 7 | using log4net; 8 | using System.Reflection; 9 | 10 | namespace LCT.Common 11 | { 12 | public static class LoggerFactory 13 | { 14 | // This property determines whether to use Spectre.Console for logging or log4net. 15 | public static bool UseSpectreConsole { get; set; } = true; 16 | 17 | public static ILog GetLogger(System.Type type) 18 | { 19 | if (UseSpectreConsole) 20 | return new SpectreLogAdapter(type.FullName); 21 | else 22 | return LogManager.GetLogger(type); 23 | } 24 | 25 | public static ILog GetLogger(MethodBase method) 26 | { 27 | if (UseSpectreConsole) 28 | return new SpectreLogAdapter(method.DeclaringType?.FullName); 29 | else 30 | return LogManager.GetLogger(method.DeclaringType); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/IParser.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using LCT.Common; 9 | using LCT.PackageIdentifier.Model; 10 | using LCT.Services.Interface; 11 | using System.Collections.Generic; 12 | using System.Threading.Tasks; 13 | 14 | namespace LCT.PackageIdentifier.Interface 15 | { 16 | /// 17 | /// IParser interface 18 | /// 19 | public interface IParser 20 | { 21 | public Bom ParsePackageFile(CommonAppSettings appSettings, ref Bom unSupportedBomList); 22 | public Task IdentificationOfInternalComponents( 23 | ComponentIdentification componentData, CommonAppSettings appSettings, IJFrogService jFrogService, IBomHelper bomhelper); 24 | public Task> GetJfrogRepoDetailsOfAComponent(List componentsForBOM, CommonAppSettings appSettings, IJFrogService jFrogService, IBomHelper bomhelper); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Interfaces/IRepository.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.SW360PackageCreator.Interfaces 8 | { 9 | /// 10 | /// The interface IRepository 11 | /// 12 | public interface IRepository 13 | { 14 | /// 15 | /// Identifies the github repository URL to download the source 16 | /// 17 | /// 18 | /// 19 | /// string 20 | string IdentifyRepoURLForGit(string url, string componentName); 21 | 22 | /// 23 | /// Forms the git clone url from the given url 24 | /// 25 | /// 26 | /// 27 | /// string 28 | string FormGitCloneUrl(string url, string componentName, string version); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/TestUtilities/JsonManager.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using Newtonsoft.Json; 9 | using System.Collections.Generic; 10 | using System.Diagnostics.CodeAnalysis; 11 | using System.IO; 12 | 13 | namespace TestUtilities 14 | { 15 | [ExcludeFromCodeCoverage] 16 | public class ComponentJsonParsor 17 | { 18 | public List Components { get; } = new List(); 19 | public void Read(string path) 20 | { 21 | var json = File.ReadAllText(path); 22 | try 23 | { 24 | Bom components = CycloneDX.Json.Serializer.Deserialize(json); 25 | 26 | foreach (var item in components.Components) 27 | { 28 | Components.Add(item); 29 | } 30 | 31 | } 32 | catch (JsonReaderException) 33 | { 34 | // do nothing 35 | } 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360Projects.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// The Sw360Projects mapper model class 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class Sw360Projects 17 | { 18 | [JsonProperty("name")] 19 | public string Name { get; set; } 20 | 21 | [JsonProperty("version")] 22 | public string Version { get; set; } 23 | 24 | [JsonProperty("securityResponsibles")] 25 | public IList SecurityResponsibles { get; set; } 26 | 27 | [JsonProperty("projectType")] 28 | public string ProjectType { get; set; } 29 | 30 | [JsonProperty("visibility")] 31 | public string Visibility { get; set; } 32 | 33 | [JsonProperty("_links")] 34 | public Links Links { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Interfaces/IComponentCreator.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common; 8 | using LCT.Common.Interface; 9 | using LCT.Common.Model; 10 | using LCT.Services.Interface; 11 | using System.Collections.Generic; 12 | using System.Threading.Tasks; 13 | 14 | namespace LCT.SW360PackageCreator.Interfaces 15 | { 16 | /// 17 | /// The IComponentCreator interface 18 | /// 19 | interface IComponentCreator 20 | { 21 | Task> CycloneDxBomParser(CommonAppSettings appSettings, 22 | ISW360Service sw360Service, ICycloneDXBomParser cycloneDXBomParser, ICreatorHelper creatorHelper); 23 | Task CreateComponentInSw360(CommonAppSettings appSettings, 24 | ISw360CreatorService sw360CreatorService, ISW360Service sw360Service, ISw360ProjectService sw360ProjectService, 25 | IFileOperations fileOperations, ICreatorHelper creatorHelper, List parsedBomData); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/ProjectReleases.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// The ProjectRelease Model 14 | /// 15 | /// 16 | 17 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public class ProjectReleases 19 | { 20 | [JsonProperty("name")] 21 | public string Name { get; set; } 22 | 23 | [JsonProperty("version")] 24 | public string Version { get; set; } 25 | 26 | [JsonProperty("state")] 27 | public string State { get; set; } 28 | 29 | [JsonProperty("clearingState")] 30 | public string ClearingState { get; set; } 31 | 32 | [JsonProperty("_embedded")] 33 | public ReleaseEmbedded Embedded { get; set; } 34 | 35 | [JsonProperty("linkedReleases")] 36 | public List LinkedReleases { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/NugetModel/Container.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.PackageIdentifier.Model.NugetModel 11 | { 12 | [SuppressMessage("ReSharper", "InconsistentNaming")] 13 | public enum ContainerType 14 | { 15 | unknown = 0, 16 | nuget = 1 17 | } 18 | 19 | 20 | /// 21 | /// A container is a logical group which uses packages. 22 | /// E.g., this could be a nuget.config file or a *.csproj file. 23 | /// 24 | [ExcludeFromCodeCoverage] 25 | public class Container 26 | { 27 | public IDictionary Components { get; set; } = new Dictionary(); 28 | 29 | public string Name { get; set; } 30 | 31 | public ContainerType Type { get; set; } 32 | 33 | public ComponentScope Scope { get; set; } = ComponentScope.Required; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/ArtifactoryUploader/LCT.ArtifactoryUploader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | ArtifactoryUploader 7 | 8.3.0 8 | 9 | 10 | 11 | ..\..\out 12 | 13 | 14 | 15 | ..\..\out 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Scripts/json_update_ut.ps1: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Siemens AG 2 | # SPDX-License-Identifier: MIT 3 | 4 | param( 5 | [Parameter(Mandatory=$true)] 6 | $JsonFile="" 7 | ) 8 | 9 | 10 | if (([string]::IsNullOrEmpty($env:SW360HOST)) -or ([string]::IsNullOrEmpty($env:SW360APPPORT)) -or ([string]::IsNullOrEmpty($env:FOSSYHOST)) -or ([string]::IsNullOrEmpty($env:FOSSYAPPPORT))) 11 | { 12 | Write-Host "some of the parameters not set eg. sw360 host or port, fossology host or port" 13 | exit 14 | } 15 | else 16 | { 17 | $sw360urlobj = -join ("http://", "${env:SW360HOST}", ":", "${env:SW360APPPORT}") 18 | write-host "The sw360 URL is $sw360urlobj" 19 | $fossyurlobj = -join ("http://", "${env:FOSSYHOST}", ":", "${env:FOSSYAPPPORT}") 20 | write-host "The fossology URL is $fossyurlobj" 21 | $jfrogurlobj = -join ("${env:JFROGURL}") 22 | write-host "The Jfrog URL is $jfrogurlobj" 23 | } 24 | 25 | if (Test-Path "$JsonFile") 26 | { 27 | Write-Host "Modifying the settings file json: $JsonFile" 28 | $Data = Get-Content "$JsonFile" | ConvertFrom-Json 29 | $Data.FossologyURL = "$fossyurlobj" 30 | $Data.SW360URL = "$sw360urlobj" 31 | $Data.JFrogURL = "$jfrogurlobj" 32 | $Data | ConvertTo-Json -Depth 2 | Out-File $JsonFile 33 | } 34 | 35 | else 36 | { 37 | Write-Host "$JsonFile file does not exist" 38 | } 39 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/FileUpload.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// File upload Model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class FileUpload 17 | { 18 | [JsonProperty("folderid")] 19 | public string FolderId { get; set; } 20 | 21 | [JsonProperty("foldername")] 22 | public string Foldername { get; set; } 23 | 24 | [JsonProperty("id")] 25 | public string UploadId { get; set; } 26 | 27 | [JsonProperty("description")] 28 | public string Description { get; set; } 29 | 30 | [JsonProperty("uploadname")] 31 | public string UploadName { get; set; } 32 | 33 | [JsonProperty("uploaddate")] 34 | public string UploadDate { get; set; } 35 | 36 | [JsonProperty("hash")] 37 | public FileUploadHash FileUploadHash { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/LCT.APICommunications.UTest/JfrogApicommunicationUTest.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Interfaces; 8 | using LCT.APICommunications.Model; 9 | 10 | namespace LCT.APICommunications.UTest 11 | { 12 | [TestFixture] 13 | public class JfrogApicommunicationUTest 14 | { 15 | [SetUp] 16 | public void Setup() 17 | { 18 | // Method intentionally left empty. 19 | } 20 | 21 | [Test] 22 | public void JfrogApicommunication_CopyPackageFromRemoteRepo_ReturnsInvalidOperationException() 23 | { 24 | //Arrange 25 | ArtifactoryCredentials repoCredentials = new ArtifactoryCredentials(); 26 | 27 | //Act 28 | IJFrogApiCommunication jfrogApicommunication = new NugetJfrogApiCommunication("", "", repoCredentials, 100); 29 | 30 | //Assert 31 | Assert.ThrowsAsync(async () => await jfrogApicommunication.DeletePackageFromJFrogRepo("", "")); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/RuntimeInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | 9 | namespace LCT.PackageIdentifier.Model 10 | { 11 | public class RuntimeInfo 12 | { 13 | public string ProjectPath { get; set; } 14 | public string ProjectName { get; set; } 15 | public bool IsSelfContained { get; set; } 16 | public bool SelfContainedExplicitlySet { get; set; } 17 | public string SelfContainedEvaluated { get; set; } 18 | public string SelfContainedReason { get; set; } 19 | public List RuntimeIdentifiers { get; set; } = new(); 20 | public List FrameworkReferences { get; set; } = new(); 21 | public string ErrorMessage { get; set; } 22 | public string ErrorDetails { get; set; } 23 | } 24 | 25 | public class FrameworkReferenceInfo 26 | { 27 | public string TargetFramework { get; set; } 28 | public string Name { get; set; } 29 | public string TargetingPackVersion { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /DemoProject/LicenseClearingTool.bat: -------------------------------------------------------------------------------- 1 | REM SPDX-FileCopyrightText: 2024 Siemens AG 2 | REM SPDX-License-Identifier: MIT 3 | 4 | @ECHO OFF 5 | pushd %~dp0\LicenseClearingTool.7.0.0 6 | echo "Starting Package Identifier" 7 | cmd.exe /c Package Identifier.exe --packageFilePath ..\NPMProject --bomFolderPath ..\BOM --sw360Token --sW360ProjectID --sW360AuthTokenType Bearer --artifactoryuploadApiKey --projectType --JfrogApi --sw360Url 8 | 9 | echo "Finishing Package Identifier" 10 | 11 | echo "Starting SW360Package Creator" 12 | cmd.exe /c SW360PackageCreator.exe --bomFilePath ..\BOM\NPMProject_Bom.cdx.json --sw360Token --sW360ProjectID --sW360AuthTokenType Bearer --sw360Url --fossologyUrl 13 | 14 | echo "Finishing SW360Package Creator" 15 | 16 | echo "Starting Artifactory Uploader" 17 | cmd.exe /c Artifactory Uploader.exe --bomfilepath "..\BOM\NPMProject_Bom.cdx.json" --artifactoryuploaduser --artifactoryuploadapikey --jfrognpmdestreponame --JfrogApi 18 | 19 | echo "Finishing Artifactory Uploader" 20 | IF %ERRORLEVEL% NEQ 0 ( 21 | echo Error while executing LicenseClearingTool 22 | echo ERRORLEVEL: %ERRORLEVEL% 23 | echo Aborting 24 | EXIT /B %ERRORLEVEL% 25 | ) -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Sw360AllProjects.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model 11 | { 12 | /// 13 | /// The Sw360Projects class 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class Sw360AllProjects 17 | { 18 | [JsonProperty("name")] 19 | public string Name { get; set; } 20 | 21 | [JsonProperty("version")] 22 | public string Version { get; set; } 23 | 24 | [JsonProperty("tag")] 25 | public string Tag { get; set; } 26 | 27 | [JsonProperty("clearingState")] 28 | public string ClearingState { get; set; } 29 | 30 | [JsonProperty("state")] 31 | public string State { get; set; } 32 | 33 | [JsonProperty("_links")] 34 | public Links Links { get; set; } 35 | 36 | [JsonProperty("linkedReleases")] 37 | public IList LinkedReleases { get; set; } 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/LCT.Common/Model/Config.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Diagnostics.CodeAnalysis; 10 | 11 | namespace LCT.Common.Model 12 | { 13 | /// 14 | /// Config 15 | /// 16 | [ExcludeFromCodeCoverage] 17 | public class Config 18 | { 19 | public string[] Include { get; set; } 20 | public string[] Exclude { get; set; } 21 | public Artifactory Artifactory { get; set; } 22 | public string ReleaseRepo { get; set; } 23 | public string DevDepRepo { get; set; } 24 | 25 | } 26 | public class Artifactory 27 | { 28 | public List ThirdPartyRepos { get; set; } 29 | public string[] InternalRepos { get; set; } = Array.Empty(); 30 | public string[] DevRepos { get; set; } 31 | public string[] RemoteRepos { get; set; } 32 | } 33 | public class ThirdPartyRepo 34 | { 35 | public string Name { get; set; } 36 | public bool Upload { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/MultipleUploadComponentModel.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Multiple upload component model 13 | /// 14 | 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class MultipleUploadComponentModel 17 | { 18 | [JsonProperty("folderid")] 19 | public string Folderid { get; set; } 20 | 21 | [JsonProperty("foldername")] 22 | public string Foldername { get; set; } 23 | 24 | [JsonProperty("id")] 25 | public string UploadId { get; set; } 26 | 27 | [JsonProperty("description")] 28 | public string Description { get; set; } 29 | 30 | [JsonProperty("uploadname")] 31 | public string Uploadname { get; set; } 32 | 33 | [JsonProperty("uploaddate")] 34 | public string Uploaddate { get; set; } 35 | 36 | [JsonProperty("filesize")] 37 | public string Filesize { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/LCT.Common/Constants/TelemetryConstant.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | namespace LCT.Common.Constants 9 | { 10 | [ExcludeFromCodeCoverage] 11 | public static class TelemetryConstant 12 | { 13 | public const string ToolName = "CATool"; 14 | public const string PackageIdentifier = "PackageIdentifierExecution"; 15 | public const string PackageCreator = "PackageCreatorExecution"; 16 | public const string ArtifactoryUploader = "ArtifactoryUploaderExecution"; 17 | public const string IdentifierKpiData = "IdentifierKpiDataTelemetry"; 18 | public const string CreatorKpiData = "CreatorKpiDataTelemetry"; 19 | public const string ArtifactoryUploaderKpiData = "UploaderKpiDataTelemetry"; 20 | public const string Type = "ApplicationInsights"; 21 | public const string StartLogMessage = "Telemetry tracking is now active for this execution. To turn off telemetry, use the command-line option --Telemetry:Enable false or adjust the settings in your appsettings file."; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Scripts/json_update.ps1: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Siemens AG 2 | # SPDX-License-Identifier: MIT 3 | 4 | param( 5 | [Parameter(Mandatory=$true)] 6 | $JsonFile="" 7 | ) 8 | 9 | 10 | if (([string]::IsNullOrEmpty($env:SW360HOST)) -or ([string]::IsNullOrEmpty($env:SW360APPPORT)) -or ([string]::IsNullOrEmpty($env:FOSSYHOST)) -or ([string]::IsNullOrEmpty($env:FOSSYAPPPORT))) 11 | { 12 | Write-Host "some of the parameters not set eg. sw360 host or port, fossology host or port" 13 | exit 14 | } 15 | else 16 | { 17 | $sw360urlobj = -join ("http://", "${env:SW360HOST}", ":", "${env:SW360APPPORT}") 18 | write-host "The sw360 URL is $sw360urlobj" 19 | $fossyurlobj = -join ("http://", "${env:FOSSYHOST}", ":", "${env:FOSSYAPPPORT}") 20 | write-host "The fossology URL is $fossyurlobj" 21 | } 22 | 23 | if (Test-Path "$JsonFile") 24 | { 25 | Write-Host "Modifying the settings file json: $JsonFile" 26 | $Data = Get-Content "$JsonFile" | ConvertFrom-Json 27 | $Data.FossologyURL = "$fossyurlobj" 28 | $Data.SW360URL = "$sw360urlobj" 29 | $Data.ArtifactoryUploadUser = "${env:USEREMAIL}" 30 | $Data.ArtifactoryUploadApiKey = "${env:ARTIFACTORYAPIKEY}" 31 | $Data.JfrogApi = "${env:JFROGURL}" 32 | $Data.SW360AuthTokenValue = "${env:SW360AUTHKEY}" 33 | $Data | ConvertTo-Json -Depth 2 | Out-File $JsonFile 34 | } 35 | 36 | else 37 | { 38 | Write-Host "$JsonFile file does not exist" 39 | } -------------------------------------------------------------------------------- /src/LCT.Services/LCT.Services.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | net8.0 6 | 8.3.0 7 | 8 | 9 | 10 | ..\..\out 11 | 12 | 13 | 14 | ..\..\out 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/Telemetry.UTest/LCT.Telemetry.UTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | false 9 | true 10 | 11 | 12 | ..\..\out 13 | 14 | 15 | 16 | ..\..\out 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/LCT.APICommunications.UTest/LCT.APICommunications.UTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | false 9 | 10 | 11 | 12 | ..\..\out 13 | 14 | 15 | 16 | ..\..\out 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/LCT.Common.UTests/EnvironmentTypeTests.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.Common.Runtime; 8 | using NUnit.Framework; 9 | using System; 10 | 11 | namespace LCT.Common.UTest 12 | { 13 | [TestFixture] 14 | internal class EnvironmentTypeTests 15 | { 16 | [Test] 17 | public void EnumValues_ShouldMatchExpectedValues() 18 | { 19 | // Arrange 20 | var expectedValues = new[] 21 | { 22 | EnvironmentType.Unknown, 23 | EnvironmentType.GitLab, 24 | EnvironmentType.AzurePipeline, 25 | EnvironmentType.AzureRelease 26 | }; 27 | 28 | // Act 29 | var actualValues = (EnvironmentType[])Enum.GetValues(typeof(EnvironmentType)); 30 | 31 | // Assert 32 | Assert.That(actualValues.Length, Is.EqualTo(expectedValues.Length)); 33 | for (int i = 0; i < expectedValues.Length; i++) 34 | { 35 | Assert.That(actualValues[i], Is.EqualTo(expectedValues[i])); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/LCT.Common/Interface/IFolderAction.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | namespace LCT.Common.Interface 8 | { 9 | /// 10 | /// IFolderAction Interface 11 | /// 12 | public interface IFolderAction 13 | { 14 | /// 15 | /// Copies source directory content to target directory content 16 | /// 17 | /// 18 | /// 19 | /// bool 20 | public bool CopyToTargetDirectory(string sourceDirectory, string targetDirectory); 21 | 22 | /// 23 | /// Zip Files To Target Directory 24 | /// 25 | /// 26 | /// bool 27 | public bool ZipFileToTargetDirectory(string targetDirectory); 28 | 29 | /// 30 | /// Validates the given folder path 31 | /// 32 | /// 33 | public void ValidateFolderPath(string folderPath); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/LCT.Services/Interface/ISW360Service.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Model; 8 | using LCT.APICommunications.Model.Foss; 9 | using LCT.Common.Model; 10 | using System.Collections.Generic; 11 | using System.Net.Http; 12 | using System.Threading.Tasks; 13 | 14 | namespace LCT.Services.Interface 15 | { 16 | /// 17 | /// ISW360Service interface 18 | /// 19 | public interface ISW360Service 20 | { 21 | Task GetComponentReleaseID(string componentName, string version); 22 | 23 | Task GetReleaseInfoByReleaseId(string releaseLink); 24 | 25 | Task GetReleaseDataOfComponent(string releaseLink); 26 | 27 | Task> GetAvailableReleasesInSw360(List listOfComponentsToBom); 28 | 29 | Task GetAttachmentDownloadLink(string releaseAttachmentUrl); 30 | 31 | Task GetUploadDescriptionfromSW360(string componentName, string componetVersion, string sw360url); 32 | List GetDuplicateComponentsByPurlId(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/SBOMTemplates/SBOM_MavenCATemplate.cdx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", 3 | "bomFormat": "CycloneDX", 4 | "specVersion": "1.4", 5 | "serialNumber": "urn:uuid:43858d10-328d-40d3-8184-ad4f0b5ea53c", 6 | "version": 1, 7 | "metadata": { 8 | "timestamp": "2023-07-11T12:11:14Z", 9 | "tools": [ 10 | { 11 | "vendor": "anchore", 12 | "name": "syft", 13 | "version": "0.84.1" 14 | } 15 | ], 16 | "component": { 17 | "bom-ref": "f8e285590963f51a", 18 | "type": "container", 19 | "name": "/mnt/InputImages/Buster_amd64.tar", 20 | "version": "sha256:b75774030c2c10178aad29230221cad47aa607c72895aa4af389b3f1f01f71f4" 21 | } 22 | }, 23 | "components": [ 24 | { 25 | "bom-ref": "pkg:maven/com.rabbitmq/amqp-client@5.14.2?package-id=986803b204fb27b1", 26 | "type": "library", 27 | "group": "com.rabbitmq", 28 | "name": "amqp-client", 29 | "version": "5.14.2", 30 | "cpe": "cpe:2.3:a:amqp-client:amqp-client:5.14.2:*:*:*:*:*:*:*", 31 | "purl": "pkg:maven/com.rabbitmq/amqp-client@5.14.2", 32 | "properties": [ 33 | { 34 | "name": "syft:metadata:virtualPath", 35 | "value": "sams-infrastructure/keycloak/plugins/event-listeners/keycloak-to-rabbit-3.0.2.jar:amqp-client" 36 | } 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Model/ComponentsInfo.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Diagnostics.CodeAnalysis; 9 | 10 | namespace LCT.PackageIdentifier.Model 11 | { 12 | /// 13 | /// CycloneDX Component Information 14 | /// 15 | [ExcludeFromCodeCoverage] 16 | internal class ComponentsInfo 17 | { 18 | [JsonProperty("type")] 19 | public string Type { get; set; } 20 | 21 | [JsonProperty("publisher")] 22 | public string Publisher { get; set; } 23 | 24 | [JsonProperty("name")] 25 | public string Name { get; set; } 26 | 27 | [JsonProperty("version")] 28 | public string Version { get; set; } 29 | 30 | [JsonProperty("scope")] 31 | public string Scope { get; set; } 32 | 33 | [JsonProperty("purl")] 34 | public string ReleaseExternalId { get; set; } 35 | public string ComponentExternalId { get; set; } 36 | public string PackageUrl { get; set; } 37 | public string SourceUrl { get; set; } 38 | public string DownloadUrl { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/AQL/AqlResult.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | using System.Collections.Generic; 9 | 10 | namespace LCT.APICommunications.Model.AQL 11 | { 12 | /// 13 | /// The AqlResult model 14 | /// 15 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | public class AqlResult 17 | { 18 | [JsonProperty("repo")] 19 | public string Repo { get; set; } 20 | 21 | [JsonProperty("path")] 22 | public string Path { get; set; } 23 | 24 | [JsonProperty("name")] 25 | public string Name { get; set; } 26 | 27 | [JsonProperty("actual_md5")] 28 | public string MD5 { get; set; } 29 | 30 | [JsonProperty("actual_sha1")] 31 | public string SHA1 { get; set; } 32 | 33 | [JsonProperty("sha256")] 34 | public string SHA256 { get; set; } 35 | 36 | public List Properties { get; set; } 37 | 38 | } 39 | public class AqlProperty 40 | { 41 | public string Key { get; set; } 42 | public string Value { get; set; } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/SBOMTemplates/SBOM_ConanCATemplate.cdx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", 3 | "bomFormat": "CycloneDX", 4 | "specVersion": "1.4", 5 | "serialNumber": "urn:uuid:43858d10-328d-40d3-8184-ad4f0b5ea53c", 6 | "version": 1, 7 | "metadata": { 8 | "timestamp": "2023-07-11T12:11:14Z", 9 | "tools": [ 10 | { 11 | "vendor": "anchore", 12 | "name": "syft", 13 | "version": "0.84.1" 14 | } 15 | ], 16 | "component": { 17 | "bom-ref": "f8e285590963f51a", 18 | "type": "container", 19 | "name": "/mnt/InputImages/Buster_amd64.tar", 20 | "version": "sha256:b75774030c2c10178aad29230221cad47aa607c72895aa4af389b3f1f01f71f4" 21 | } 22 | }, 23 | "components": [ 24 | { 25 | "bom-ref": "pkg:conan/protobuf@3.21.9", 26 | "type": "library", 27 | "publisher": "LaMont Jones ", 28 | "name": "protobuf", 29 | "version": "3.21.9", 30 | "licenses": [ 31 | { 32 | "license": { 33 | "id": "Testing License" 34 | } 35 | } 36 | ], 37 | "cpe": "cpe:2.3:a:libblkid1:libblkid1:2.33.1-0.1:*:*:*:*:*:*:*", 38 | "purl": "pkg:conan/protobuf@3.21.9", 39 | "properties": [ 40 | { 41 | "name": "syft:package:foundBy", 42 | "value": "Testing Properties" 43 | } 44 | ] 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier/Interface/IBomHelper.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using CycloneDX.Models; 8 | using LCT.APICommunications.Model.AQL; 9 | using LCT.PackageIdentifier.Model; 10 | using LCT.Services.Interface; 11 | using System.Collections.Generic; 12 | using System.Threading.Tasks; 13 | 14 | namespace LCT.PackageIdentifier.Interface 15 | { 16 | /// 17 | /// BOM helper interface 18 | /// 19 | public interface IBomHelper 20 | { 21 | public void WriteBomKpiDataToConsole(BomKpiData bomKpiData); 22 | public string GetProjectSummaryLink(string projectId, string sw360Url); 23 | public string GetFullNameOfComponent(Component item); 24 | public Task> GetListOfComponentsFromRepo(string[] repoList, IJFrogService jFrogService); 25 | public Task> GetNpmListOfComponentsFromRepo(string[] repoList, IJFrogService jFrogService); 26 | public Task> GetPypiListOfComponentsFromRepo(string[] repoList, IJFrogService jFrogService); 27 | public Task> GetCargoListOfComponentsFromRepo(string[] repoList, IJFrogService jFrogService); 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LCT.SW360PackageCreator/Model/ConanSources.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using System.Collections.Generic; 8 | using System.Diagnostics.CodeAnalysis; 9 | using YamlDotNet.Serialization; 10 | 11 | namespace LCT.SW360PackageCreator.Model 12 | { 13 | [ExcludeFromCodeCoverage] 14 | public class Sources 15 | { 16 | [YamlMember(Alias = "sources")] 17 | public Dictionary SourcesData { get; set; } 18 | [YamlMember(Alias = "patches")] 19 | public Dictionary> Patches { get; set; } 20 | } 21 | 22 | [ExcludeFromCodeCoverage] 23 | public class Source 24 | { 25 | [YamlMember(Alias = "url")] 26 | public object Url { get; set; } 27 | [YamlMember(Alias = "sha256")] 28 | public string Sha256 { get; set; } 29 | 30 | 31 | } 32 | 33 | [ExcludeFromCodeCoverage] 34 | public class Patch 35 | { 36 | public string PatchFile { get; set; } 37 | public string PatchDescription { get; set; } 38 | public string PatchType { get; set; } 39 | public string PatchSource { get; set; } 40 | public string Sha256 { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/SBOMTemplates/SBOM_NpmCATemplate.cdx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", 3 | "bomFormat": "CycloneDX", 4 | "specVersion": "1.4", 5 | "serialNumber": "urn:uuid:43858d10-328d-40d3-8184-ad4f0b5ea53c", 6 | "version": 1, 7 | "metadata": { 8 | "timestamp": "2023-07-11T12:11:14Z", 9 | "tools": [ 10 | { 11 | "vendor": "anchore", 12 | "name": "syft", 13 | "version": "0.84.1" 14 | } 15 | ], 16 | "component": { 17 | "bom-ref": "f8e285590963f51a", 18 | "type": "container", 19 | "name": "/mnt/InputImages/Buster_amd64.tar", 20 | "version": "sha256:b75774030c2c10178aad29230221cad47aa607c72895aa4af389b3f1f01f71f4" 21 | } 22 | }, 23 | "components": [ 24 | { 25 | "bom-ref": "pkg:npm/raw-loader@4.0.0?arch=source", 26 | "type": "library", 27 | "publisher": "LaMont Jones ", 28 | "name": "raw-loader", 29 | "version": "4.0.0", 30 | "licenses": [ 31 | { 32 | "license": { 33 | "id": "Testing License" 34 | } 35 | } 36 | ], 37 | "cpe": "cpe:2.3:a:libblkid1:libblkid1:2.33.1-0.1:*:*:*:*:*:*:*", 38 | "purl": "pkg:npm/raw-loader@4.0.0?arch=source", 39 | "properties": [ 40 | { 41 | "name": "syft:package:foundBy", 42 | "value": "Testing Properties" 43 | } 44 | ] 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /doc/UsageDoc/CLIUsageNpkg.txt: -------------------------------------------------------------------------------- 1 | Usage: 2 | [flags] 3 | [command] 4 | 5 | Examples for Nuget Package: 6 | PackageIdentifier.exe --settingsfilepath /CAToolConfigPath/appSettings.json Creates Bom file by identifying packages in input 7 | 8 | Available Commands: 9 | PackageIdentifier.exe --settingsfilepath /CAToolConfigPath/appSettings.json Creates Bom file by identifying packages in input 10 | SW360PackageCreator.exe --settingsfilepath /CAToolConfigPath/appSettings.json Creates Components and Release in SW360 11 | ArtifactoryUploader.exe --settingsfilepath /CAToolConfigPath/appSettings.json Uploads source package to JFrog Artifactory 12 | 13 | Examples for Docker Image: 14 | dotnet PackageIdentifier.dll --settingsfilepath /etc/CATool/appSettings.json Creates Bom file by identifying packages in input 15 | 16 | Available Commands: 17 | dotnet PackageIdentifier.dll --settingsfilepath /etc/CATool/appSettings.json Creates Bom file by identifying packages in input 18 | dotnet SW360PackageCreator.dll --settingsfilepath /etc/CATool/appSettings.json Creates Components and Release in SW360 19 | dotnet ArtifactoryUploader.dll --settingsfilepath /etc/CATool/appSettings.json Uploads source package to JFrog Artifactory 20 | 21 | Flags: 22 | --settingsfilepath Path of application config file 23 | 24 | 25 | For more examples refer the Clearing Automation Usage Document. 26 | -------------------------------------------------------------------------------- /src/ArtifactoryUploader/ArtifactoryValidator.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | //--------------------------------------------------------------------------------------------------------------------- 6 | 7 | using LCT.APICommunications.Interfaces; 8 | using LCT.Common; 9 | using System.Net.Http; 10 | using System.Threading.Tasks; 11 | 12 | namespace LCT.ArtifactoryUploader 13 | { 14 | public class ArtifactoryValidator 15 | { 16 | private readonly IJfrogAqlApiCommunication _JfrogAqlApiCommunication; 17 | 18 | public ArtifactoryValidator(IJfrogAqlApiCommunication jfrogAqlApiCommunication) 19 | { 20 | _JfrogAqlApiCommunication = jfrogAqlApiCommunication; 21 | } 22 | 23 | public async Task ValidateArtifactoryCredentials() 24 | { 25 | HttpResponseMessage responseMessage = new HttpResponseMessage(); 26 | try 27 | { 28 | responseMessage = await _JfrogAqlApiCommunication.CheckConnection(); 29 | responseMessage.EnsureSuccessStatusCode(); 30 | return 0; 31 | } 32 | catch (HttpRequestException ex) 33 | { 34 | ExceptionHandling.HttpException(ex, responseMessage, "Artifactory"); 35 | return -1; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Scripts/Create_Nuget_Config.ps1: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Siemens AG 2 | # SPDX-License-Identifier: MIT 3 | 4 | param( 5 | $energydevnuget="xyz", 6 | $energydevnugetegll="xyz") 7 | 8 | $nugetconfig = "$PSScriptRoot\..\nuget.config" 9 | 10 | Write-Host "Remove existing Nuget Config if any" 11 | if (Test-Path "$nugetconfig") 12 | { 13 | Remove-Item "$nugetconfig" -Force 14 | } 15 | 16 | New-Item -ItemType File -Force -Path "$nugetconfig" 17 | 18 | Write-Host "The energy dev nuget URL is : $energydevnuget" 19 | Write-Host "The energy dev nuget egll URL is : $energydevnugetegll" 20 | 21 | Write-Host "Write base config" 22 | 23 | $xmlBase = @' 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | '@ 32 | 33 | $xmltemp = ($xmlBase.Replace('$energydevnuget', "$energydevnuget")).Replace('$egllenergydevnuget', "$energydevnugetegll") 34 | #$xmlBase.Replace('$egllenergydevnuget', "$egllenergydevnuget") 35 | Set-Content -Path "$nugetconfig" -Value $xmltemp 36 | 37 | <# 38 | $tempXMLcont = Get-Content "$nugetconfig" 39 | $tempXMLcont.replace('$energydevnuget',"$energydevnuget") | set-content "$nugetconfig" -force 40 | 41 | $tempXMLcont = Get-Content "$nugetconfig" 42 | $tempXMLcont.replace('$egllenergydevnuget',"$energydevnugetegll") | set-content "$nugetconfig" -force #> 43 | -------------------------------------------------------------------------------- /TestFiles/IntegrationTestFiles/SystemTest2ndIterationData/Npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clearingtest", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/common": "~9.1.0", 15 | "@angular/compiler": "~10.1.0", 16 | "@angular/core": "~9.1.0", 17 | "@angular/forms": "~9.1.0", 18 | "@angular/platform-browser": "~9.1.0", 19 | "@angular/platform-browser-dynamic": "~9.1.0", 20 | "@angular/router": "~9.1.0", 21 | "axios": "0.19.0", 22 | "rxjs": "~6.5.4", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.10.2" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.901.0", 28 | "@angular/cli": "~9.1.0", 29 | "@angular/compiler-cli": "~9.1.0", 30 | "@angular/language-service": "~9.1.0", 31 | "@types/node": "^12.11.1", 32 | "@types/jasmine": "~3.5.0", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.1.2", 35 | "jasmine-core": "~3.5.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.4.1", 38 | "karma-chrome-launcher": "~3.1.0", 39 | "karma-coverage-istanbul-reporter": "~2.1.0", 40 | "karma-jasmine": "~3.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.2", 42 | "protractor": "~5.4.3", 43 | "ts-node": "~8.3.0", 44 | "tslint": "~6.1.0", 45 | "typescript": "~3.8.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /TestFiles/IntegrationTestFiles/SystemTest1stIterationData/Npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clearingtest", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~9.1.0", 15 | "@angular/common": "~9.1.0", 16 | "@angular/compiler": "~9.1.0", 17 | "@angular/core": "~9.1.0", 18 | "@angular/forms": "~9.1.0", 19 | "@angular/platform-browser": "~9.1.0", 20 | "@angular/platform-browser-dynamic": "~9.1.0", 21 | "@angular/router": "~9.1.0", 22 | "rxjs": "~6.5.4", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.10.2" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.901.0", 28 | "@angular/cli": "~9.1.0", 29 | "@angular/compiler-cli": "~9.1.0", 30 | "@angular/language-service": "~9.1.0", 31 | "@types/node": "^12.11.1", 32 | "@types/jasmine": "~3.5.0", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.1.2", 35 | "jasmine-core": "~3.5.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.4.1", 38 | "karma-chrome-launcher": "~3.1.0", 39 | "karma-coverage-istanbul-reporter": "~2.1.0", 40 | "karma-jasmine": "~3.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.2", 42 | "protractor": "~5.4.3", 43 | "ts-node": "~8.3.0", 44 | "tslint": "~6.1.0", 45 | "typescript": "~3.8.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Releases.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model 10 | { 11 | /// 12 | /// Releases model 13 | /// 14 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | public class Releases 16 | { 17 | [JsonProperty("name")] 18 | public string Name { get; set; } 19 | 20 | [JsonProperty("version")] 21 | public string Version { get; set; } 22 | 23 | [JsonProperty("componentId")] 24 | public string ComponentId { get; set; } 25 | 26 | [JsonProperty("sourceCodeDownloadurl")] 27 | public string SourceDownloadurl { get; set; } 28 | 29 | [JsonProperty("binaryDownloadurl")] 30 | public string BinaryDownloadUrl { get; set; } 31 | 32 | [JsonProperty("createdOn")] 33 | public string CreatedOn { get; set; } 34 | 35 | [JsonProperty("clearingState")] 36 | public string ClearingState { get; set; } 37 | 38 | [JsonProperty("_links")] 39 | public Links Links { get; set; } 40 | 41 | [JsonProperty("externalIds")] 42 | public ExternalIds ExternalIds { get; set; } 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/TestDir/DupDir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clearingtest", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/common": "~9.1.0", 15 | "@angular/compiler": "~9.1.0", 16 | "@angular/core": "~9.1.0", 17 | "@angular/forms": "~9.1.0", 18 | "@angular/platform-browser": "~9.1.0", 19 | "@angular/platform-browser-dynamic": "~9.1.0", 20 | "@angular/router": "~9.1.0", 21 | "axios": "0.19.0", 22 | "rxjs": "~6.5.4", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.10.2" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.901.0", 28 | "@angular/cli": "~9.1.0", 29 | "@angular/compiler-cli": "~9.1.0", 30 | "@angular/language-service": "~9.1.0", 31 | "@types/node": "^12.11.1", 32 | "@types/jasmine": "~3.5.0", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.1.2", 35 | "jasmine-core": "~3.5.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.4.1", 38 | "karma-chrome-launcher": "~3.1.0", 39 | "karma-coverage-istanbul-reporter": "~2.1.0", 40 | "karma-jasmine": "~3.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.2", 42 | "protractor": "~5.4.3", 43 | "ts-node": "~8.3.0", 44 | "tslint": "~6.1.0", 45 | "typescript": "~3.8.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/TestDir/SubDir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clearingtest", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/common": "~9.1.0", 15 | "@angular/compiler": "~9.1.0", 16 | "@angular/core": "~9.1.0", 17 | "@angular/forms": "~9.1.0", 18 | "@angular/platform-browser": "~9.1.0", 19 | "@angular/platform-browser-dynamic": "~9.1.0", 20 | "@angular/router": "~9.1.0", 21 | "axios": "0.19.0", 22 | "rxjs": "~6.5.4", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.10.2" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.901.0", 28 | "@angular/cli": "~9.1.0", 29 | "@angular/compiler-cli": "~9.1.0", 30 | "@angular/language-service": "~9.1.0", 31 | "@types/node": "^12.11.1", 32 | "@types/jasmine": "~3.5.0", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.1.2", 35 | "jasmine-core": "~3.5.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.4.1", 38 | "karma-chrome-launcher": "~3.1.0", 39 | "karma-coverage-istanbul-reporter": "~2.1.0", 40 | "karma-jasmine": "~3.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.2", 42 | "protractor": "~5.4.3", 43 | "ts-node": "~8.3.0", 44 | "tslint": "~6.1.0", 45 | "typescript": "~3.8.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/LCT.Facade.UTest/LCT.Facade.UTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | 7 | 8 | 9 | ..\..\out 10 | 11 | 12 | 13 | ..\..\out 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | all 22 | runtime; build; native; contentfiles; analyzers; buildtransitive 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/LCT.PackageIdentifier.UTest/PackageIdentifierUTTestFiles/TestDir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clearingtest", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~9.1.0", 15 | "@angular/common": "~9.1.0", 16 | "@angular/compiler": "~9.1.0", 17 | "@angular/core": "~9.1.0", 18 | "@angular/forms": "~9.1.0", 19 | "@angular/platform-browser": "~9.1.0", 20 | "@angular/platform-browser-dynamic": "~9.1.0", 21 | "@angular/router": "~9.1.0", 22 | "rxjs": "~6.5.4", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.10.2" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.901.0", 28 | "@angular/cli": "~9.1.0", 29 | "@angular/compiler-cli": "~9.1.0", 30 | "@angular/language-service": "~9.1.0", 31 | "@types/node": "^12.11.1", 32 | "@types/jasmine": "~3.5.0", 33 | "@types/jasminewd2": "~2.0.3", 34 | "codelyzer": "^5.1.2", 35 | "jasmine-core": "~3.5.0", 36 | "jasmine-spec-reporter": "~4.2.1", 37 | "karma": "~4.4.1", 38 | "karma-chrome-launcher": "~3.1.0", 39 | "karma-coverage-istanbul-reporter": "~2.1.0", 40 | "karma-jasmine": "~3.0.1", 41 | "karma-jasmine-html-reporter": "^1.4.2", 42 | "protractor": "~5.4.3", 43 | "ts-node": "~8.3.0", 44 | "tslint": "~6.1.0", 45 | "typescript": "~3.8.3" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/LCT.APICommunications/Model/Foss/Analysis.cs: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------------------------------------- 2 | // SPDX-FileCopyrightText: 2025 Siemens AG 3 | // 4 | // SPDX-License-Identifier: MIT 5 | // -------------------------------------------------------------------------------------------------------------------- 6 | 7 | using Newtonsoft.Json; 8 | 9 | namespace LCT.APICommunications.Model.Foss 10 | { 11 | /// 12 | /// Fossology Analyzer model 13 | /// 14 | /// 15 | 16 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public class Analysis 18 | { 19 | [JsonProperty("bucket")] 20 | public bool Bucket { get; set; } 21 | 22 | [JsonProperty("copyright_email_author")] 23 | public bool Copyright_email_author { get; set; } 24 | 25 | [JsonProperty("ecc")] 26 | public bool Ecc { get; set; } 27 | 28 | [JsonProperty("keyword")] 29 | public bool Keyword { get; set; } 30 | 31 | [JsonProperty("mime")] 32 | public bool Mime { get; set; } 33 | 34 | [JsonProperty("monk")] 35 | public bool Monk { get; set; } 36 | 37 | [JsonProperty("nomos")] 38 | public bool Nomos { get; set; } 39 | 40 | [JsonProperty("ojo")] 41 | public bool Ojo { get; set; } 42 | 43 | [JsonProperty("package")] 44 | public bool Package { get; set; } 45 | 46 | public Analysis() 47 | { 48 | 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/LCT.Common.UTests/LCT.Common.UTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 6 | false 7 | 8 | 9 | 10 | ..\..\out 11 | 12 | 13 | 14 | ..\..\out 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | --------------------------------------------------------------------------------