From d2947ae33595ee0b1980d8337374c6d3f6410e3e Mon Sep 17 00:00:00 2001 From: PT-ATA No One Date: Wed, 13 Mar 2024 17:02:47 +0100 Subject: [PATCH 1/9] fixes the casing for detections and mime-types --- dotnet/Vaas/src/Vaas/Messages/Detection.cs | 6 +++--- dotnet/Vaas/src/Vaas/Messages/LibMagic.cs | 6 +++--- .../Vaas/src/Vaas/Messages/VerdictResponse.cs | 8 ++++---- golang/vaas/pkg/messages/detection.go | 2 +- golang/vaas/pkg/messages/lib_magic.go | 4 ++-- golang/vaas/pkg/messages/verdict_response.go | 2 +- .../java/de/gdata/vaas/messages/Detection.java | 5 ++++- .../java/de/gdata/vaas/messages/LibMagic.java | 6 +++++- .../gdata/vaas/messages/VerdictResponse.java | 2 +- php/src/vaas/Message/Detection.php | 2 +- php/src/vaas/Message/LibMagic.php | 4 ++-- php/src/vaas/Message/VaasVerdict.php | 2 +- php/src/vaas/Message/VerdictResponse.php | 2 +- php/tests/vaas/VaasTest.php | 4 ++-- typescript/src/Vaas.ts | 6 +++--- typescript/src/messages/detection.ts | 4 ++-- typescript/src/messages/lib_magic.ts | 6 +++--- typescript/src/messages/verdict_response.ts | 2 +- typescript/tests/test.ts | 18 +++++++++--------- 19 files changed, 49 insertions(+), 42 deletions(-) diff --git a/dotnet/Vaas/src/Vaas/Messages/Detection.cs b/dotnet/Vaas/src/Vaas/Messages/Detection.cs index bf3ae184..2c45f5c2 100644 --- a/dotnet/Vaas/src/Vaas/Messages/Detection.cs +++ b/dotnet/Vaas/src/Vaas/Messages/Detection.cs @@ -6,10 +6,10 @@ public class Detection { [JsonPropertyName("engine")] public int? Engine { get; init; } - - [JsonPropertyName("fileName")] + + [JsonPropertyName("file_name")] public string FileName { get; init; } - + [JsonPropertyName("virus")] public string Virus { get; init; } } \ No newline at end of file diff --git a/dotnet/Vaas/src/Vaas/Messages/LibMagic.cs b/dotnet/Vaas/src/Vaas/Messages/LibMagic.cs index 42c29583..aba3bd7e 100644 --- a/dotnet/Vaas/src/Vaas/Messages/LibMagic.cs +++ b/dotnet/Vaas/src/Vaas/Messages/LibMagic.cs @@ -4,9 +4,9 @@ namespace Vaas.Messages; public class LibMagic { - [JsonPropertyName("fileType")] + [JsonPropertyName("file_type")] public string FileType { get; init; } - - [JsonPropertyName("mimeType")] + + [JsonPropertyName("mime_type")] public string MimeType { get; init; } } \ No newline at end of file diff --git a/dotnet/Vaas/src/Vaas/Messages/VerdictResponse.cs b/dotnet/Vaas/src/Vaas/Messages/VerdictResponse.cs index 6e0cd4d0..04dee71f 100644 --- a/dotnet/Vaas/src/Vaas/Messages/VerdictResponse.cs +++ b/dotnet/Vaas/src/Vaas/Messages/VerdictResponse.cs @@ -14,7 +14,7 @@ public VerdictResponse(string sha256, Verdict verdict) Sha256 = sha256; Verdict = verdict; } - + [JsonPropertyName("kind")] public string Kind { get; init; } = "VerdictResponse"; @@ -33,11 +33,11 @@ public VerdictResponse(string sha256, Verdict verdict) [JsonPropertyName("upload_token")] public string? UploadToken { get; init; } - + [JsonPropertyName("detections")] public List? Detections { get; init; } - - [JsonPropertyName("libMagic")] + + [JsonPropertyName("lib_magic")] public LibMagic? LibMagic { get; init; } [MemberNotNullWhen(true, nameof(Sha256), nameof(Guid))] diff --git a/golang/vaas/pkg/messages/detection.go b/golang/vaas/pkg/messages/detection.go index bbf8f461..41a2d532 100644 --- a/golang/vaas/pkg/messages/detection.go +++ b/golang/vaas/pkg/messages/detection.go @@ -4,6 +4,6 @@ package messages // TokenResponse represents a response containing an access token. type Detection struct { Engine int `json:"engine"` - FileName string `json:"fileName"` + FileName string `json:"file_name"` Virus string `json:"virus"` } diff --git a/golang/vaas/pkg/messages/lib_magic.go b/golang/vaas/pkg/messages/lib_magic.go index 1ca94454..7704c62d 100644 --- a/golang/vaas/pkg/messages/lib_magic.go +++ b/golang/vaas/pkg/messages/lib_magic.go @@ -3,6 +3,6 @@ package messages // TokenResponse represents a response containing an access token. type LibMagic struct { - FileType string `json:"fileType"` - MimeType string `json:"mimeType"` + FileType string `json:"file_type"` + MimeType string `json:"mime_type"` } diff --git a/golang/vaas/pkg/messages/verdict_response.go b/golang/vaas/pkg/messages/verdict_response.go index eda72965..863d71e6 100644 --- a/golang/vaas/pkg/messages/verdict_response.go +++ b/golang/vaas/pkg/messages/verdict_response.go @@ -10,7 +10,7 @@ type VerdictResponse struct { URL string `json:"url"` UploadToken string `json:"upload_token"` Detections []Detection `json:"detections"` - LibMagic LibMagic `json:"libMagic"` + LibMagic LibMagic `json:"lib_magic"` } // IsValid checks if the VerdictResponse is valid. diff --git a/java/src/main/java/de/gdata/vaas/messages/Detection.java b/java/src/main/java/de/gdata/vaas/messages/Detection.java index 87e9ca82..6fe96af5 100644 --- a/java/src/main/java/de/gdata/vaas/messages/Detection.java +++ b/java/src/main/java/de/gdata/vaas/messages/Detection.java @@ -1,5 +1,7 @@ package de.gdata.vaas.messages; +import com.google.gson.annotations.SerializedName; + import lombok.Getter; import lombok.NonNull; @@ -8,8 +10,9 @@ public class Detection { int engine; @NonNull + @SerializedName("file_name") String fileName; - + @NonNull String virus; } diff --git a/java/src/main/java/de/gdata/vaas/messages/LibMagic.java b/java/src/main/java/de/gdata/vaas/messages/LibMagic.java index 9a0b6a31..5b594b1f 100644 --- a/java/src/main/java/de/gdata/vaas/messages/LibMagic.java +++ b/java/src/main/java/de/gdata/vaas/messages/LibMagic.java @@ -1,13 +1,17 @@ package de.gdata.vaas.messages; +import com.google.gson.annotations.SerializedName; + import lombok.Getter; import lombok.NonNull; @Getter public class LibMagic { @NonNull + @SerializedName("file_type") String fileType; - + @NonNull + @SerializedName("mime_type") String mimeType; } diff --git a/java/src/main/java/de/gdata/vaas/messages/VerdictResponse.java b/java/src/main/java/de/gdata/vaas/messages/VerdictResponse.java index 197021b3..8b728238 100644 --- a/java/src/main/java/de/gdata/vaas/messages/VerdictResponse.java +++ b/java/src/main/java/de/gdata/vaas/messages/VerdictResponse.java @@ -30,7 +30,7 @@ public class VerdictResponse extends MessageType { @SerializedName("detections") ArrayList detections; @Getter - @SerializedName("libMagic") + @SerializedName("lib_magic") LibMagic libMagic; private VerdictResponse() { diff --git a/php/src/vaas/Message/Detection.php b/php/src/vaas/Message/Detection.php index c275574f..d6f435d6 100644 --- a/php/src/vaas/Message/Detection.php +++ b/php/src/vaas/Message/Detection.php @@ -5,6 +5,6 @@ class Detection { public ?int $engine; - public string $fileName; + public string $file_name; public string $virus; } diff --git a/php/src/vaas/Message/LibMagic.php b/php/src/vaas/Message/LibMagic.php index e09509f0..2cad3c9f 100644 --- a/php/src/vaas/Message/LibMagic.php +++ b/php/src/vaas/Message/LibMagic.php @@ -4,6 +4,6 @@ class LibMagic { - public string $fileType; - public string $mimeType; + public string $file_type; + public string $mime_type; } diff --git a/php/src/vaas/Message/VaasVerdict.php b/php/src/vaas/Message/VaasVerdict.php index 68bdb945..d2b22873 100644 --- a/php/src/vaas/Message/VaasVerdict.php +++ b/php/src/vaas/Message/VaasVerdict.php @@ -9,7 +9,7 @@ public function __construct(VerdictResponse $verdictResponse) $this->Sha256 = $verdictResponse->sha256 ?? ""; $this->Verdict = $verdictResponse->verdict ?? Verdict::UNKNOWN; $this->Guid = $verdictResponse->guid ?? ""; - $this->LibMagic = $verdictResponse->libMagic ?? null; + $this->LibMagic = $verdictResponse->lib_magic ?? null; $this->Detections = $verdictResponse->detections ?? null; } diff --git a/php/src/vaas/Message/VerdictResponse.php b/php/src/vaas/Message/VerdictResponse.php index fec27bff..79c5db54 100644 --- a/php/src/vaas/Message/VerdictResponse.php +++ b/php/src/vaas/Message/VerdictResponse.php @@ -9,6 +9,6 @@ class VerdictResponse extends BaseMessage public string $guid; public string $sha256; public ?string $upload_token; - public ?LibMagic $libMagic; + public ?LibMagic $lib_magic; public ?array $detections; } diff --git a/php/tests/vaas/VaasTest.php b/php/tests/vaas/VaasTest.php index 22d2a5f5..1723e18f 100644 --- a/php/tests/vaas/VaasTest.php +++ b/php/tests/vaas/VaasTest.php @@ -608,7 +608,7 @@ public function testForStream_WithEicarUrlContentAsStream_ReturnsMaliciousWithDe $verdict = $vaas->ForStream($stream); $this->assertEquals(Verdict::MALICIOUS, $verdict->Verdict); - $this->assertEquals("text/plain", $verdict->LibMagic->mimeType); - $this->assertContains("EICAR-Test-File", array_column($verdict->Detections, "virus")); + $this->assertEquals("text/plain", $verdict->LibMagic->mime_type); + $this->assertContains("EICAR-Test-File", array_column($verdict->Detections, "virus")); } } diff --git a/typescript/src/Vaas.ts b/typescript/src/Vaas.ts index b5959c43..f4065c9e 100644 --- a/typescript/src/Vaas.ts +++ b/typescript/src/Vaas.ts @@ -188,7 +188,7 @@ export class Vaas { this.verdictPromises.delete(guid); resolve( - new VaasVerdict(verdictResponse.sha256, verdictResponse.verdict, verdictResponse.detections, verdictResponse.libMagic), + new VaasVerdict(verdictResponse.sha256, verdictResponse.verdict, verdictResponse.detections, verdictResponse.lib_magic), ); }, reject: (reason) => reject(reason), @@ -216,7 +216,7 @@ export class Vaas { resolve: async (verdictResponse: VerdictResponse) => { this.verdictPromises.delete(guid); resolve( - new VaasVerdict(verdictResponse.sha256, verdictResponse.verdict, verdictResponse.detections, verdictResponse.libMagic), + new VaasVerdict(verdictResponse.sha256, verdictResponse.verdict, verdictResponse.detections, verdictResponse.lib_magic), ); }, reject: (reason) => reject(reason), @@ -257,7 +257,7 @@ export class Vaas { ); } resolve( - new VaasVerdict(verdictResponse.sha256, verdictResponse.verdict, verdictResponse.detections, verdictResponse.libMagic), + new VaasVerdict(verdictResponse.sha256, verdictResponse.verdict, verdictResponse.detections, verdictResponse.lib_magic), ); }, reject: (reason) => reject(reason), diff --git a/typescript/src/messages/detection.ts b/typescript/src/messages/detection.ts index a25ac8a2..8ba929ef 100644 --- a/typescript/src/messages/detection.ts +++ b/typescript/src/messages/detection.ts @@ -4,7 +4,7 @@ import { JsonProperty, JsonObject } from "typescript-json-serializer"; export class Detection { public constructor( @JsonProperty() public engine: number, - @JsonProperty() public fileName: string, + @JsonProperty() public file_name: string, @JsonProperty() public virus: string, - ) {} + ) { } } diff --git a/typescript/src/messages/lib_magic.ts b/typescript/src/messages/lib_magic.ts index f43d6ac6..af3a16e7 100644 --- a/typescript/src/messages/lib_magic.ts +++ b/typescript/src/messages/lib_magic.ts @@ -3,7 +3,7 @@ import { JsonProperty, JsonObject } from "typescript-json-serializer"; @JsonObject() export class LibMagic { public constructor( - @JsonProperty() public fileType: number, - @JsonProperty() public mimeType: string, - ) {} + @JsonProperty() public file_type: number, + @JsonProperty() public mime_type: string, + ) { } } diff --git a/typescript/src/messages/verdict_response.ts b/typescript/src/messages/verdict_response.ts index 1f836e42..91168904 100644 --- a/typescript/src/messages/verdict_response.ts +++ b/typescript/src/messages/verdict_response.ts @@ -13,7 +13,7 @@ export class VerdictResponse extends Message { @JsonProperty() public upload_token: string | undefined, @JsonProperty() public url: string | undefined, @JsonProperty() public detections: Detection[] | undefined, - @JsonProperty() public libMagic: LibMagic | undefined, + @JsonProperty() public lib_magic: LibMagic | undefined, ) { super(Kind.VerdictResponse); } diff --git a/typescript/tests/test.ts b/typescript/tests/test.ts index c4838d3d..d59bb371 100644 --- a/typescript/tests/test.ts +++ b/typescript/tests/test.ts @@ -271,7 +271,7 @@ describe("Test verdict requests", function () { it('if a EICAR stream is submitted, a verdict "malicious" is expected', async () => { const vaas = await createVaasWithClientCredentialsGrantAuthenticator(); const stream = new Readable(); - stream._read = () => {}; + stream._read = () => { }; stream.push( `X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*`, ); @@ -279,8 +279,8 @@ describe("Test verdict requests", function () { const verdict = await vaas.forStream(stream); expect(verdict.verdict).to.equal("Malicious"); expect(verdict.detections).to.be.not.empty; - expect(verdict.libMagic?.fileType).to.equal("EICAR virus test files"); - expect(verdict.libMagic?.mimeType).to.equal("text/plain"); + expect(verdict.libMagic?.file_type).to.equal("EICAR virus test files"); + expect(verdict.libMagic?.mime_type).to.equal("text/plain"); }); it('if a EICAR stream from an url is submitted, a response with verdict, libmagic & detections is expected', async () => { @@ -292,8 +292,8 @@ describe("Test verdict requests", function () { const verdict = await vaas.forStream(response.data); expect(verdict.verdict).to.equal("Malicious"); expect(verdict.detections).to.be.not.empty; - expect(verdict.libMagic?.fileType).to.equal("EICAR virus test files"); - expect(verdict.libMagic?.mimeType).to.equal("text/plain"); + expect(verdict.libMagic?.file_type).to.equal("EICAR virus test files"); + expect(verdict.libMagic?.mime_type).to.equal("text/plain"); }); }); @@ -311,10 +311,10 @@ describe("Vaas", async () => { beforeEach(() => { webSocket = { readyState: WebSocket.CONNECTING as number, - onopen: () => {}, - onclose: () => {}, - onmessage: () => {}, - send: (data: any) => {}, + onopen: () => { }, + onclose: () => { }, + onmessage: () => { }, + send: (data: any) => { }, } as any; vaas = new Vaas((url) => webSocket); }); From 6177308f8812cec193174841513d593830be78d9 Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 08:58:42 +0100 Subject: [PATCH 2/9] update java github actions --- .github/workflows/ci-dotnet.yaml | 12 ++++++------ .github/workflows/ci-java-legacy.yaml | 4 ++-- .github/workflows/ci-java.yaml | 16 ++++++++-------- .github/workflows/ci-php.yaml | 6 +++--- .github/workflows/ci-python.yaml | 2 +- .github/workflows/ci-ruby.yaml | 2 +- .github/workflows/ci-rust.yaml | 4 ++-- .github/workflows/ci-typescript.yaml | 8 ++++---- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci-dotnet.yaml b/.github/workflows/ci-dotnet.yaml index 420b74cc..c8fee875 100644 --- a/.github/workflows/ci-dotnet.yaml +++ b/.github/workflows/ci-dotnet.yaml @@ -28,8 +28,8 @@ on: env: CLIENT_ID: ${{ secrets.CLIENT_ID }} CLIENT_SECRET: ${{secrets.CLIENT_SECRET}} - VAAS_URL: 'wss://gateway.production.vaas.gdatasecurity.de' - TOKEN_URL: 'https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token' + VAAS_URL: "wss://gateway.production.vaas.gdatasecurity.de" + TOKEN_URL: "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token" VAAS_CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }} VAAS_USER_NAME: ${{ secrets.VAAS_USER_NAME }} VAAS_PASSWORD: ${{secrets.VAAS_PASSWORD}} @@ -43,8 +43,8 @@ jobs: dotnet-version: ["8.0.x"] steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 + - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/cs') && endsWith(github.ref, '-beta'))) run: | @@ -105,9 +105,9 @@ jobs: run: dotnet run UrlScan working-directory: dotnet/examples/VaasExample - - name: Run example HashsumScan + - name: Run example HashsumScan run: dotnet run HashsumScan - working-directory: dotnet/examples/VaasExample + working-directory: dotnet/examples/VaasExample - name: Pack if: startsWith(github.ref, 'refs/tags/cs') diff --git a/.github/workflows/ci-java-legacy.yaml b/.github/workflows/ci-java-legacy.yaml index 66b6354f..e51e9b7a 100644 --- a/.github/workflows/ci-java-legacy.yaml +++ b/.github/workflows/ci-java-legacy.yaml @@ -41,7 +41,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/java') && endsWith(github.ref, '-beta'))) @@ -66,7 +66,7 @@ jobs: echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV - name: install Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: "11" distribution: "temurin" diff --git a/.github/workflows/ci-java.yaml b/.github/workflows/ci-java.yaml index 0fc407d3..41c21058 100644 --- a/.github/workflows/ci-java.yaml +++ b/.github/workflows/ci-java.yaml @@ -41,7 +41,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/java') && endsWith(github.ref, '-beta'))) @@ -72,12 +72,12 @@ jobs: distribution: "temurin" - name: setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: gradle-version: "8.6" - name: run tests - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: arguments: test --info gradle-version: "8.6" @@ -86,21 +86,21 @@ jobs: - name: run examples for file env: SCAN_PATH: "src/main/java/de/gdata/vaasexample/Main.java" - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: arguments: fileScan gradle-version: "8.6" build-root-directory: java/examples/VaasExample - name: run examples for url - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: arguments: urlScan gradle-version: "8.6" build-root-directory: java/examples/VaasExample - name: run authentication examples - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: arguments: authentication gradle-version: "8.6" @@ -124,7 +124,7 @@ jobs: ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: arguments: publish gradle-version: "8.6" @@ -135,7 +135,7 @@ jobs: env: ORG_GRADLE_PROJECT_username: ${{ secrets.ORG_GRADLE_PROJECT_USERNAME }} ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }} - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@v4 with: arguments: closeAndReleaseRepository gradle-version: "8.6" diff --git a/.github/workflows/ci-php.yaml b/.github/workflows/ci-php.yaml index b51531b1..5700b415 100644 --- a/.github/workflows/ci-php.yaml +++ b/.github/workflows/ci-php.yaml @@ -43,7 +43,7 @@ jobs: version: ["8.1", "8.2", "8.3"] steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/php') && endsWith(github.ref, '-beta'))) @@ -65,7 +65,7 @@ jobs: echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-develop/protocol/openid-connect/token" >> $GITHUB_ENV echo "VAAS_CLIENT_ID=${{ secrets.DEVELOP_VAAS_CLIENT_ID }}" >> $GITHUB_ENV echo "VAAS_USER_NAME=${{ secrets.DEVELOP_VAAS_USER_NAME }}" >> $GITHUB_ENV - echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV + echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV - name: setup PHP with PECL extension uses: shivammathur/setup-php@v2 @@ -123,7 +123,7 @@ jobs: - name: checkout if: startsWith(github.ref, 'refs/tags/php') - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: publish on site repo if: startsWith(github.ref, 'refs/tags/php') diff --git a/.github/workflows/ci-python.yaml b/.github/workflows/ci-python.yaml index 47ae2371..2dd28b62 100644 --- a/.github/workflows/ci-python.yaml +++ b/.github/workflows/ci-python.yaml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/py') && endsWith(github.ref, '-beta'))) diff --git a/.github/workflows/ci-ruby.yaml b/.github/workflows/ci-ruby.yaml index 2ccec107..df7ab6fd 100644 --- a/.github/workflows/ci-ruby.yaml +++ b/.github/workflows/ci-ruby.yaml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: "3.1" # Not needed with a .ruby-version file diff --git a/.github/workflows/ci-rust.yaml b/.github/workflows/ci-rust.yaml index 1a42ab90..1f1c8501 100644 --- a/.github/workflows/ci-rust.yaml +++ b/.github/workflows/ci-rust.yaml @@ -41,7 +41,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/rs') && endsWith(github.ref, '-beta'))) @@ -63,7 +63,7 @@ jobs: echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-develop/protocol/openid-connect/token" >> $GITHUB_ENV echo "VAAS_CLIENT_ID=${{ secrets.DEVELOP_VAAS_CLIENT_ID }}" >> $GITHUB_ENV echo "VAAS_USER_NAME=${{ secrets.DEVELOP_VAAS_USER_NAME }}" >> $GITHUB_ENV - echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV + echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV - name: install Rust stable uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/ci-typescript.yaml b/.github/workflows/ci-typescript.yaml index 5e43f4da..2932ad9c 100644 --- a/.github/workflows/ci-typescript.yaml +++ b/.github/workflows/ci-typescript.yaml @@ -28,8 +28,8 @@ on: env: CLIENT_ID: ${{ secrets.CLIENT_ID }} CLIENT_SECRET: ${{secrets.CLIENT_SECRET}} - VAAS_URL: 'wss://gateway.production.vaas.gdatasecurity.de' - TOKEN_URL: 'https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token' + VAAS_URL: "wss://gateway.production.vaas.gdatasecurity.de" + TOKEN_URL: "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token" VAAS_CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }} VAAS_USER_NAME: ${{ secrets.VAAS_USER_NAME }} VAAS_PASSWORD: ${{secrets.VAAS_PASSWORD}} @@ -41,7 +41,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: set staging environment if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/ts') && endsWith(github.ref, '-beta'))) @@ -63,7 +63,7 @@ jobs: echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-develop/protocol/openid-connect/token" >> $GITHUB_ENV echo "VAAS_CLIENT_ID=${{ secrets.DEVELOP_VAAS_CLIENT_ID }}" >> $GITHUB_ENV echo "VAAS_USER_NAME=${{ secrets.DEVELOP_VAAS_USER_NAME }}" >> $GITHUB_ENV - echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV + echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV - uses: pnpm/action-setup@v3 name: install pnpm From 787df9920179925607ea61c13939b3a1c624970e Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:00:09 +0100 Subject: [PATCH 3/9] gradle/gradle-build-action@v3 v4 does not exist --- .github/workflows/ci-java-legacy.yaml | 12 ++++++------ .github/workflows/ci-java.yaml | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-java-legacy.yaml b/.github/workflows/ci-java-legacy.yaml index e51e9b7a..09c7da83 100644 --- a/.github/workflows/ci-java-legacy.yaml +++ b/.github/workflows/ci-java-legacy.yaml @@ -72,12 +72,12 @@ jobs: distribution: "temurin" - name: setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 with: gradle-version: "8.1" - name: run tests - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 with: arguments: test gradle-version: "8.1" @@ -86,14 +86,14 @@ jobs: #- name: run examples for file # env: # SCAN_PATH: "src/main/java/de/gdata/vaasexample/Main.java" - # uses: gradle/gradle-build-action@v2 + # uses: gradle/gradle-build-action@v3 # with: # arguments: fileScan # gradle-version: "8.1" # build-root-directory: java/examples/VaasExample #- name: run examples for url - # uses: gradle/gradle-build-action@v2 + # uses: gradle/gradle-build-action@v3 # with: # arguments: urlScan # gradle-version: "8.1" @@ -122,7 +122,7 @@ jobs: ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 with: arguments: publish gradle-version: "8.1" @@ -133,7 +133,7 @@ jobs: env: ORG_GRADLE_PROJECT_username: ${{ secrets.ORG_GRADLE_PROJECT_USERNAME }} ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }} - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 with: arguments: closeAndReleaseRepository gradle-version: "8.1" diff --git a/.github/workflows/ci-java.yaml b/.github/workflows/ci-java.yaml index 41c21058..7f8d66b6 100644 --- a/.github/workflows/ci-java.yaml +++ b/.github/workflows/ci-java.yaml @@ -72,12 +72,12 @@ jobs: distribution: "temurin" - name: setup Gradle - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: gradle-version: "8.6" - name: run tests - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: arguments: test --info gradle-version: "8.6" @@ -86,21 +86,21 @@ jobs: - name: run examples for file env: SCAN_PATH: "src/main/java/de/gdata/vaasexample/Main.java" - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: arguments: fileScan gradle-version: "8.6" build-root-directory: java/examples/VaasExample - name: run examples for url - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: arguments: urlScan gradle-version: "8.6" build-root-directory: java/examples/VaasExample - name: run authentication examples - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: arguments: authentication gradle-version: "8.6" @@ -124,7 +124,7 @@ jobs: ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: arguments: publish gradle-version: "8.6" @@ -135,7 +135,7 @@ jobs: env: ORG_GRADLE_PROJECT_username: ${{ secrets.ORG_GRADLE_PROJECT_USERNAME }} ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }} - uses: gradle/gradle-build-action@v4 + uses: gradle/gradle-build-action@v3 with: arguments: closeAndReleaseRepository gradle-version: "8.6" From b64282accdbe0f7148e98d7eaafec865327a6ea2 Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:04:02 +0100 Subject: [PATCH 4/9] updates python ci action --- .github/workflows/ci-python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-python.yaml b/.github/workflows/ci-python.yaml index 2dd28b62..d1782ea5 100644 --- a/.github/workflows/ci-python.yaml +++ b/.github/workflows/ci-python.yaml @@ -65,7 +65,7 @@ jobs: echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV - name: set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.x - name: install dependencies From 263faf48203c7f3d7d5261d586afd84c1010f2d6 Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:08:08 +0100 Subject: [PATCH 5/9] replace rust toolchain action --- .github/workflows/ci-rust.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-rust.yaml b/.github/workflows/ci-rust.yaml index 1f1c8501..bffcd865 100644 --- a/.github/workflows/ci-rust.yaml +++ b/.github/workflows/ci-rust.yaml @@ -66,7 +66,7 @@ jobs: echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV - name: install Rust stable - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable From 57574f9eec409d79eef374c806405be836041382 Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:14:12 +0100 Subject: [PATCH 6/9] add path to go.mod file --- .github/workflows/image-retention.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image-retention.yaml b/.github/workflows/image-retention.yaml index 1ed356f7..9b9e7f98 100644 --- a/.github/workflows/image-retention.yaml +++ b/.github/workflows/image-retention.yaml @@ -18,6 +18,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.22.0 + go-version-file: ./github-actions/cleanup-packages/go.mod - name: Verify dependencies run: go mod verify From 976ed1fa5b58f34f86dafa061f07678336971dbc Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:15:29 +0100 Subject: [PATCH 7/9] add path to go.sum --- .github/workflows/image-retention.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image-retention.yaml b/.github/workflows/image-retention.yaml index 9b9e7f98..284a337a 100644 --- a/.github/workflows/image-retention.yaml +++ b/.github/workflows/image-retention.yaml @@ -19,6 +19,7 @@ jobs: with: go-version: 1.22.0 go-version-file: ./github-actions/cleanup-packages/go.mod + cache-dependency-path: ./github-actions/cleanup-packages/go.sum - name: Verify dependencies run: go mod verify From 47d7128e30033d382ca6f0a34c111d32c58624f8 Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:16:34 +0100 Subject: [PATCH 8/9] only use the go-version-file parameter --- .github/workflows/image-retention.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/image-retention.yaml b/.github/workflows/image-retention.yaml index 284a337a..3e224af9 100644 --- a/.github/workflows/image-retention.yaml +++ b/.github/workflows/image-retention.yaml @@ -17,7 +17,6 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22.0 go-version-file: ./github-actions/cleanup-packages/go.mod cache-dependency-path: ./github-actions/cleanup-packages/go.sum From a007b6803186b81ce94934891dc3a94cfd21b495 Mon Sep 17 00:00:00 2001 From: unglaublicherdude Date: Thu, 14 Mar 2024 09:24:27 +0100 Subject: [PATCH 9/9] the rust-cache action has no parameter working-directory --- .github/workflows/ci-rust.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-rust.yaml b/.github/workflows/ci-rust.yaml index bffcd865..c7883ed2 100644 --- a/.github/workflows/ci-rust.yaml +++ b/.github/workflows/ci-rust.yaml @@ -72,7 +72,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: - working-directory: rust + workspaces: rust - name: run tests run: cargo test