refactor(invocation): migrate from MetaMask/go-did-it to code.sonr.org/go/did-it
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
didkeyctl "github.com/MetaMask/go-did-it/controller/did-key"
|
didkeyctl "code.sonr.org/go/did-it/controller/did-key"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipld/go-ipld-prime"
|
"github.com/ipld/go-ipld-prime"
|
||||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExampleNew() {
|
func ExampleNew() {
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
"code.sonr.org/go/ucan/pkg/meta"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/nonce"
|
"code.sonr.org/go/ucan/token/internal/nonce"
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/parse"
|
"code.sonr.org/go/ucan/token/internal/parse"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Token is an immutable type that holds the fields of a UCAN invocation.
|
// Token is an immutable type that holds the fields of a UCAN invocation.
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/policytest"
|
"code.sonr.org/go/ucan/pkg/policy/policytest"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed testdata/new.dagjson
|
//go:embed testdata/new.dagjson
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package invocation
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipld/go-ipld-prime"
|
"github.com/ipld/go-ipld-prime"
|
||||||
"github.com/ipld/go-ipld-prime/codec"
|
"github.com/ipld/go-ipld-prime/codec"
|
||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||||
"github.com/ipld/go-ipld-prime/datamodel"
|
"github.com/ipld/go-ipld-prime/datamodel"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ToSealed wraps the invocation token in an envelope, generates the
|
// ToSealed wraps the invocation token in an envelope, generates the
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSealUnsealRoundtrip(t *testing.T) {
|
func TestSealUnsealRoundtrip(t *testing.T) {
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package invocation
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Option is a type that allows optional fields to be set during the
|
// Option is a type that allows optional fields to be set during the
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
// # Invocation token validation
|
// # Invocation token validation
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/node/bindnode"
|
"github.com/ipld/go-ipld-prime/node/bindnode"
|
||||||
"github.com/ipld/go-ipld-prime/schema"
|
"github.com/ipld/go-ipld-prime/schema"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
"code.sonr.org/go/ucan/pkg/meta"
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||||
)
|
)
|
||||||
|
|
||||||
// [Tag] is the string used as a key within the SigPayload that identifies
|
// [Tag] is the string used as a key within the SigPayload that identifies
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/crypto"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
Reference in New Issue
Block a user