From 77e2807de649d5fd14525ec585e9403fb84ebecf Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Fri, 20 Nov 2026 16:45:53 +0000 Subject: [PATCH] feat: let the did:web resolver cache DID documents The 24-hour cache around did:web resolution is removed. The ucantone resolver now caches documents itself, for as long as the host says or five minutes when it does not, and then revalidates. Co-Authored-By: Claude Fable 5.2 --- go.mod | 2 +- go.sum | 4 ++-- pkg/ucanhandlers/ucanfx/fx.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index c6215170..ac1ce2f3 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/fil-forge/go-ipni-tools v0.0.0-20261023132922-7d9dcd4e2d96 github.com/fil-forge/libforge v0.0.0-20261111172920-ff407324a982 github.com/fil-forge/piri-signing-service v0.0.0-20260801143551-d7c06ad1d899 - github.com/fil-forge/ucantone v0.0.0-20261120104359-4253712d41e4 + github.com/fil-forge/ucantone v0.0.0-20261120160831-cf6c452a3cd7 github.com/filecoin-project/curio v1.29.3 github.com/filecoin-project/go-address v1.2.0 github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20240802040721-2a04ffc8ffe8 diff --git a/go.sum b/go.sum index f350f9dc..82d2c672 100644 --- a/go.sum +++ b/go.sum @@ -555,8 +555,8 @@ github.com/fil-forge/libforge v0.0.0-20261111172920-ff407324a982 h1:dguWFiI+Dyus github.com/fil-forge/libforge v0.0.0-20261111172920-ff407324a982/go.mod h1:ZtPwUgXm7gqQSmjmIcfMy5AwWpFIR02WMZvbgNOwi/4= github.com/fil-forge/piri-signing-service v0.0.0-20260801143551-d7c06ad1d899 h1:5dV7QmNHHA5JZLIGikLJJsmB/sdmqzyTgr75ivInfVY= github.com/fil-forge/piri-signing-service v0.0.0-20260801143551-d7c06ad1d899/go.mod h1:6Xzvs1sZrikN3GygCV2I96dnbzy1xuCtitPMme/TjZU= -github.com/fil-forge/ucantone v0.0.0-20261120104359-4253712d41e4 h1:2hQIpdhNOu0QKY1rpdsYnJRtNG/0MklyETPraR/ms+Y= -github.com/fil-forge/ucantone v0.0.0-20261120104359-4253712d41e4/go.mod h1:PJe9Lcv+QWawlM29ItA9y5JzFIs37gZ3jODxYKXbQkM= +github.com/fil-forge/ucantone v0.0.0-20261120160831-cf6c452a3cd7 h1:3Bhat1RvTC2z3NMpy6l22C97VKQYp2dEBxY1SdJsW4I= +github.com/fil-forge/ucantone v0.0.0-20261120160831-cf6c452a3cd7/go.mod h1:PJe9Lcv+QWawlM29ItA9y5JzFIs37gZ3jODxYKXbQkM= github.com/filecoin-project/curio v1.29.3 h1:UFzo6zpTO+KarcUugqDJTXhF88XuXCfQdh2aoax1+Lo= github.com/filecoin-project/curio v1.29.3/go.mod h1:sjU79DniqrT63Ye1udRip6rX47SX96eo2qBboxvr9qY= github.com/filecoin-project/filecoin-ffi v1.37.0 h1:mv/1uLee2Y/Wx7zvi8sTC4m/bEtEBuaW1OwqPilBBu0= diff --git a/pkg/ucanhandlers/ucanfx/fx.go b/pkg/ucanhandlers/ucanfx/fx.go index 5b8e76f5..5c629ee5 100644 --- a/pkg/ucanhandlers/ucanfx/fx.go +++ b/pkg/ucanhandlers/ucanfx/fx.go @@ -125,7 +125,7 @@ func newDIDResolver(cfg app.UCANServiceConfig) (did.Resolver, error) { } m := resolver.ByMethod{ "key": key.Resolver, - "web": resolver.NewCached(httpResolver, 24*time.Hour), + "web": httpResolver, "plc": resolver.NewCached(p, 3*time.Hour), } return m, nil