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
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ endpoints:
access: read-only
enforcement: enforce
binaries:
- "**/git"
- "**/pre-commit"
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ endpoints:
protocol: rest
access: read-only
enforcement: enforce
allow_encoded_slash: true
- host: registry.yarnpkg.com
port: 443
protocol: rest
access: read-only
enforcement: enforce
allow_encoded_slash: true
- host: pypi.org
port: 443
protocol: rest
Expand Down Expand Up @@ -51,5 +53,7 @@ binaries:
- "**/python"
- "**/python3"
- "**/python3.*"
- "**/uv"
- "**/uvx"
- "**/go"
- "**/pre-commit"
55 changes: 55 additions & 0 deletions internal/scaffold/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,61 @@ func TestScaffoldGitHubROProfile_GraphQLEndpoint(t *testing.T) {
"scaffold fullsend-github-ro profile must include exactly one GraphQL endpoint for api.github.com")
}

func TestScaffoldPackageRegistriesProfile_Permissions(t *testing.T) {
data, err := FullsendRepoFile("profiles/fullsend-package-registries.yaml")
require.NoError(t, err)

var profile struct {
Endpoints []struct {
Host string `yaml:"host"`
AllowEncodedSlash bool `yaml:"allow_encoded_slash"`
} `yaml:"endpoints"`
Binaries []string `yaml:"binaries"`
}
require.NoError(t, yaml.Unmarshal(data, &profile))

// The embedded copy is the authoritative definition of this built-in
// provider, so it must keep the permissions the fullsend-ai/agents copy
// has. Scoped npm package metadata requests use a %2F-encoded slash,
// which the proxy rejects unless allow_encoded_slash is set. See #8007.
encodedSlash := map[string]bool{}
for _, ep := range profile.Endpoints {
encodedSlash[ep.Host] = ep.AllowEncodedSlash
}
npmHosts := map[string]bool{"registry.npmjs.org": true, "registry.yarnpkg.com": true}
for host := range npmHosts {
require.Contains(t, encodedSlash, host,
"scaffold package-registries profile must include endpoint %s", host)
}
require.Contains(t, encodedSlash, "pypi.org",
"scaffold package-registries profile must include endpoint pypi.org")
// allow_encoded_slash is scoped to the npm registries only.
for host, allowed := range encodedSlash {
assert.Equal(t, npmHosts[host], allowed,
"endpoint %s: allow_encoded_slash must be set exactly on the npm registries", host)
}

for _, bin := range []string{"**/uv", "**/uvx"} {
assert.Contains(t, profile.Binaries, bin,
"scaffold package-registries profile must allow binary %s", bin)
}
}

func TestScaffoldGitleaksProfile_Permissions(t *testing.T) {
data, err := FullsendRepoFile("profiles/fullsend-gitleaks.yaml")
require.NoError(t, err)

var profile struct {
Binaries []string `yaml:"binaries"`
}
require.NoError(t, yaml.Unmarshal(data, &profile))

// pre-commit uses git to clone the gitleaks hook repository from
// github.com; the fullsend-ai/agents copy allowed it. See #8007.
assert.Contains(t, profile.Binaries, "**/git",
"scaffold gitleaks profile must allow binary **/git")
}

func TestScaffoldVertexProfile_BinaryAllowlist(t *testing.T) {
data, err := FullsendRepoFile("profiles/fullsend-vertex-ai.yaml")
require.NoError(t, err)
Expand Down
Loading