Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/help/openapi-normalize/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"unicode"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

var requiredFields = map[string][]string{
Expand Down
2 changes: 1 addition & 1 deletion cmd/help/openapi-normalize/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

func TestNormalizeJSONAndYAMLDeterministically(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/thv-operator/app/warning_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"k8s.io/client-go/rest"
crtlog "sigs.k8s.io/controller-runtime/pkg/log"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/thv-operator/controllers/virtualmcpserver_vmcpconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
stderrors "errors"
"fmt"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -98,7 +98,7 @@ func (r *VirtualMCPServerReconciler) ensureVmcpConfigConfigMap(
}

// Marshal the serializable Config to YAML for storage in ConfigMap.
// Note: gopkg.in/yaml.v3 produces deterministic output by sorting map keys alphabetically.
// Note: go.yaml.in/yaml/v3 produces deterministic output by sorting map keys alphabetically.
// This ensures stable checksums for triggering pod rollouts only when content actually changes.
vmcpConfigYAML, err := yaml.Marshal(config)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion cmd/thv/app/llm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/client"
"github.com/stacklok/toolhive/pkg/config"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ require (
go.starlark.net v0.0.0-20260908191801-89a6a09411d5
go.uber.org/mock v0.6.0
go.uber.org/zap v1.28.0
go.yaml.in/yaml/v3 v3.0.5
golang.ngrok.com/ngrok/v2 v2.2.1
golang.org/x/crypto v0.58.0
golang.org/x/exp/jsonrpc2 v0.0.0-20261014143641-f0251eb4aa3e
Expand Down Expand Up @@ -326,7 +327,6 @@ require (
go.uber.org/atomic v1.12.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.ngrok.com/muxado/v2 v2.0.1 // indirect
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e // indirect
golang.org/x/exp/event v0.0.0-20261009195045-ca0d7ba23607 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1/registry_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/config"
"github.com/stacklok/toolhive/pkg/registry"
Expand Down
2 changes: 1 addition & 1 deletion pkg/authserver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

servercrypto "github.com/stacklok/toolhive/pkg/authserver/server/crypto"
"github.com/stacklok/toolhive/pkg/authserver/server/keys"
Expand Down
2 changes: 1 addition & 1 deletion pkg/authserver/inbound_grants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/authserver/server/tokenexchange"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/authserver/runner/embeddedauthserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/ory/fosite"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/authserver"
servercrypto "github.com/stacklok/toolhive/pkg/authserver/server/crypto"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/pelletier/go-toml/v2"
"github.com/tailscale/hujson"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/llmgateway"
"github.com/stacklok/toolhive/pkg/transport/types"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/config_editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
"github.com/pelletier/go-toml/v2"
"github.com/tailscale/hujson"
"github.com/tidwall/gjson"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/fileutils"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/config_editor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/tidwall/gjson"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

func TestUpsertMCPServer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"time"

"github.com/adrg/xdg"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive-core/env"
"github.com/stacklok/toolhive/pkg/container/templates"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive-core/env/mocks"
"github.com/stacklok/toolhive/pkg/secrets"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

func TestNewDefaultProvider(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/json/any.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
stdjson "encoding/json"
"fmt"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

// Data stores JSON-compatible data of type T. It supports both JSON and YAML
Expand Down
2 changes: 1 addition & 1 deletion pkg/llm/manage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/secrets"
secretsmocks "github.com/stacklok/toolhive/pkg/secrets/mocks"
Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"net/url"

v0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/registry/auth"
"github.com/stacklok/toolhive/pkg/versions"
Expand Down
65 changes: 65 additions & 0 deletions pkg/registry/api/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// SPDX-FileCopyrightText: Copyright 2025 Stacklok, Inc.
// SPDX-License-Identifier: Apache-2.0

package api

import (
"net/http"
"net/http/httptest"
"testing"

"github.com/stretchr/testify/require"
)

func TestClient_ValidateEndpoint(t *testing.T) {
t.Parallel()

tests := []struct {
name string
body string
wantErr bool
}{
{
name: "valid registry spec",
body: "info:\n version: 1.0.0\n description: See https://github.com/modelcontextprotocol/registry\n",
},
{
name: "wrong version",
body: "info:\n version: 2.0.0\n description: See https://github.com/modelcontextprotocol/registry\n",
wantErr: true,
},
{
name: "missing info section",
body: "openapi: 3.0.0\n",
wantErr: true,
},
{
// Mapping-valued key combined with a merge key panicked gopkg.in/yaml.v3.
name: "merge key with mapping-valued key",
body: "? {a: b}\n: c\n<<: {name: x}\n",
wantErr: true,
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
require.Equal(t, "/openapi.yaml", r.URL.Path)
_, _ = w.Write([]byte(tt.body))
}))
t.Cleanup(server.Close)

client, err := NewClient(server.URL, true, nil)
require.NoError(t, err)

err = client.ValidateEndpoint(t.Context())
if tt.wantErr {
require.Error(t, err)
return
}
require.NoError(t, err)
})
}
}
2 changes: 1 addition & 1 deletion pkg/registry/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/config"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive-core/permissions"
regtypes "github.com/stacklok/toolhive-core/registry/types"
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

v1beta1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1beta1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/session_tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

v1beta1 "github.com/stacklok/toolhive/cmd/thv-operator/api/v1beta1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/skills/lockfile/lockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"slices"
"strings"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/fileutils"
"github.com/stacklok/toolhive/pkg/skills"
Expand Down
2 changes: 1 addition & 1 deletion pkg/transport/tunnel/ngrok/tunnel_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"path/filepath"
"strings"

"go.yaml.in/yaml/v3"
"golang.ngrok.com/ngrok/v2"
"gopkg.in/yaml.v3"
)

// TunnelProvider implements the TunnelProvider interface for ngrok.
Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/cli/auth_server_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

authserverconfig "github.com/stacklok/toolhive/pkg/authserver"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/vmcp/cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"strings"
"text/template"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

groupval "github.com/stacklok/toolhive-core/validation/group"
"github.com/stacklok/toolhive/pkg/fileutils"
Expand Down Expand Up @@ -131,7 +131,7 @@ func Init(ctx context.Context, cfg InitConfig) error {
}

// yamlScalar marshals a string to a properly quoted/escaped YAML scalar value
// using gopkg.in/yaml.v3, ensuring characters like '#' or ':' in names and
// using go.yaml.in/yaml/v3, ensuring characters like '#' or ':' in names and
// URLs do not corrupt the rendered YAML.
func yamlScalar(v string) (string, error) {
b, err := yaml.Marshal(v)
Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/cli/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"time"

"go.opentelemetry.io/otel/trace"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"k8s.io/client-go/rest"

"github.com/stacklok/toolhive-core/env"
Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/cli/serve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

authserverconfig "github.com/stacklok/toolhive/pkg/authserver"
authserverrunner "github.com/stacklok/toolhive/pkg/authserver/runner"
Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/config/crd_cli_roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive-core/env/mocks"
thvjson "github.com/stacklok/toolhive/pkg/json"
Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/config/session_tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive/pkg/redisconfig"
"github.com/stacklok/toolhive/pkg/vmcp"
Expand Down
2 changes: 1 addition & 1 deletion pkg/vmcp/config/yaml_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"time"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"

"github.com/stacklok/toolhive-core/env"
authtypes "github.com/stacklok/toolhive/pkg/vmcp/auth/types"
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"path/filepath"
"strings"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

// FileConfig is the top-level structure for a webhook configuration file.
Expand Down
Loading
Loading