From 1b2a57ca98b189c0cbea346423ba497a06744d75 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Thu, 8 Jan 2026 15:51:17 -0500 Subject: [PATCH] refactor(ucan): migrate from ucan-wg/go-ucan to code.sonr.org/go/ucan --- go.mod | 6 +++--- go.sum | 8 ++++---- internal/crypto/ucan/delegation.go | 10 +++++----- internal/crypto/ucan/invocation.go | 8 ++++---- internal/crypto/ucan/policy.go | 4 ++-- internal/crypto/ucan/types.go | 2 +- internal/crypto/ucan/ucan.go | 10 +++++----- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index febadd3..272588a 100644 --- a/go.mod +++ b/go.mod @@ -3,18 +3,19 @@ module enclave go 1.25.5 require ( + code.sonr.org/go/did-it v1.0.0 + code.sonr.org/go/ucan v1.1.0 github.com/extism/go-pdk v1.1.3 + github.com/ipfs/go-cid v0.5.0 github.com/ipld/go-ipld-prime v0.21.0 github.com/ncruces/go-sqlite3 v0.30.4 github.com/sonr-io/crypto v1.0.1 github.com/stretchr/testify v1.11.1 - github.com/ucan-wg/go-ucan v1.1.0 golang.org/x/crypto v0.46.0 ) require ( filippo.io/edwards25519 v1.1.0 // indirect - github.com/MetaMask/go-did-it v1.0.0-pre1 // indirect github.com/bits-and-blooms/bitset v1.24.3 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/bwesterb/go-ristretto v1.2.3 // indirect @@ -23,7 +24,6 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 // indirect github.com/gtank/merlin v0.1.1 // indirect - github.com/ipfs/go-cid v0.5.0 // indirect github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect github.com/minio/sha256-simd v1.0.1 // indirect diff --git a/go.sum b/go.sum index 2dd919f..fd744c6 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,10 @@ +code.sonr.org/go/did-it v1.0.0 h1:Wh8igUkD6cuf0Ul3gawi27z2/M1YfdnQ/mD9gBq/2EU= +code.sonr.org/go/did-it v1.0.0/go.mod h1:PFK6ItvNyB2xbnVqipBbkN9BK1Sq+E2lf1YfOyCA0Og= +code.sonr.org/go/ucan v1.1.0 h1:0VuJCGzDPbzcTrjBBgQAmLu+2ARp1eYeXiRl+2A86R8= +code.sonr.org/go/ucan v1.1.0/go.mod h1:QUGrUW93T2yVPiSiADLxj1RNpTJ/9RHaKoHGMGEC63A= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/MetaMask/go-did-it v1.0.0-pre1 h1:NTGAC7z52TwFegEF7c+csUr/6Al1nAo6ValAAxOsjto= -github.com/MetaMask/go-did-it v1.0.0-pre1/go.mod h1:7m9syDnXFTg5GmUEcydpO4Rs3eYT4McFH7vCw5fp3A4= github.com/bits-and-blooms/bitset v1.24.3 h1:Bte86SlO3lwPQqww+7BE9ZuUCKIjfqnG5jtEyqA9y9Y= github.com/bits-and-blooms/bitset v1.24.3/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= @@ -88,8 +90,6 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tetratelabs/wazero v1.11.0 h1:+gKemEuKCTevU4d7ZTzlsvgd1uaToIDtlQlmNbwqYhA= github.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU= -github.com/ucan-wg/go-ucan v1.1.0 h1:Z4RGSjJrpLN7S9u93Md036XbyYprloe1LUyDZe9rnWg= -github.com/ucan-wg/go-ucan v1.1.0/go.mod h1:9Gnfx2XO5OCjL0PGipfDDgK423OAzyNEY+kJJQ5D4Qo= github.com/ucan-wg/go-varsig v1.0.0 h1:Hrc437Zg+B5Eoajg+qZQZI3Q3ocPyjlnp3/Bz9ZnlWw= github.com/ucan-wg/go-varsig v1.0.0/go.mod h1:Sakln6IPooDPH+ClQ0VvR09TuwUhHcfLqcPiPkMZGh0= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= diff --git a/internal/crypto/ucan/delegation.go b/internal/crypto/ucan/delegation.go index 100162d..7b42050 100644 --- a/internal/crypto/ucan/delegation.go +++ b/internal/crypto/ucan/delegation.go @@ -4,12 +4,12 @@ import ( "fmt" "time" - "github.com/MetaMask/go-did-it" - "github.com/MetaMask/go-did-it/crypto" + "code.sonr.org/go/did-it" + "code.sonr.org/go/did-it/crypto" "github.com/ipfs/go-cid" - "github.com/ucan-wg/go-ucan/pkg/command" - "github.com/ucan-wg/go-ucan/pkg/policy" - "github.com/ucan-wg/go-ucan/token/delegation" + "code.sonr.org/go/ucan/pkg/command" + "code.sonr.org/go/ucan/pkg/policy" + "code.sonr.org/go/ucan/token/delegation" ) // DelegationBuilder provides a fluent API for creating UCAN delegations. diff --git a/internal/crypto/ucan/invocation.go b/internal/crypto/ucan/invocation.go index fa0018c..d925fd6 100644 --- a/internal/crypto/ucan/invocation.go +++ b/internal/crypto/ucan/invocation.go @@ -4,11 +4,11 @@ import ( "fmt" "time" - "github.com/MetaMask/go-did-it" - "github.com/MetaMask/go-did-it/crypto" + "code.sonr.org/go/did-it" + "code.sonr.org/go/did-it/crypto" "github.com/ipfs/go-cid" - "github.com/ucan-wg/go-ucan/pkg/command" - "github.com/ucan-wg/go-ucan/token/invocation" + "code.sonr.org/go/ucan/pkg/command" + "code.sonr.org/go/ucan/token/invocation" ) // InvocationBuilder provides a fluent API for creating UCAN invocations. diff --git a/internal/crypto/ucan/policy.go b/internal/crypto/ucan/policy.go index 5b7092e..e8ed4d9 100644 --- a/internal/crypto/ucan/policy.go +++ b/internal/crypto/ucan/policy.go @@ -2,8 +2,8 @@ package ucan import ( "github.com/ipld/go-ipld-prime" - "github.com/ucan-wg/go-ucan/pkg/policy" - "github.com/ucan-wg/go-ucan/pkg/policy/literal" + "code.sonr.org/go/ucan/pkg/policy" + "code.sonr.org/go/ucan/pkg/policy/literal" ) // PolicyBuilder provides a fluent API for constructing UCAN policies. diff --git a/internal/crypto/ucan/types.go b/internal/crypto/ucan/types.go index 47670d1..2589309 100644 --- a/internal/crypto/ucan/types.go +++ b/internal/crypto/ucan/types.go @@ -2,7 +2,7 @@ package ucan import ( "github.com/ipfs/go-cid" - "github.com/ucan-wg/go-ucan/pkg/policy" + "code.sonr.org/go/ucan/pkg/policy" ) // ValidationErrorCode represents UCAN validation error types. diff --git a/internal/crypto/ucan/ucan.go b/internal/crypto/ucan/ucan.go index 31112b8..a8167fb 100644 --- a/internal/crypto/ucan/ucan.go +++ b/internal/crypto/ucan/ucan.go @@ -1,7 +1,7 @@ // Package ucan provides UCAN v1.0.0-rc.1 compliant authorization // for the Sonr network using the official go-ucan library. // -// This package wraps github.com/ucan-wg/go-ucan to provide: +// This package wraps code.sonr.org/go/ucan to provide: // - Delegation creation and validation // - Invocation creation and validation // - Policy evaluation @@ -19,10 +19,10 @@ package ucan import ( - "github.com/ucan-wg/go-ucan/pkg/command" - "github.com/ucan-wg/go-ucan/pkg/policy" - "github.com/ucan-wg/go-ucan/token/delegation" - "github.com/ucan-wg/go-ucan/token/invocation" + "code.sonr.org/go/ucan/pkg/command" + "code.sonr.org/go/ucan/pkg/policy" + "code.sonr.org/go/ucan/token/delegation" + "code.sonr.org/go/ucan/token/invocation" ) // Re-export key types from go-ucan for convenience.