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>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-15 19:13:52 +00:00
parent 18e4066277
commit 9e9e6f43da
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 != "" {
+1 -1
View File
@@ -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)