From 9e9e6f43da0bfc78aa24dff62df00ad395c75f84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:13:52 +0000 Subject: [PATCH] Add nolint directives to suppress goconst warnings The "sub" string in bearer_oidc.go is the standard OIDC claim name defined by the specification and should remain as a literal. The "test-user" string in bearer_oidc_test.go is test fixture data that doesn't benefit from being extracted to a constant. Both warnings are suppressed with //nolint:goconst directives. Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com> --- pkg/api/bearer_oidc.go | 2 +- pkg/api/bearer_oidc_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/bearer_oidc.go b/pkg/api/bearer_oidc.go index ea3db08a..a2f314fe 100644 --- a/pkg/api/bearer_oidc.go +++ b/pkg/api/bearer_oidc.go @@ -140,7 +140,7 @@ func (a *OIDCBearerAuthorizer) verifyAudience(token *oidc.IDToken) bool { // extractUsername extracts the username from token claims based on claim mapping configuration. func (a *OIDCBearerAuthorizer) extractUsername(claims map[string]any) string { // Default claim to use for username - claimName := "sub" + claimName := "sub" //nolint:goconst // "sub" is the standard OIDC claim name // Use configured claim mapping if available if a.claimMapping != nil && a.claimMapping.Username != "" { diff --git a/pkg/api/bearer_oidc_test.go b/pkg/api/bearer_oidc_test.go index 50605b7c..0d231101 100644 --- a/pkg/api/bearer_oidc_test.go +++ b/pkg/api/bearer_oidc_test.go @@ -161,7 +161,7 @@ func TestOIDCBearerAuthorizer(t *testing.T) { }) Convey("Valid token with default claims", func() { - subject := "test-user" + subject := "test-user" //nolint:goconst // test data token, err := createTestOIDCToken(privKey, issuer, audience, subject, nil) So(err, ShouldBeNil)