From 5347d8fc83ee5daf6e6f340fd4b2cea1aedb3fb5 Mon Sep 17 00:00:00 2001 From: sumanthkb44 <84563853+sumanthkb44@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:27:12 +0530 Subject: [PATCH 1/4] JFrog Ref token validation (#120) * Update ArtifactoryValidator.cs * Adding System.Net reference --------- Co-authored-by: Aditya Narayan --- .../ArtifactoryValidator.cs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ArtifactoryUploader/ArtifactoryValidator.cs b/src/ArtifactoryUploader/ArtifactoryValidator.cs index 11af4690..b0027997 100644 --- a/src/ArtifactoryUploader/ArtifactoryValidator.cs +++ b/src/ArtifactoryUploader/ArtifactoryValidator.cs @@ -13,6 +13,7 @@ using System.Net.Http; using System.Reflection; using System.Threading.Tasks; +using System.Net; namespace LCT.ArtifactoryUploader { @@ -27,18 +28,15 @@ public ArtifactoryValidator(NpmJfrogApiCommunication jfrogApiCommunication) JfrogApiCommunication = jfrogApiCommunication; } - public async Task ValidateArtifactoryCredentials(CommonAppSettings appSettings) - { - HttpResponseMessage responseMessage = await JfrogApiCommunication.GetApiKey(); - string response = await responseMessage.Content.ReadAsStringAsync(); - JfrogKey apiKey = JsonConvert.DeserializeObject(response); + public async Task ValidateArtifactoryCredentials(CommonAppSettings appSettings) + { + HttpResponseMessage responseMessage = await JfrogApiCommunication.GetApiKey(); - bool isValid = apiKey.ApiKey == appSettings.ArtifactoryUploadApiKey; - if (!isValid) - { - Logger.Error("Artifactory Token entered is invalid!"); - throw new InvalidDataException($"Invalid Artifactory Token"); - } + if (responseMessage.StatusCode != HttpStatusCode.OK) + { + Logger.Error("Artifactory Token entered is invalid!"); + throw new InvalidDataException($"Invalid Artifactory Token"); + } } } } From f416f68e8fbca0970d53c05a5eed3ac381cde964 Mon Sep 17 00:00:00 2001 From: sumanthkb44 <84563853+sumanthkb44@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:29:31 +0530 Subject: [PATCH 2/4] Update compile.yml --- .github/workflows/compile.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 07a109bd..31222545 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -95,7 +95,7 @@ jobs: $sourceFolder = Join-Path $env:GITHUB_WORKSPACE "out" | Join-Path -ChildPath "*" $outFolder = Join-Path $env:GITHUB_WORKSPACE "out" | Join-Path -ChildPath "continuous-clearing" New-Item -ItemType Directory -Force -Path $outFolder - $fileName = "continuous-clearing-v6.0.1.zip" + $fileName = "continuous-clearing-v6.0.2.zip" Write-Host "Filename: '$fileName'" Write-Host "sourceFolder: '$sourceFolder'" Write-Host "Outfolder: '$outFolder'" @@ -139,8 +139,8 @@ jobs: - name: Create Nuget Packages id: createNupkg run: | - nuget pack CA.nuspec -Version 6.0.1 - Write-Host "::set-output name=nupkg-LicenseClearingTool::continuous-clearing.6.0.1.nupkg" + nuget pack CA.nuspec -Version 6.0.2 + Write-Host "::set-output name=nupkg-LicenseClearingTool::continuous-clearing.6.0.2.nupkg" - name: Archive NuGet Packages uses: actions/upload-artifact@v2 @@ -153,9 +153,9 @@ jobs: id: builddocker #if: ${{ false }} # disable for now run: | - docker build . --file Dockerfile --tag ${{ github.repository }}:continuous-clearing-v6.0.1 - docker save ${{ github.repository }}:continuous-clearing-v6.0.1 -o continuous-clearing-v6.0.1.tar - Write-Host "::set-output name=docker-LicenseClearingTool::continuous-clearing-v6.0.1.tar" + docker build . --file Dockerfile --tag ${{ github.repository }}:continuous-clearing-v6.0.2 + docker save ${{ github.repository }}:continuous-clearing-v6.0.2 -o continuous-clearing-v6.0.2.tar + Write-Host "::set-output name=docker-LicenseClearingTool::continuous-clearing-v6.0.2.tar" - name: Archive docker image #if: ${{ false }} # disable for now @@ -196,8 +196,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v6.0.1 - release_name: Release v6.0.1 + tag_name: v6.0.2 + release_name: Release v6.0.2 body: | ${{ github.event.head_commit.message }} draft: true From 729951e2a8371049c8e5922c252bc496a888f01b Mon Sep 17 00:00:00 2001 From: sumanthkb44 <84563853+sumanthkb44@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:26:10 +0530 Subject: [PATCH 3/4] Update appSettings.json --- src/LCT.Common/appSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LCT.Common/appSettings.json b/src/LCT.Common/appSettings.json index 19d7ad22..e4bdde8d 100644 --- a/src/LCT.Common/appSettings.json +++ b/src/LCT.Common/appSettings.json @@ -5,7 +5,7 @@ // -------------------------------------------------------------------------------------------------------------------- { - "CaVersion": "6.0.1", + "CaVersion": "6.0.2", "TimeOut": 200, "ProjectType": "", "SW360ProjectName": "", From a326d0df8ab5dbd49d90506222f6581bdd2df553 Mon Sep 17 00:00:00 2001 From: sumanthkb44 <84563853+sumanthkb44@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:26:27 +0530 Subject: [PATCH 4/4] Update CA.nuspec --- CA.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CA.nuspec b/CA.nuspec index 453956ce..a2ef50a7 100644 --- a/CA.nuspec +++ b/CA.nuspec @@ -4,7 +4,7 @@ continuous-clearing - 6.0.1 + 6.0.2 Siemens AG continuous-clearing contributors https://github.com/siemens/continuous-clearing