diff --git a/agent.codefly.yaml b/agent.codefly.yaml index d98bafc..803e6c2 100644 --- a/agent.codefly.yaml +++ b/agent.codefly.yaml @@ -4,7 +4,7 @@ name: object-storage version: 0.0.12 source: directory: . - agent: codefly.dev/go:0.0.56 + agent: codefly.dev/go:0.0.69 release: owner: workflow workflow: release.yml diff --git a/builder.go b/builder.go index 235cdbf..34b7cdb 100644 --- a/builder.go +++ b/builder.go @@ -281,7 +281,7 @@ func (s *Builder) CreateEndpoints(ctx context.Context) error { return s.Wool.Wrapf(err, "cannot load grpc api") } endpoint := s.Base.BaseEndpoint(standards.GRPC) - endpoint.Visibility = resources.VisibilityExternal + endpoint.Visibility = resources.VisibilityPrivate s.GrpcEndpoint, err = resources.NewAPI(ctx, endpoint, resources.ToGrpcAPI(grpc)) if err != nil { return s.Wool.Wrapf(err, "cannot create grpc endpoint") diff --git a/go.mod b/go.mod index 3145ff8..c5b7d6f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/codefly-dev/service-object-storage -go 1.27.0 +go 1.27.2 require ( cloud.google.com/go/storage v1.65.0 @@ -13,7 +13,7 @@ require ( github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.44 github.com/aws/aws-sdk-go-v2/service/s3 v1.107.3 github.com/aws/smithy-go v1.27.8 - github.com/codefly-dev/core v0.5.1 + github.com/codefly-dev/core v0.17.0 github.com/containerd/errdefs v1.0.0 github.com/docker/docker v28.5.2+incompatible github.com/gofrs/flock v0.13.1 @@ -141,8 +141,8 @@ require ( github.com/shoenig/go-m1cpu v0.2.1 // indirect github.com/spiffe/go-spiffe/v2 v2.7.0 // indirect github.com/tinylib/msgp v1.6.4 // indirect - github.com/tklauser/go-sysconf v0.3.16 // indirect - github.com/tklauser/numcpus v0.11.0 // indirect + github.com/tklauser/go-sysconf v0.4.0 // indirect + github.com/tklauser/numcpus v0.12.0 // indirect github.com/xlab/treeprint v1.2.0 // indirect github.com/yoheimuta/go-protoparser/v4 v4.14.2 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect @@ -160,7 +160,7 @@ require ( go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/crypto v0.57.0 // indirect golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.59.0 // indirect + golang.org/x/net v0.60.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sync v0.23.0 // indirect golang.org/x/sys v0.48.0 // indirect diff --git a/go.sum b/go.sum index ab9732c..0efb624 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,8 @@ github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= -github.com/codefly-dev/core v0.5.1 h1:iDoG1cIm28GhL6msVyTMgInHwV+an28HaaEbTNrnCLs= -github.com/codefly-dev/core v0.5.1/go.mod h1:uG0HQy5iWnkuWUPa1LbbiPfEgzuxi1SzEKwcFPC6eoA= +github.com/codefly-dev/core v0.17.0 h1:Ckhs4URD9ip/zY6WrWkBKHxavS81B6QxZzRkaTwv3dg= +github.com/codefly-dev/core v0.17.0/go.mod h1:dSSLXlN1AbnzWNvsseJYbJnAYcitUsPjaxFCsrwb8mw= github.com/codefly-dev/gortk v0.2.0 h1:7bOlS5valYz2zil+fZctQNcPCYBcPj86abcw9N8h1hQ= github.com/codefly-dev/gortk v0.2.0/go.mod h1:dDWUMFgAP063OCGhTEpV7FFUj9+zTcxxO/nV80VKEwg= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= @@ -372,10 +372,10 @@ github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWD github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/tinylib/msgp v1.6.4 h1:mOwYbyYDLPj35mkA2BjjYejgJk9BuHxDdvRnb6v2ZcQ= github.com/tinylib/msgp v1.6.4/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA= -github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= -github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= -github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= -github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= +github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU= +github.com/tklauser/go-sysconf v0.4.0/go.mod h1:8mTNWyog7H+MpKijp4VmKJAd2bbYQ2zuUwkYRbUArPI= +github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqob4= +github.com/tklauser/numcpus v0.12.0/go.mod h1:ABHeXzJnr/qqwguhClkZKT1/8VABcYrsyUiUGobwWJg= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= @@ -400,8 +400,8 @@ go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 h1:OFnwLJr+pF3iHrlGSzbxyuo6/6HyBlnlN1CWEJmBVcw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0/go.mod h1:716wFneO0ov19A2beH5hjfh9AK5z/VWNAtDijp1Y0/g= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0 h1:wVZXIWjQSeSmMoxF74LzAnpVQOAFDo3pPji9Y4SOFKc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0/go.mod h1:khvBS2IggMFNwZK/6lEeHg/W57h/IX6J4URh57fuI40= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0 h1:QBajQ2SrwQijzHyZbQlPsuIzpl/ll8DY6wPWsajeGcI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0/go.mod h1:08ZQLjrPLQ6R4kAXvuOvODEer5Yh4CoFvll5qB2BCI8= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.44.0 h1:hqxVTu/GtBF+vJ8d1fzW7fRxZFvgoDjWcxwwCaFDYpU= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.44.0/go.mod h1:z5fVEF4X5v0ESvlJqBrrFlBVoj5EQuefZpzsu7R+x5Q= go.opentelemetry.io/otel/metric v1.46.0 h1:yBnkXvgV7AXFILZc5K6IZe/CBFF3OS7BJ8ov6/lj0K8= @@ -428,8 +428,8 @@ golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//D golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= -golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues= -golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= diff --git a/main.go b/main.go index 6c76b02..dade045 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,7 @@ import ( "google.golang.org/grpc/status" "github.com/codefly-dev/core/agents" + "github.com/codefly-dev/core/agents/contract" "github.com/codefly-dev/core/agents/services" "github.com/codefly-dev/core/builders" basev0 "github.com/codefly-dev/core/generated/go/codefly/base/v0" @@ -206,7 +207,7 @@ func (s *Service) GetAgentInformation(ctx context.Context, _ *agentv0.AgentInfor if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - return services.Advertisement{ + advertisement := services.Advertisement{ Backends: runnersbase.BackendSupport{Docker: true}, ReadMe: readme, Config: []*agentv0.ConfigurationValueDetail{ @@ -219,7 +220,13 @@ func (s *Service) GetAgentInformation(ctx context.Context, _ *agentv0.AgentInfor }, }, }, - }.Build(), nil + }.Build() + // The deployment path is core's DeployKustomize, which judges dependency + // edges with the request's composition provenance on this core; the host + // requires the live advertisement, not the linked core version. + advertisement.Contract = contract.Current() + advertisement.Contract.Capabilities = append(advertisement.Contract.Capabilities, contract.DeploymentCompositionProvenance) + return advertisement, nil } // resolveServingGRPCEndpoint selects the single gRPC endpoint the agent binds diff --git a/minio_custody_test.go b/minio_custody_test.go index ce197d7..73dad8f 100644 --- a/minio_custody_test.go +++ b/minio_custody_test.go @@ -321,7 +321,10 @@ func TestMinIOProvisioningCommit(t *testing.T) { // probe's write is refused) is rejected after the real Docker probe protocol // and before a lock, a custody record or retained data exists. func TestMinIORejectsUserMappingBeforeCustodyMutation(t *testing.T) { - home := t.TempDir() + // Canonical: the mount source the runtime reports is symlink-resolved, and + // macOS keeps TempDir under /var → /private/var. + home, err := filepath.EvalSymlinks(t.TempDir()) + require.NoError(t, err) t.Setenv("CODEFLY_HOME", home) // Short independent socket path fits Darwin's sockaddr_un limit. socketDir, err := os.MkdirTemp("/tmp", "sos27-daemon-") diff --git a/provenance_contract_test.go b/provenance_contract_test.go new file mode 100644 index 0000000..84f03b3 --- /dev/null +++ b/provenance_contract_test.go @@ -0,0 +1,28 @@ +package main + +import ( + "context" + "slices" + "testing" + + "github.com/codefly-dev/core/agents/contract" + agentv0 "github.com/codefly-dev/core/generated/go/codefly/services/agent/v0" +) + +// TestAdvertisementAdoptsDeploymentCompositionProvenance: the host requires the +// live contract capability before it trusts this agent to judge a deployment's +// dependency edges with the request's composition provenance (core#752). The +// deployment path here is core's DeployKustomize, which does; the +// advertisement must say so, and keep the base contract it extends. +func TestAdvertisementAdoptsDeploymentCompositionProvenance(t *testing.T) { + info, err := NewService().GetAgentInformation(context.Background(), &agentv0.AgentInformationRequest{}) + if err != nil { + t.Fatalf("GetAgentInformation: %v", err) + } + if !slices.Contains(info.GetContract().GetCapabilities(), contract.DeploymentCompositionProvenance) { + t.Fatalf("contract capabilities %v do not advertise %s", info.GetContract().GetCapabilities(), contract.DeploymentCompositionProvenance) + } + if err := contract.Check(info.GetContract(), contract.ContainerRecoveryScope); err != nil { + t.Fatalf("the base contract is no longer satisfied: %v", err) + } +}