From a4f27c4901bfda8d092849bf83f71f8397b8ecf6 Mon Sep 17 00:00:00 2001 From: Lennart Dohmann Date: Fri, 16 Feb 2024 11:26:10 +0100 Subject: [PATCH] Update .NET Core version to 8.0 --- .github/workflows/ci-dotnet.yaml | 35 +++++++++++++++++---- dotnet/Vaas/src/Vaas/Vaas.csproj | 2 +- dotnet/Vaas/test/TestFiles/TestFiles.csproj | 2 +- dotnet/Vaas/test/Vaas.Test/Vaas.Test.csproj | 2 +- dotnet/Vaas/test/Vaas.Test/VaasTest.cs | 4 +-- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-dotnet.yaml b/.github/workflows/ci-dotnet.yaml index a5ac66c3..1465227d 100644 --- a/.github/workflows/ci-dotnet.yaml +++ b/.github/workflows/ci-dotnet.yaml @@ -22,16 +22,17 @@ on: options: - production - staging + - develop default: "production" env: CLIENT_ID: ${{ secrets.CLIENT_ID }} - CLIENT_SECRET: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && secrets.CLIENT_SECRET || secrets.STAGING_CLIENT_SECRET }} - VAAS_URL: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && 'wss://gateway.production.vaas.gdatasecurity.de' || 'wss://gateway.staging.vaas.gdatasecurity.de' }} - TOKEN_URL: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && 'https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token' || 'https://account-staging.gdata.de/realms/vaas-staging/protocol/openid-connect/token' }} + 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_CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }} VAAS_USER_NAME: ${{ secrets.VAAS_USER_NAME }} - VAAS_PASSWORD: ${{ (inputs.environment == 'production' || inputs.environment == null || startsWith(github.ref, 'refs/tags/cs')) && secrets.VAAS_PASSWORD || secrets.STAGING_VAAS_PASSWORD }} + VAAS_PASSWORD: ${{secrets.VAAS_PASSWORD}} jobs: build-dotnet: @@ -39,13 +40,35 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ["6.0.x"] + dotnet-version: ["8.0.x"] steps: - uses: actions/checkout@v3 + + - name: set staging environment + if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/java') && endsWith(github.ref, '-beta'))) + run: | + echo "CLIENT_ID=${{ secrets.STAGING_CLIENT_ID }}" >> $GITHUB_ENV + echo "CLIENT_SECRET=${{ secrets.STAGING_CLIENT_SECRET }}" >> $GITHUB_ENV + echo "VAAS_URL=wss://gateway.staging.vaas.gdatasecurity.de" >> $GITHUB_ENV + echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-staging/protocol/openid-connect/token" >> $GITHUB_ENV + echo "VAAS_CLIENT_ID=${{ secrets.STAGING_VAAS_CLIENT_ID }}" >> $GITHUB_ENV + echo "VAAS_USER_NAME=${{ secrets.STAGING_VAAS_USER_NAME }}" >> $GITHUB_ENV + echo "VAAS_PASSWORD=${{ secrets.STAGING_VAAS_PASSWORD }}" >> $GITHUB_ENV + + - name: set develop environment + if: (inputs.environment == 'develop' || (startsWith(github.ref, 'refs/tags/java') && endsWith(github.ref, '-alpha'))) + run: | + echo "CLIENT_ID=${{ secrets.DEVELOP_CLIENT_ID }}" >> $GITHUB_ENV + echo "CLIENT_SECRET=${{ secrets.DEVELOP_CLIENT_SECRET }}" >> $GITHUB_ENV + echo "VAAS_URL=wss://gateway.develop.vaas.gdatasecurity.de" >> $GITHUB_ENV + 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 - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet-version }} diff --git a/dotnet/Vaas/src/Vaas/Vaas.csproj b/dotnet/Vaas/src/Vaas/Vaas.csproj index a5dd6b4b..191c6933 100644 --- a/dotnet/Vaas/src/Vaas/Vaas.csproj +++ b/dotnet/Vaas/src/Vaas/Vaas.csproj @@ -3,7 +3,7 @@ 0.0.0 MIT - net6.0 + net8.0 enable opensource@gdata.de G DATA CyberDefense AG diff --git a/dotnet/Vaas/test/TestFiles/TestFiles.csproj b/dotnet/Vaas/test/TestFiles/TestFiles.csproj index c3f3c87e..a2b06607 100644 --- a/dotnet/Vaas/test/TestFiles/TestFiles.csproj +++ b/dotnet/Vaas/test/TestFiles/TestFiles.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable diff --git a/dotnet/Vaas/test/Vaas.Test/Vaas.Test.csproj b/dotnet/Vaas/test/Vaas.Test/Vaas.Test.csproj index 7442f650..90fb38f0 100644 --- a/dotnet/Vaas/test/Vaas.Test/Vaas.Test.csproj +++ b/dotnet/Vaas/test/Vaas.Test/Vaas.Test.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 false diff --git a/dotnet/Vaas/test/Vaas.Test/VaasTest.cs b/dotnet/Vaas/test/Vaas.Test/VaasTest.cs index 1c609318..412a68c8 100644 --- a/dotnet/Vaas/test/Vaas.Test/VaasTest.cs +++ b/dotnet/Vaas/test/Vaas.Test/VaasTest.cs @@ -47,10 +47,10 @@ public async Task ForSha256Async_SendsUserAgent() [Fact] public void Constructor_IfRelativeUrl_ThrowsVaasClientException() { - var e = Assert.Throws(() => + var e = Assert.Throws(() => new Vaas(_httpClient, _authenticator.Object, new VaasOptions() { Url = new Uri("/relative") })); Assert.Equal( - "Parameter \"options.Url.Host\" (string) must not be null or whitespace, was whitespace. (Parameter 'options.Url.Host')", + "Invalid URI: The format of the URI could not be determined.", e.Message); }