Skip to content

Commit b1425ab

Browse files
committed
fix: suppress S5659 via NOSONAR and rename remaining test functions
- Add NOSONAR inline comment for ParseUnverified (go:S5659) since sonar.issue.ignore.multicriteria is not honored by Automatic Analysis - Rename TestNewVerifier_MissingTrustEvaluator -> TestNewVerifierMissingTrustEvaluator - Rename TestNewMDocHandler_WithTrustEvaluator -> TestNewMDocHandlerWithTrustEvaluator
1 parent d473dee commit b1425ab

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/verifier/apiv1/handlers_verification.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ func (c *Client) evaluateIssuerTrust(ctx context.Context, vpToken string, scope
430430
// signature verification is performed below by verifyJWTSignature() which enforces
431431
// a strict algorithm allowlist and rejects "none" and other weak algorithms.
432432
parser := jwt.NewParser(jwt.WithoutClaimsValidation())
433-
token, _, err := parser.ParseUnverified(issuerJWT, jwt.MapClaims{})
433+
token, _, err := parser.ParseUnverified(issuerJWT, jwt.MapClaims{}) // NOSONAR (go:S5659) - ParseUnverified is intentional; signature is verified below by verifyJWTSignature()
434434
if err != nil {
435435
return fmt.Errorf("failed to parse JWT header: %w", err)
436436
}

pkg/mdoc/verifier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func TestNewVerifier(t *testing.T) {
186186
}
187187
}
188188

189-
func TestNewVerifier_MissingTrustEvaluator(t *testing.T) {
189+
func TestNewVerifierMissingTrustEvaluator(t *testing.T) {
190190
_, err := NewVerifier(VerifierConfig{})
191191

192192
if err == nil {

pkg/openid4vp/mdoc_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestNewMDocHandler(t *testing.T) {
4444
}
4545
}
4646

47-
func TestNewMDocHandler_WithTrustEvaluator(t *testing.T) {
47+
func TestNewMDocHandlerWithTrustEvaluator(t *testing.T) {
4848
te := &mockTrustEvaluator{trusted: true}
4949

5050
h, err := NewMDocHandler(WithMDocTrustEvaluator(te))

0 commit comments

Comments
 (0)