all: modernize code (#868)

Use `go fix ./...` to modernize the code.
This commit is contained in:
Oleksandr Redko 2026-03-31 11:58:02 +03:00 • committed by GitHub
commit a1f808c86e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,7 +36,7 @@ func TestNewEnterpriseHandler_Validation(t *testing.T) {
AccessToken: "mock_access_token",
TokenType: "Bearer",
}
return token.WithExtra(map[string]interface{}{"id_token": "mock_id_token"}), nil
return token.WithExtra(map[string]any{"id_token": "mock_id_token"}), nil
},
}
@ -194,7 +194,7 @@ func TestNewEnterpriseHandler_Validation(t *testing.T) {
AccessToken: "mock_access_token",
TokenType: "Bearer",
}
return token.WithExtra(map[string]interface{}{"id_token": "mock_id_token"}), nil
return token.WithExtra(map[string]any{"id_token": "mock_id_token"}), nil
},
},
wantError: "",
@ -254,7 +254,7 @@ func TestEnterpriseHandler_Authorize_E2E(t *testing.T) {
AccessToken: "mock_access_token",
TokenType: "Bearer",
}
return token.WithExtra(map[string]interface{}{"id_token": "mock_id_token_from_user_login"}), nil
return token.WithExtra(map[string]any{"id_token": "mock_id_token_from_user_login"}), nil
},
})
if err != nil {
@ -305,7 +305,7 @@ func setupIdPServer(t *testing.T) *httptest.Server {
// OAuth/OIDC metadata endpoint - uses closure to get server URL
mux.HandleFunc("/.well-known/oauth-authorization-server", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]interface{}{
json.NewEncoder(w).Encode(map[string]any{
"issuer": server.URL,
"token_endpoint": server.URL + "/token",
"authorization_endpoint": server.URL + "/authorize",
@ -350,7 +350,7 @@ func setupIdPServer(t *testing.T) *httptest.Server {
// Return ID-JAG (Identity Assertion JWT Authorization Grant)
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]interface{}{
json.NewEncoder(w).Encode(map[string]any{
"access_token": "id-jag-token-from-idp",
"issued_token_type": oauthex.TokenTypeIDJAG,
"token_type": "N_A",
@ -375,7 +375,7 @@ func setupMCPAuthServer(t *testing.T) *httptest.Server {
// OAuth metadata endpoint - uses closure to get server URL
mux.HandleFunc("/.well-known/oauth-authorization-server", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]interface{}{
json.NewEncoder(w).Encode(map[string]any{
"issuer": server.URL,
"token_endpoint": server.URL + "/token",
"code_challenge_methods_supported": []string{"S256"},
@ -412,7 +412,7 @@ func setupMCPAuthServer(t *testing.T) *httptest.Server {
// Return access token
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]interface{}{
json.NewEncoder(w).Encode(map[string]any{
"access_token": "mcp_access_token_from_jwt_bearer",
"token_type": "Bearer",
"expires_in": 3600,
@ -480,7 +480,7 @@ func TestEnterpriseHandler_TokenSource_BeforeAuthorization(t *testing.T) {
AccessToken: "mock_access_token",
TokenType: "Bearer",
}
return token.WithExtra(map[string]interface{}{"id_token": "mock_id_token"}), nil
return token.WithExtra(map[string]any{"id_token": "mock_id_token"}), nil
},
})
if err != nil {