Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.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"
.\.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="$env:SONAR_TOKEN" /d:sonar.host.url="https://sonarcloud.io"
dotnet build --configuration Release --no-restore src/WebEid.Security.sln
dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="$env:SONAR_TOKEN"
4 changes: 2 additions & 2 deletions src/WebEid.Security/Validator/AuthTokenValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
ValidateTokenLength(authToken);
return ParseToken(authToken);
}
catch (Exception ex)

Check warning on line 99 in src/WebEid.Security/Validator/AuthTokenValidator.cs

View workflow job for this annotation

GitHub Actions / Analyze

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)

Check warning on line 99 in src/WebEid.Security/Validator/AuthTokenValidator.cs

View workflow job for this annotation

GitHub Actions / Analyze

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)
{
// Generally "log and rethrow" is an anti-pattern, but it fits with the surrounding logging style.
this.logger?.LogWarning("Token parsing was interrupted:", ex);
this.logger?.LogWarning(ex, "Token parsing was interrupted:");
throw;
}
}
Expand All @@ -118,10 +118,10 @@
{
return this.ValidateToken(authToken, currentChallengeNonce);
}
catch (Exception ex)

Check warning on line 121 in src/WebEid.Security/Validator/AuthTokenValidator.cs

View workflow job for this annotation

GitHub Actions / Analyze

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)
{
// Generally "log and rethrow" is an anti-pattern, but it fits with the surrounding logging style.
this.logger?.LogWarning("Token validation was interrupted:", ex);
this.logger?.LogWarning(ex, "Token validation was interrupted:");
throw;
}
}
Expand Down
Loading