refactor(ucan): migrate from ucan-wg/go-ucan to code.sonr.org/go/ucan

This commit is contained in:
2026-01-08 15:51:17 -05:00
parent c1e7d772a1
commit 1b2a57ca98
7 changed files with 24 additions and 24 deletions

6
go.mod
View File

@@ -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

8
go.sum
View File

@@ -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=

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.