refactor(server): migrate from ucan-wg to code.sonr.org/go/ucan
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
)
|
||||
|
||||
var ErrNoUcan = fmt.Errorf("no ucan")
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
|
||||
_ "code.sonr.org/go/did-it/verifiers/did-key"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container/containertest"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/pkg/container/containertest"
|
||||
)
|
||||
|
||||
func TestHTTPBearer(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"code.sonr.org/go/did-it"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/bearer"
|
||||
"code.sonr.org/go/ucan/toolkit/server/bearer"
|
||||
)
|
||||
|
||||
// ExtractMW returns an HTTP middleware tasked with:
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
)
|
||||
|
||||
func TestExtractMW(t *testing.T) {
|
||||
|
||||
@@ -9,14 +9,14 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime/datamodel"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/extargs"
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/pkg/meta"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"code.sonr.org/go/ucan/toolkit/server/extargs"
|
||||
)
|
||||
|
||||
var _ delegation.Loader = &UcanCtx{}
|
||||
|
||||
@@ -8,19 +8,19 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime/datamodel"
|
||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/exectx"
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"code.sonr.org/go/ucan/toolkit/server/exectx"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
)
|
||||
|
||||
type CustomExtArgs struct {
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
func ExampleCustomExtArgs() {
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
"github.com/multiformats/go-multihash"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
)
|
||||
|
||||
// HttpArgsKey is the key in the args, used for:
|
||||
|
||||
@@ -5,15 +5,15 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/multiformats/go-multihash"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
)
|
||||
|
||||
func TestHttp(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user