Apply gofmt formatting to all Go files (#588)
## Summary - Applied `gofmt -s -w` across the entire codebase to ensure consistent Go formatting - This will trigger a deployment with minimal code changes ## Test plan - [x] Pre-commit hooks pass - [x] No functional changes, formatting only 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2d49e5b68c
commit
8bd13d5ed7
27 changed files with 107 additions and 110 deletions
|
|
@ -308,7 +308,7 @@ func createServerJSON(
|
||||||
URL: repoURL,
|
URL: repoURL,
|
||||||
Source: repoSource,
|
Source: repoSource,
|
||||||
},
|
},
|
||||||
Version: version,
|
Version: version,
|
||||||
Packages: []model.Package{pkg},
|
Packages: []model.Package{pkg},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ func SetupIngressController(ctx *pulumi.Context, cluster *providers.ProviderInfo
|
||||||
Values: pulumi.Map{
|
Values: pulumi.Map{
|
||||||
"controller": pulumi.Map{
|
"controller": pulumi.Map{
|
||||||
"service": pulumi.Map{
|
"service": pulumi.Map{
|
||||||
"type": serviceType,
|
"type": serviceType,
|
||||||
"annotations": pulumi.Map{},
|
"annotations": pulumi.Map{},
|
||||||
},
|
},
|
||||||
"config": pulumi.Map{
|
"config": pulumi.Map{
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,6 @@ func TestDefaultHTTPKeyFetcher(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestHTTPAuthHandler_Permissions(t *testing.T) {
|
func TestHTTPAuthHandler_Permissions(t *testing.T) {
|
||||||
cfg := &config.Config{
|
cfg := &config.Config{
|
||||||
JWTPrivateKey: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
JWTPrivateKey: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
||||||
|
|
@ -738,4 +737,3 @@ func TestHTTPvsDNS_PermissionDifferences(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,8 @@ func RegisterEditEndpoints(api huma.API, registry service.RegistryService, cfg *
|
||||||
|
|
||||||
// Prevent undeleting servers - once deleted, they stay deleted
|
// Prevent undeleting servers - once deleted, they stay deleted
|
||||||
if currentServer.Meta.Official != nil &&
|
if currentServer.Meta.Official != nil &&
|
||||||
currentServer.Meta.Official.Status == model.StatusDeleted &&
|
currentServer.Meta.Official.Status == model.StatusDeleted &&
|
||||||
newStatus != model.StatusDeleted {
|
newStatus != model.StatusDeleted {
|
||||||
return nil, huma.Error400BadRequest("Cannot change status of deleted server. Deleted servers cannot be undeleted.")
|
return nil, huma.Error400BadRequest("Cannot change status of deleted server. Deleted servers cannot be undeleted.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,9 +162,9 @@ func TestPublishIntegration(t *testing.T) {
|
||||||
|
|
||||||
t.Run("publish fails with invalid token", func(t *testing.T) {
|
t.Run("publish fails with invalid token", func(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "io.github.domdomegg/test-server",
|
Name: "io.github.domdomegg/test-server",
|
||||||
Description: "Test server",
|
Description: "Test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := json.Marshal(publishReq)
|
body, err := json.Marshal(publishReq)
|
||||||
|
|
@ -185,7 +185,7 @@ func TestPublishIntegration(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "io.github.other/test-server",
|
Name: "io.github.other/test-server",
|
||||||
Description: "A test server",
|
Description: "A test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Repository: model.Repository{
|
Repository: model.Repository{
|
||||||
URL: "https://github.com/example/test-server",
|
URL: "https://github.com/example/test-server",
|
||||||
Source: "github",
|
Source: "github",
|
||||||
|
|
@ -221,7 +221,7 @@ func TestPublishIntegration(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "io.github.domdomegg/airtable-mcp-server",
|
Name: "io.github.domdomegg/airtable-mcp-server",
|
||||||
Description: "A test server with MCPB package",
|
Description: "A test server with MCPB package",
|
||||||
Version: "1.7.2",
|
Version: "1.7.2",
|
||||||
Packages: []model.Package{
|
Packages: []model.Package{
|
||||||
{
|
{
|
||||||
RegistryType: model.RegistryTypeMCPB,
|
RegistryType: model.RegistryTypeMCPB,
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "com.example/test-server-with-npm",
|
Name: "com.example/test-server-with-npm",
|
||||||
Description: "A test server with invalid npm package reference",
|
Description: "A test server with invalid npm package reference",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Packages: []model.Package{
|
Packages: []model.Package{
|
||||||
{
|
{
|
||||||
RegistryType: model.RegistryTypeNPM,
|
RegistryType: model.RegistryTypeNPM,
|
||||||
|
|
@ -88,7 +88,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "com.example/test-server-mcpb-validation",
|
Name: "com.example/test-server-mcpb-validation",
|
||||||
Description: "A test server with MCPB package and registry validation enabled",
|
Description: "A test server with MCPB package and registry validation enabled",
|
||||||
Version: "0.0.36",
|
Version: "0.0.36",
|
||||||
Packages: []model.Package{
|
Packages: []model.Package{
|
||||||
{
|
{
|
||||||
RegistryType: model.RegistryTypeMCPB,
|
RegistryType: model.RegistryTypeMCPB,
|
||||||
|
|
@ -138,7 +138,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "com.example/test-server-multiple-packages",
|
Name: "com.example/test-server-multiple-packages",
|
||||||
Description: "A test server with multiple packages where second fails",
|
Description: "A test server with multiple packages where second fails",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Packages: []model.Package{
|
Packages: []model.Package{
|
||||||
{
|
{
|
||||||
RegistryType: model.RegistryTypeMCPB,
|
RegistryType: model.RegistryTypeMCPB,
|
||||||
|
|
@ -189,7 +189,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
||||||
publishReq := apiv0.ServerJSON{
|
publishReq := apiv0.ServerJSON{
|
||||||
Name: "com.example/test-server-first-package-fails",
|
Name: "com.example/test-server-first-package-fails",
|
||||||
Description: "A test server where first package fails",
|
Description: "A test server where first package fails",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Packages: []model.Package{
|
Packages: []model.Package{
|
||||||
{
|
{
|
||||||
RegistryType: model.RegistryTypeNPM,
|
RegistryType: model.RegistryTypeNPM,
|
||||||
|
|
|
||||||
|
|
@ -113,9 +113,9 @@ func TestPublishEndpoint(t *testing.T) {
|
||||||
{
|
{
|
||||||
name: "invalid authorization header format",
|
name: "invalid authorization header format",
|
||||||
requestBody: apiv0.ServerJSON{
|
requestBody: apiv0.ServerJSON{
|
||||||
Name: "io.github.domdomegg/test-server",
|
Name: "io.github.domdomegg/test-server",
|
||||||
Description: "Test server",
|
Description: "Test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
},
|
},
|
||||||
authHeader: "InvalidFormat",
|
authHeader: "InvalidFormat",
|
||||||
setupRegistryService: func(_ service.RegistryService) {
|
setupRegistryService: func(_ service.RegistryService) {
|
||||||
|
|
@ -129,7 +129,7 @@ func TestPublishEndpoint(t *testing.T) {
|
||||||
requestBody: apiv0.ServerJSON{
|
requestBody: apiv0.ServerJSON{
|
||||||
Name: "test-server",
|
Name: "test-server",
|
||||||
Description: "A test server",
|
Description: "A test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
},
|
},
|
||||||
authHeader: "Bearer invalidToken",
|
authHeader: "Bearer invalidToken",
|
||||||
setupRegistryService: func(_ service.RegistryService) {
|
setupRegistryService: func(_ service.RegistryService) {
|
||||||
|
|
@ -143,7 +143,7 @@ func TestPublishEndpoint(t *testing.T) {
|
||||||
requestBody: apiv0.ServerJSON{
|
requestBody: apiv0.ServerJSON{
|
||||||
Name: "io.github.other/test-server",
|
Name: "io.github.other/test-server",
|
||||||
Description: "A test server",
|
Description: "A test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Repository: model.Repository{
|
Repository: model.Repository{
|
||||||
URL: "https://github.com/example/test-server",
|
URL: "https://github.com/example/test-server",
|
||||||
Source: "github",
|
Source: "github",
|
||||||
|
|
@ -167,7 +167,7 @@ func TestPublishEndpoint(t *testing.T) {
|
||||||
requestBody: apiv0.ServerJSON{
|
requestBody: apiv0.ServerJSON{
|
||||||
Name: "example/test-server",
|
Name: "example/test-server",
|
||||||
Description: "A test server",
|
Description: "A test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Repository: model.Repository{
|
Repository: model.Repository{
|
||||||
URL: "https://github.com/example/test-server",
|
URL: "https://github.com/example/test-server",
|
||||||
Source: "github",
|
Source: "github",
|
||||||
|
|
@ -185,7 +185,7 @@ func TestPublishEndpoint(t *testing.T) {
|
||||||
existingServer := apiv0.ServerJSON{
|
existingServer := apiv0.ServerJSON{
|
||||||
Name: "example/test-server",
|
Name: "example/test-server",
|
||||||
Description: "Existing test server",
|
Description: "Existing test server",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Repository: model.Repository{
|
Repository: model.Repository{
|
||||||
URL: "https://github.com/example/test-server-existing",
|
URL: "https://github.com/example/test-server-existing",
|
||||||
Source: "github",
|
Source: "github",
|
||||||
|
|
@ -202,7 +202,7 @@ func TestPublishEndpoint(t *testing.T) {
|
||||||
requestBody: apiv0.ServerJSON{
|
requestBody: apiv0.ServerJSON{
|
||||||
Name: "com.example/test-server-mcpb",
|
Name: "com.example/test-server-mcpb",
|
||||||
Description: "A test server with MCPB package",
|
Description: "A test server with MCPB package",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Packages: []model.Package{
|
Packages: []model.Package{
|
||||||
{
|
{
|
||||||
RegistryType: model.RegistryTypeMCPB,
|
RegistryType: model.RegistryTypeMCPB,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ type ServerVersionsInput struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterServersEndpoints registers all server-related endpoints
|
// RegisterServersEndpoints registers all server-related endpoints
|
||||||
|
//
|
||||||
//nolint:cyclop // Multiple endpoint registrations are inherently complex
|
//nolint:cyclop // Multiple endpoint registrations are inherently complex
|
||||||
func RegisterServersEndpoints(api huma.API, registry service.RegistryService) {
|
func RegisterServersEndpoints(api huma.API, registry service.RegistryService) {
|
||||||
// List servers endpoint
|
// List servers endpoint
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,15 @@ import (
|
||||||
// Config holds the application configuration
|
// Config holds the application configuration
|
||||||
// See .env.example for more documentation
|
// See .env.example for more documentation
|
||||||
type Config struct {
|
type Config struct {
|
||||||
ServerAddress string `env:"SERVER_ADDRESS" envDefault:":8080"`
|
ServerAddress string `env:"SERVER_ADDRESS" envDefault:":8080"`
|
||||||
DatabaseURL string `env:"DATABASE_URL" envDefault:"postgres://localhost:5432/mcp-registry?sslmode=disable"`
|
DatabaseURL string `env:"DATABASE_URL" envDefault:"postgres://localhost:5432/mcp-registry?sslmode=disable"`
|
||||||
SeedFrom string `env:"SEED_FROM" envDefault:""`
|
SeedFrom string `env:"SEED_FROM" envDefault:""`
|
||||||
Version string `env:"VERSION" envDefault:"dev"`
|
Version string `env:"VERSION" envDefault:"dev"`
|
||||||
GithubClientID string `env:"GITHUB_CLIENT_ID" envDefault:""`
|
GithubClientID string `env:"GITHUB_CLIENT_ID" envDefault:""`
|
||||||
GithubClientSecret string `env:"GITHUB_CLIENT_SECRET" envDefault:""`
|
GithubClientSecret string `env:"GITHUB_CLIENT_SECRET" envDefault:""`
|
||||||
JWTPrivateKey string `env:"JWT_PRIVATE_KEY" envDefault:""`
|
JWTPrivateKey string `env:"JWT_PRIVATE_KEY" envDefault:""`
|
||||||
EnableAnonymousAuth bool `env:"ENABLE_ANONYMOUS_AUTH" envDefault:"false"`
|
EnableAnonymousAuth bool `env:"ENABLE_ANONYMOUS_AUTH" envDefault:"false"`
|
||||||
EnableRegistryValidation bool `env:"ENABLE_REGISTRY_VALIDATION" envDefault:"true"`
|
EnableRegistryValidation bool `env:"ENABLE_REGISTRY_VALIDATION" envDefault:"true"`
|
||||||
|
|
||||||
// OIDC Configuration
|
// OIDC Configuration
|
||||||
OIDCEnabled bool `env:"OIDC_ENABLED" envDefault:"false"`
|
OIDCEnabled bool `env:"OIDC_ENABLED" envDefault:"false"`
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ func TestPostgreSQL_CreateServer(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
serverJSON *apiv0.ServerJSON
|
serverJSON *apiv0.ServerJSON
|
||||||
officialMeta *apiv0.RegistryExtensions
|
officialMeta *apiv0.RegistryExtensions
|
||||||
expectError bool
|
expectError bool
|
||||||
errorType error
|
errorType error
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "successful server creation",
|
name: "successful server creation",
|
||||||
|
|
@ -285,13 +285,13 @@ func TestPostgreSQL_ListServers(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
filter *database.ServerFilter
|
filter *database.ServerFilter
|
||||||
cursor string
|
cursor string
|
||||||
limit int
|
limit int
|
||||||
expectedCount int
|
expectedCount int
|
||||||
expectedNames []string
|
expectedNames []string
|
||||||
expectError bool
|
expectError bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "list all servers",
|
name: "list all servers",
|
||||||
|
|
@ -418,12 +418,12 @@ func TestPostgreSQL_UpdateServer(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
serverName string
|
serverName string
|
||||||
version string
|
version string
|
||||||
updatedServer *apiv0.ServerJSON
|
updatedServer *apiv0.ServerJSON
|
||||||
expectError bool
|
expectError bool
|
||||||
errorType error
|
errorType error
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "successful server update",
|
name: "successful server update",
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue