Skip to content

Commit ac21de3

Browse files
committed
lint
1 parent 7b927c3 commit ac21de3

File tree

12 files changed

+27021
-23369
lines changed

12 files changed

+27021
-23369
lines changed

auth/tokenprovider/authenticator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ func (a *TokenProviderAuthenticator) Authenticate(r *http.Request) error {
4141
log.Debug().Msgf("token provider authenticator: authenticated using provider %s", a.provider.Name())
4242

4343
return nil
44-
}
44+
}

auth/tokenprovider/authenticator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ func TestTokenProviderAuthenticator(t *testing.T) {
132132
// Should only call base provider once due to caching
133133
assert.Equal(t, 1, callCount)
134134
})
135-
}
135+
}

auth/tokenprovider/cached.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ func (p *CachedTokenProvider) ClearCache() {
8383
p.mutex.Lock()
8484
p.cache = nil
8585
p.mutex.Unlock()
86-
}
86+
}

auth/tokenprovider/external.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ func (p *ExternalTokenProvider) GetToken(ctx context.Context) (*Token, error) {
5353
// Name returns the provider name
5454
func (p *ExternalTokenProvider) Name() string {
5555
return "external"
56-
}
56+
}

auth/tokenprovider/federation_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func TestFederationProvider_TokenExchangeSuccess(t *testing.T) {
127127
"scope": "sql",
128128
}
129129
w.Header().Set("Content-Type", "application/json")
130-
json.NewEncoder(w).Encode(response)
130+
_ = json.NewEncoder(w).Encode(response)
131131
}))
132132
defer server.Close()
133133

@@ -167,7 +167,7 @@ func TestFederationProvider_TokenExchangeWithClientID(t *testing.T) {
167167
"expires_in": 3600,
168168
}
169169
w.Header().Set("Content-Type", "application/json")
170-
json.NewEncoder(w).Encode(response)
170+
_ = json.NewEncoder(w).Encode(response)
171171
}))
172172
defer server.Close()
173173

@@ -187,7 +187,7 @@ func TestFederationProvider_TokenExchangeFailureFallback(t *testing.T) {
187187
// Create mock server that returns error
188188
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
189189
w.WriteHeader(http.StatusBadRequest)
190-
w.Write([]byte(`{"error": "invalid_request"}`))
190+
_, _ = w.Write([]byte(`{"error": "invalid_request"}`))
191191
}))
192192
defer server.Close()
193193

@@ -264,7 +264,7 @@ func TestFederationProvider_CachedIntegration(t *testing.T) {
264264
"expires_in": 3600,
265265
}
266266
w.Header().Set("Content-Type", "application/json")
267-
json.NewEncoder(w).Encode(response)
267+
_ = json.NewEncoder(w).Encode(response)
268268
}))
269269
defer server.Close()
270270

@@ -325,12 +325,12 @@ func TestFederationProvider_InvalidJWT(t *testing.T) {
325325
func TestFederationProvider_RealWorldIssuers(t *testing.T) {
326326
// Test with real-world identity provider issuers
327327
issuers := map[string]string{
328-
"azure_ad": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
329-
"google": "https://accounts.google.com",
330-
"aws_cognito": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_example",
331-
"okta": "https://dev-12345.okta.com/oauth2/default",
332-
"auth0": "https://dev-12345.auth0.com/",
333-
"github": "https://token.actions.githubusercontent.com",
328+
"azure_ad": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
329+
"google": "https://accounts.google.com",
330+
"aws_cognito": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_example",
331+
"okta": "https://dev-12345.okta.com/oauth2/default",
332+
"auth0": "https://dev-12345.auth0.com/",
333+
"github": "https://token.actions.githubusercontent.com",
334334
}
335335

336336
databricksHost := "test.databricks.com"

auth/tokenprovider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ func (t *Token) SetAuthHeader(r *http.Request) {
4040
tokenType = "Bearer"
4141
}
4242
r.Header.Set("Authorization", tokenType+" "+t.AccessToken)
43-
}
43+
}

auth/tokenprovider/provider_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,4 +420,4 @@ func (m *mockProvider) GetToken(ctx context.Context) (*Token, error) {
420420

421421
func (m *mockProvider) Name() string {
422422
return m.name
423-
}
423+
}

auth/tokenprovider/static.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ func (p *StaticTokenProvider) GetToken(ctx context.Context) (*Token, error) {
4444
// Name returns the provider name
4545
func (p *StaticTokenProvider) Name() string {
4646
return "static"
47-
}
47+
}

examples/token_federation/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,4 @@ func (p *OAuthServiceTokenProvider) GetToken(ctx context.Context) (*tokenprovide
341341

342342
func (p *OAuthServiceTokenProvider) Name() string {
343343
return "oauth-service"
344-
}
344+
}

internal/cli_service/GoUnusedProtection__.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)