Skip to content

Commit 891cc51

Browse files
committed
refactor: comment on registry_types
1 parent f2130f2 commit 891cc51

File tree

15 files changed

+61
-40
lines changed

15 files changed

+61
-40
lines changed

lint

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://taskfile.dev
2+
3+
version: '3'
4+
5+
vars:
6+
GREETING: Hello, World!
7+
8+
tasks:
9+
default:
10+
cmds:
11+
- echo "{{.GREETING}}"
12+
silent: true

pkg/api/v1/workload_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ type updateRequest struct {
6969
Group string `json:"group,omitempty"`
7070

7171
// Remote server specific fields
72-
URL string `json:"url,omitempty"`
73-
OAuthConfig remoteOAuthConfig `json:"oauth_config,omitempty"`
74-
Headers []*registry.Header `json:"headers,omitempty"`
72+
URL string `json:"url,omitempty"`
73+
OAuthConfig remoteOAuthConfig `json:"oauth_config,omitempty"`
74+
Headers []*registry.Header `json:"headers,omitempty"`
7575
}
7676

7777
// toolOverride represents a tool override

pkg/auth/remote/config.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ func (r *Config) UnmarshalJSON(data []byte) error {
5656
if _, isOld := raw["ClientID"]; isOld {
5757
// Unmarshal using old PascalCase format
5858
var oldFormat struct {
59-
ClientID string `json:"ClientID,omitempty"`
60-
ClientSecret string `json:"ClientSecret,omitempty"`
61-
ClientSecretFile string `json:"ClientSecretFile,omitempty"`
62-
Scopes []string `json:"Scopes,omitempty"`
63-
SkipBrowser bool `json:"SkipBrowser,omitempty"`
64-
Timeout time.Duration `json:"Timeout,omitempty"`
65-
CallbackPort int `json:"CallbackPort,omitempty"`
66-
UsePKCE bool `json:"UsePKCE,omitempty"`
67-
Issuer string `json:"Issuer,omitempty"`
68-
AuthorizeURL string `json:"AuthorizeURL,omitempty"`
69-
TokenURL string `json:"TokenURL,omitempty"`
70-
Headers []*registry.Header `json:"Headers,omitempty"`
71-
EnvVars []*registry.EnvVar `json:"EnvVars,omitempty"`
72-
OAuthParams map[string]string `json:"OAuthParams,omitempty"`
59+
ClientID string `json:"ClientID,omitempty"`
60+
ClientSecret string `json:"ClientSecret,omitempty"`
61+
ClientSecretFile string `json:"ClientSecretFile,omitempty"`
62+
Scopes []string `json:"Scopes,omitempty"`
63+
SkipBrowser bool `json:"SkipBrowser,omitempty"`
64+
Timeout time.Duration `json:"Timeout,omitempty"`
65+
CallbackPort int `json:"CallbackPort,omitempty"`
66+
UsePKCE bool `json:"UsePKCE,omitempty"`
67+
Issuer string `json:"Issuer,omitempty"`
68+
AuthorizeURL string `json:"AuthorizeURL,omitempty"`
69+
TokenURL string `json:"TokenURL,omitempty"`
70+
Headers []*registry.Header `json:"Headers,omitempty"`
71+
EnvVars []*registry.EnvVar `json:"EnvVars,omitempty"`
72+
OAuthParams map[string]string `json:"OAuthParams,omitempty"`
7373
}
7474

7575
if err := json.Unmarshal(data, &oldFormat); err != nil {

pkg/container/verifier/verifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
"github.com/stacklok/toolhive/pkg/container/images"
1515
"github.com/stacklok/toolhive/pkg/logger"
16-
"github.com/stacklok/toolhive/pkg/registry/registry"
16+
"github.com/stacklok/toolhive/pkg/registry/registry"
1717
)
1818

1919
const (

pkg/mcp/server/search_registry.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66

77
"github.com/mark3labs/mcp-go/mcp"
8+
89
types "github.com/stacklok/toolhive/pkg/registry/registry"
910
)
1011

pkg/registry/converters/converters_fixture_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import (
77
"testing"
88

99
upstream "github.com/modelcontextprotocol/registry/pkg/api/v0"
10-
types "github.com/stacklok/toolhive/pkg/registry/registry"
1110
"github.com/stretchr/testify/assert"
1211
"github.com/stretchr/testify/require"
12+
13+
types "github.com/stacklok/toolhive/pkg/registry/registry"
1314
)
1415

1516
// TestConverters_Fixtures validates converter functions using JSON fixture files

pkg/registry/converters/converters_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import (
66

77
upstream "github.com/modelcontextprotocol/registry/pkg/api/v0"
88
"github.com/modelcontextprotocol/registry/pkg/model"
9-
types "github.com/stacklok/toolhive/pkg/registry/registry"
109
"github.com/stretchr/testify/assert"
1110
"github.com/stretchr/testify/require"
11+
12+
types "github.com/stacklok/toolhive/pkg/registry/registry"
1213
)
1314

1415
// Test Helpers

pkg/registry/converters/envvar_extraction_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import (
44
"testing"
55

66
"github.com/modelcontextprotocol/registry/pkg/model"
7-
types "github.com/stacklok/toolhive/pkg/registry/registry"
87
"github.com/stretchr/testify/assert"
98
"github.com/stretchr/testify/require"
9+
10+
types "github.com/stacklok/toolhive/pkg/registry/registry"
1011
)
1112

1213
// Test extracting environment variables from runtime arguments (-e flags)

pkg/registry/converters/integration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
"testing"
1010

1111
upstream "github.com/modelcontextprotocol/registry/pkg/api/v0"
12-
types "github.com/stacklok/toolhive/pkg/registry/registry"
1312
"github.com/stretchr/testify/require"
13+
14+
types "github.com/stacklok/toolhive/pkg/registry/registry"
1415
)
1516

1617
// ToolHiveRegistry represents the structure of registry.json

pkg/registry/converters/registry_converters_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import (
66

77
upstreamv0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
88
"github.com/modelcontextprotocol/registry/pkg/model"
9-
types "github.com/stacklok/toolhive/pkg/registry/registry"
109
"github.com/stretchr/testify/assert"
1110
"github.com/stretchr/testify/require"
11+
12+
types "github.com/stacklok/toolhive/pkg/registry/registry"
1213
)
1314

1415
func TestNewUpstreamRegistryFromToolhiveRegistry(t *testing.T) {

0 commit comments

Comments
 (0)