Skip to content

Commit b946dc4

Browse files
committed
build: replace dotnet-sonarscanner login parameter with token
WE2-964 Signed-off-by: Sven Mitt <svenzik@users.noreply.github.com>
1 parent 2c24ca6 commit b946dc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/sonarcloud-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6464
shell: powershell
6565
run: |
66-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
66+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" /d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
6767
dotnet build --configuration Release --no-restore src/WebEid.Security.sln
6868
dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
69-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
69+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

src/WebEid.Security/Validator/AuthTokenValidator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public WebEidAuthToken Parse(string authToken)
9999
catch (Exception ex)
100100
{
101101
// Generally "log and rethrow" is an anti-pattern, but it fits with the surrounding logging style.
102-
this.logger?.LogWarning("Token parsing was interrupted:", ex);
102+
this.logger?.LogWarning(ex, "Token parsing was interrupted:");
103103
throw;
104104
}
105105
}
@@ -121,7 +121,7 @@ public Task<X509Certificate2> Validate(WebEidAuthToken authToken, string current
121121
catch (Exception ex)
122122
{
123123
// Generally "log and rethrow" is an anti-pattern, but it fits with the surrounding logging style.
124-
this.logger?.LogWarning("Token validation was interrupted:", ex);
124+
this.logger?.LogWarning(ex, "Token validation was interrupted:");
125125
throw;
126126
}
127127
}

0 commit comments

Comments
 (0)