Skip to content

Commit 4c95ba8

Browse files
frristclaude
andcommitted
Merge origin/main; re-pin libforge at main head (includes #49)
Main's libforge bump (7/24) predates the libforge#49 merge (7/27), so resolve go.mod/go.sum by pinning v0.0.0-20260727220215-5e299c46f62f β€” libforge#49's merge commit β€” as the PR description planned. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 parents 57c38ef + 50cd990 commit 4c95ba8

6 files changed

Lines changed: 29 additions & 25 deletions

File tree

β€Žconfig.example.yamlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ deployment:
2424
# allow users to have multiple copies of their data.
2525
max_replicas: 3
2626
# did:plc directory endpoint used to resolve did:plc issuers (e.g. tenants
27-
# invoking /provider/add during bucket provisioning). Empty disables
28-
# did:plc resolution.
27+
# invoking /provider/add during bucket provisioning). Defaults to
28+
# https://plc.directory when omitted or empty.
2929
# plc_directory: "https://plc.directory"
3030

3131
server:

β€Žgo.modβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.3
1212
github.com/aws/aws-sdk-go-v2/service/s3 v1.96.4
1313
github.com/docker/docker v28.5.2+incompatible
14-
github.com/fil-forge/libforge v0.0.0-20260723212548-3e5e6ba95711
14+
github.com/fil-forge/libforge v0.0.0-20260727220215-5e299c46f62f
1515
github.com/fil-forge/ucantone v0.0.0-20260713122829-2662bddc02ab
1616
github.com/google/uuid v1.6.0
1717
github.com/ipfs/go-cid v0.6.1

β€Žgo.sumβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/
9292
github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
9393
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
9494
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
95-
github.com/fil-forge/libforge v0.0.0-20260723212548-3e5e6ba95711 h1:xO5gwfL3W2wqaLvwFUDj4MuWX9wHK9TGV8F3jFe/mZM=
96-
github.com/fil-forge/libforge v0.0.0-20260723212548-3e5e6ba95711/go.mod h1:0kXihIQ4L2uZ00nR5XrZ/Y8Db7Ht/qQNuiWslwMJ95M=
95+
github.com/fil-forge/libforge v0.0.0-20260727220215-5e299c46f62f h1:QzgMg8GIE4IhgOE/7DBHFU/4T5oU7J4vAKxbUPKJPGA=
96+
github.com/fil-forge/libforge v0.0.0-20260727220215-5e299c46f62f/go.mod h1:0kXihIQ4L2uZ00nR5XrZ/Y8Db7Ht/qQNuiWslwMJ95M=
9797
github.com/fil-forge/ucantone v0.0.0-20260713122829-2662bddc02ab h1:Kal5frXuFQiaeumu1DreTbaXmK6DXWfz7al4FFhAh4A=
9898
github.com/fil-forge/ucantone v0.0.0-20260713122829-2662bddc02ab/go.mod h1:oFY5BfD0bDeodGlbBHh3/nK99MAS93rGXjoQz7s5qgE=
9999
github.com/filecoin-project/go-data-segment v0.0.1 h1:1wmDxOG4ubWQm3ZC1XI5nCon5qgSq7Ra3Rb6Dbu10Gs=

β€Žinternal/config/config.goβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type DeploymentConfig struct {
4141
InsecureDIDResolution bool `mapstructure:"insecure_did_resolution" toml:"insecure_did_resolution,omitempty"`
4242
// PLCDirectory is the did:plc directory endpoint used to resolve did:plc
4343
// issuers (e.g. tenants invoking /provider/add during bucket
44-
// provisioning). Empty disables did:plc resolution.
44+
// provisioning). Empty or omitted uses the default (https://plc.directory).
4545
PLCDirectory string `mapstructure:"plc_directory" toml:"plc_directory,omitempty"`
4646
}
4747

β€Žinternal/config/config_test.goβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ var envOnlyCases = []struct {
3838
func(c *Config) any { return c.Deployment.MaxReplicas }, uint(7)},
3939
{"deployment.insecure_did_resolution", "SPRUE_DEPLOYMENT_INSECURE_DID_RESOLUTION", "true",
4040
func(c *Config) any { return c.Deployment.InsecureDIDResolution }, true},
41+
{"deployment.plc_directory", "SPRUE_DEPLOYMENT_PLC_DIRECTORY", "https://plc.example.com",
42+
func(c *Config) any { return c.Deployment.PLCDirectory }, "https://plc.example.com"},
4143
{"identity.service_did", "SPRUE_IDENTITY_SERVICE_DID", "did:web:upload",
4244
func(c *Config) any { return c.Identity.ServiceDID }, "did:web:upload"},
4345
{"identity.private_key", "SPRUE_IDENTITY_PRIVATE_KEY", "YOUR_KEY_HERE",

β€Žpkg/service/service.goβ€Ž

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/fil-forge/sprue/pkg/service/ui"
1616
"github.com/fil-forge/sprue/pkg/store/agent"
1717
delegation_store "github.com/fil-forge/sprue/pkg/store/delegation"
18-
"github.com/fil-forge/ucantone/did"
1918
"github.com/fil-forge/ucantone/did/key"
2019
"github.com/fil-forge/ucantone/did/plc"
2120
"github.com/fil-forge/ucantone/did/resolver"
@@ -35,6 +34,10 @@ import (
3534
"go.uber.org/zap"
3635
)
3736

37+
// DefaultPLCDirectory is the did:plc directory endpoint used when none is
38+
// configured.
39+
const DefaultPLCDirectory = "https://plc.directory"
40+
3841
type serviceConfig struct {
3942
serverOptions []server.HTTPOption
4043
insecureDIDResolution bool
@@ -60,7 +63,7 @@ func WithInsecureDIDResolution(enabled bool) Option {
6063

6164
// WithPLCDirectory sets the did:plc directory endpoint used to resolve
6265
// did:plc issuers (e.g. tenants invoking /provider/add during bucket
63-
// provisioning). Empty leaves did:plc unresolvable.
66+
// provisioning). Empty uses DefaultPLCDirectory.
6467
func WithPLCDirectory(directory string) Option {
6568
return func(c *serviceConfig) {
6669
c.plcDirectory = directory
@@ -113,21 +116,22 @@ func createUCANServer(id multikey.Issuer, agentStore agent.Store, handlers []ser
113116
return nil, fmt.Errorf("creating DID document for service identity: %w", err)
114117
}
115118

116-
// did:plc resolution is enabled when a directory endpoint is configured β€”
117-
// needed to verify did:plc issuers (e.g. tenants signing /provider/add
118-
// invocations during bucket provisioning).
119-
var plcResolver did.Resolver
120-
if cfg.plcDirectory != "" {
121-
u, err := url.Parse(cfg.plcDirectory)
122-
if err != nil {
123-
return nil, fmt.Errorf("parsing PLC directory URL %q: %w", cfg.plcDirectory, err)
124-
}
125-
p, err := plc.NewResolver(*u)
126-
if err != nil {
127-
return nil, fmt.Errorf("creating did:plc resolver: %w", err)
128-
}
129-
plcResolver = resolver.NewCached(p, time.Hour*3)
119+
// did:plc resolution is always enabled β€” needed to verify did:plc issuers
120+
// (e.g. tenants signing /provider/add invocations during bucket
121+
// provisioning). An empty configured directory falls back to the default.
122+
plcDirectory := cfg.plcDirectory
123+
if plcDirectory == "" {
124+
plcDirectory = DefaultPLCDirectory
130125
}
126+
u, err := url.Parse(plcDirectory)
127+
if err != nil {
128+
return nil, fmt.Errorf("parsing PLC directory URL %q: %w", plcDirectory, err)
129+
}
130+
p, err := plc.NewResolver(*u)
131+
if err != nil {
132+
return nil, fmt.Errorf("creating did:plc resolver: %w", err)
133+
}
134+
plcResolver := resolver.NewCached(p, time.Hour*3)
131135

132136
resolver := resolver.ByMethod{
133137
"key": key.Resolver,
@@ -136,9 +140,7 @@ func createUCANServer(id multikey.Issuer, agentStore agent.Store, handlers []ser
136140
resolver.NewCached(webResolver, time.Hour*3),
137141
},
138142
"mailto": didmailto.NewResolver(id.DID()),
139-
}
140-
if plcResolver != nil {
141-
resolver["plc"] = plcResolver
143+
"plc": plcResolver,
142144
}
143145

144146
factories := validator.DefaultFactories()

0 commit comments

Comments
Β (0)