Compare commits
5 Commits
main
...
fork/alans
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b8cb63ed3 | ||
|
|
8c89790c92 | ||
|
|
7518ca5236 | ||
|
|
19b8dc5e48 | ||
|
|
77dce827d3 |
20
.github/Repo.toml
vendored
20
.github/Repo.toml
vendored
@@ -1,20 +0,0 @@
|
||||
[scopes]
|
||||
ci = [".github/workflows"]
|
||||
config = [".github", "go.mod", "go.sum"]
|
||||
docs = ["Readme.md", "LICENSE.md"]
|
||||
assets = ["assets"]
|
||||
pkg = ["pkg"]
|
||||
args = ["pkg/args"]
|
||||
command = ["pkg/command"]
|
||||
container = ["pkg/container"]
|
||||
meta = ["pkg/meta"]
|
||||
policy = ["pkg/policy"]
|
||||
secretbox = ["pkg/secretbox"]
|
||||
token = ["token"]
|
||||
delegation = ["token/delegation"]
|
||||
invocation = ["token/invocation"]
|
||||
toolkit = ["toolkit"]
|
||||
examples = ["toolkit/_example"]
|
||||
client = ["toolkit/client"]
|
||||
issuer = ["toolkit/issuer"]
|
||||
server = ["toolkit/server"]
|
||||
18
Readme.md
18
Readme.md
@@ -1,5 +1,5 @@
|
||||
<div align="center">
|
||||
<a href="https://code.sonr.org/go/ucan" target="_blank">
|
||||
<a href="https://github.com/ucan-wg/go-ucan" target="_blank">
|
||||
<img src="https://raw.githubusercontent.com/ucan-wg/go-ucan/v1/assets/logo.png" alt="go-ucan Logo" height="250"></img>
|
||||
</a>
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
|
||||
<p>
|
||||
<img src="https://img.shields.io/badge/UCAN-v1.0.0--rc.1-blue" alt="UCAN v1.0.0-rc.1">
|
||||
<a href="https://code.sonr.org/go/ucan/tags">
|
||||
<a href="https://github.com/ucan-wg/go-ucan/tags">
|
||||
<img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/ucan-wg/go-ucan">
|
||||
</a>
|
||||
<a href="https://code.sonr.org/go/ucan/actions?query=">
|
||||
<img src="https://code.sonr.org/go/ucan/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
|
||||
<a href="https://github.com/ucan-wg/go-ucan/actions?query=">
|
||||
<img src="https://github.com/ucan-wg/go-ucan/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
|
||||
</a>
|
||||
<a href="https://ucan-wg.github.io/go-ucan/dev/bench/">
|
||||
<img alt="Go benchmarks" src="https://img.shields.io/badge/Benchmarks-go-blue">
|
||||
</a>
|
||||
<a href="https://code.sonr.org/go/ucan/blob/v1/LICENSE.md">
|
||||
<img alt="Apache 2.0 OR MIT License" src="https://img.shields.io/badge/License-Apache--2.0_OR_MIT-green">
|
||||
<a href="https://github.com/ucan-wg/go-ucan/blob/v1/LICENSE.md">
|
||||
<img alt="Apache 2.0 + MIT License" src="https://img.shields.io/badge/License-Apache--2.0+MIT-green">
|
||||
</a>
|
||||
<a href="https://pkg.go.dev/code.sonr.org/go/ucan">
|
||||
<a href="https://pkg.go.dev/github.com/ucan-wg/go-ucan">
|
||||
<img src="https://img.shields.io/badge/Docs-godoc-blue" alt="Docs">
|
||||
</a>
|
||||
<a href="https://discord.gg/JSyFG6XgVM">
|
||||
@@ -54,7 +54,7 @@ Not implemented yet:
|
||||
|
||||
## Status
|
||||
|
||||
`go-ucan` currently support the required parts of the UCAN specification: the main specification, delegation and invocation. It leverages the sibling project [`go-did-it`](https://code.sonr.org/go/did-it) for easy and extensible DID support.
|
||||
`go-ucan` currently support the required parts of the UCAN specification: the main specification, delegation and invocation. It leverages the sibling project [`go-did-it`](https://github.com/MetaMask/go-did-it) for easy and extensible DID support.
|
||||
|
||||
Besides that, `go-ucan` also includes:
|
||||
- support for encrypted values in token's metadata
|
||||
@@ -73,4 +73,4 @@ Artwork by [Bruno Monts](https://www.instagram.com/bruno_monts). Thank you [Rene
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the dual license [Apache 2.0 OR MIT](https://code.sonr.org/go/ucan/blob/v1/LICENSE.md).
|
||||
This project is licensed under the double license [Apache 2.0 + MIT](https://github.com/ucan-wg/go-ucan/blob/v1/LICENSE.md).
|
||||
|
||||
10
go.mod
10
go.mod
@@ -1,21 +1,21 @@
|
||||
module code.sonr.org/go/ucan
|
||||
module github.com/ucan-wg/go-ucan
|
||||
|
||||
go 1.24.4
|
||||
|
||||
toolchain go1.24.5
|
||||
|
||||
require (
|
||||
code.sonr.org/go/did-it v1.0.0
|
||||
github.com/MetaMask/go-did-it v1.0.0-pre1
|
||||
github.com/avast/retry-go/v4 v4.6.1
|
||||
github.com/ipfs/go-cid v0.5.0
|
||||
github.com/ipld/go-ipld-prime v0.21.0
|
||||
github.com/multiformats/go-multibase v0.2.0
|
||||
github.com/multiformats/go-multicodec v0.9.0
|
||||
github.com/multiformats/go-multihash v0.2.3
|
||||
github.com/multiformats/go-varint v0.1.0
|
||||
github.com/multiformats/go-varint v0.0.7
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/ucan-wg/go-varsig v1.0.0
|
||||
golang.org/x/crypto v0.45.0
|
||||
golang.org/x/crypto v0.40.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -29,7 +29,7 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/polydawn/refmt v0.89.0 // indirect
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
golang.org/x/sys v0.38.0 // indirect
|
||||
golang.org/x/sys v0.34.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
lukechampine.com/blake3 v1.3.0 // indirect
|
||||
|
||||
16
go.sum
16
go.sum
@@ -1,6 +1,6 @@
|
||||
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=
|
||||
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/avast/retry-go/v4 v4.6.1 h1:VkOLRubHdisGrHnTu89g08aQEWEgRU7LVEop3GbIcMk=
|
||||
github.com/avast/retry-go/v4 v4.6.1/go.mod h1:V6oF8njAwxJ5gRo1Q7Cxab24xs5NCWZBeaHHBklR8mA=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
@@ -43,8 +43,8 @@ github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3
|
||||
github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k=
|
||||
github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
|
||||
github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
|
||||
github.com/multiformats/go-varint v0.1.0 h1:i2wqFp4sdl3IcIxfAonHQV9qU5OsZ4Ts9IOoETFs5dI=
|
||||
github.com/multiformats/go-varint v0.1.0/go.mod h1:5KVAVXegtfmNQQm/lCY+ATvDzvJJhSkUlGQV9wgObdI=
|
||||
github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8=
|
||||
github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4=
|
||||
@@ -67,12 +67,12 @@ github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60Nt
|
||||
github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ=
|
||||
github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
|
||||
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
|
||||
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
||||
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@@ -16,8 +16,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
"github.com/ipld/go-ipld-prime/printer"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
)
|
||||
|
||||
var ErrNotFound = errors.New("key not found in meta")
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
)
|
||||
|
||||
func TestArgs(t *testing.T) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
)
|
||||
|
||||
func TestBuilder_XXX(t *testing.T) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
)
|
||||
|
||||
func TestTop(t *testing.T) {
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/codec/cbor"
|
||||
"github.com/ipld/go-ipld-prime/datamodel"
|
||||
|
||||
"code.sonr.org/go/ucan/token"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/token"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
var ErrNotFound = fmt.Errorf("not found")
|
||||
|
||||
@@ -9,16 +9,16 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/controller/did-key"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/controller/did-key"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"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/delegation"
|
||||
"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/delegation"
|
||||
)
|
||||
|
||||
func TestContainerRoundTrip(t *testing.T) {
|
||||
|
||||
@@ -3,7 +3,6 @@ package container
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"slices"
|
||||
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/cbor"
|
||||
@@ -110,13 +109,8 @@ func (ctn Writer) toWriter(header header, w io.Writer) (err error) {
|
||||
}()
|
||||
node, err := qp.BuildMap(basicnode.Prototype.Any, 1, func(ma datamodel.MapAssembler) {
|
||||
qp.MapEntry(ma, containerVersionTag, qp.List(int64(len(ctn)), func(la datamodel.ListAssembler) {
|
||||
tokens := make([][]byte, 0, len(ctn))
|
||||
for data := range ctn {
|
||||
tokens = append(tokens, []byte(data))
|
||||
}
|
||||
slices.SortFunc(tokens, bytes.Compare)
|
||||
for _, data := range tokens {
|
||||
qp.ListEntry(la, qp.Bytes(data))
|
||||
for data, _ := range ctn {
|
||||
qp.ListEntry(la, qp.Bytes([]byte(data)))
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/printer"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"code.sonr.org/go/ucan/pkg/secretbox"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/secretbox"
|
||||
)
|
||||
|
||||
var ErrNotFound = errors.New("key not found in meta")
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/meta"
|
||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
||||
)
|
||||
|
||||
func TestMeta_Add(t *testing.T) {
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/must"
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"code.sonr.org/go/ucan/pkg/policy/selector"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/selector"
|
||||
)
|
||||
|
||||
func FromIPLD(node datamodel.Node) (Policy, error) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
)
|
||||
|
||||
var Bool = basicnode.NewBool
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/printer"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
)
|
||||
|
||||
func TestList(t *testing.T) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
)
|
||||
|
||||
func TestMatch(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||
|
||||
selpkg "code.sonr.org/go/ucan/pkg/policy/selector"
|
||||
selpkg "github.com/ucan-wg/go-ucan/pkg/policy/selector"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
)
|
||||
|
||||
func ExamplePolicy() {
|
||||
|
||||
@@ -3,9 +3,9 @@ package policytest
|
||||
import (
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
||||
)
|
||||
|
||||
// EmptyPolicy provides a Policy with no statements.
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
)
|
||||
|
||||
func TestParse(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
basicnode "github.com/ipld/go-ipld-prime/node/basic"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/selector"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/selector"
|
||||
)
|
||||
|
||||
// TestSupported Forms runs tests against the Selector according to the
|
||||
|
||||
@@ -16,13 +16,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/meta"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/token/internal/nonce"
|
||||
"code.sonr.org/go/ucan/token/internal/parse"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/nonce"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/parse"
|
||||
)
|
||||
|
||||
// Token is an immutable type that holds the fields of a UCAN delegation.
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
//go:embed testdata/new.dagjson
|
||||
|
||||
@@ -9,17 +9,17 @@ import (
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
didkeyctl "code.sonr.org/go/did-it/controller/did-key"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
didkeyctl "github.com/MetaMask/go-did-it/controller/did-key"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/policy/policytest"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/policytest"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -215,7 +215,7 @@ func (g *generator) writeGoFile() error {
|
||||
Println("import (")
|
||||
Println("\t\"github.com/ipfs/go-cid\"")
|
||||
Println()
|
||||
Println("\t\"code.sonr.org/go/ucan/token/delegation\"")
|
||||
Println("\t\"github.com/ucan-wg/go-ucan/token/delegation\"")
|
||||
Println(")")
|
||||
|
||||
refs := make(map[cid.Cid]string, len(g.dlgs))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -5,11 +5,11 @@ import (
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
_ "code.sonr.org/go/did-it/verifiers/did-key"
|
||||
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,7 @@ package delegationtest
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
||||
)
|
||||
|
||||
func TestGetDelegation(t *testing.T) {
|
||||
|
||||
@@ -8,17 +8,17 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||
|
||||
"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/delegation"
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"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/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
// The following example shows how to create a delegation.Token with
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
"github.com/multiformats/go-varint"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -3,8 +3,8 @@ package delegation
|
||||
import (
|
||||
"io"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"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/datamodel"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
// ToSealed wraps the delegation token in an envelope, generates the
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/node/bindnode"
|
||||
"github.com/ipld/go-ipld-prime/schema"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/meta"
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
// Tag is the string used as a key within the SigPayload that identifies
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
_ "embed"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
//go:embed delegation.ipldsch
|
||||
|
||||
@@ -3,7 +3,7 @@ package token
|
||||
import (
|
||||
"github.com/ipld/go-ipld-prime/datamodel"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
type Info = envelope.Info
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime/codec"
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
func TestCidFromBytes(t *testing.T) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||
"github.com/ipld/go-ipld-prime/datamodel"
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/schema"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -42,8 +42,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/schema"
|
||||
"github.com/ucan-wg/go-varsig"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
_ "code.sonr.org/go/did-it/verifiers/did-key"
|
||||
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
func TestDecode(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
)
|
||||
|
||||
func OptionalDID(s *string) (did.DID, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
||||
)
|
||||
|
||||
func TestOptionalTimestamp(t *testing.T) {
|
||||
|
||||
@@ -7,17 +7,17 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
didkeyctl "code.sonr.org/go/did-it/controller/did-key"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
didkeyctl "github.com/MetaMask/go-did-it/controller/did-key"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
func ExampleNew() {
|
||||
|
||||
115
token/invocation/interop_test.go
Normal file
115
token/invocation/interop_test.go
Normal file
@@ -0,0 +1,115 @@
|
||||
package invocation_test
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||
"github.com/ipld/go-ipld-prime/schema"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
// This comes from https://github.com/ucan-wg/spec/blob/main/fixtures/1.0.0/invocation.json
|
||||
//
|
||||
//go:embed testdata/interop_invocation.json
|
||||
var interopInvocation []byte
|
||||
|
||||
//go:embed testdata/interop.ipldsch
|
||||
var schemaBytes []byte
|
||||
|
||||
func fixturesType(t *testing.T) schema.Type {
|
||||
ts, err := ipld.LoadSchemaBytes(schemaBytes)
|
||||
require.NoError(t, err)
|
||||
return ts.TypeByName("Fixtures")
|
||||
}
|
||||
|
||||
type ErrorModel struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type VectorModel struct {
|
||||
Name string
|
||||
Description string
|
||||
Invocation []byte
|
||||
Proofs [][]byte
|
||||
Error *ErrorModel
|
||||
}
|
||||
|
||||
type FixturesModel struct {
|
||||
Version string
|
||||
Comments string
|
||||
Valid []VectorModel
|
||||
Invalid []VectorModel
|
||||
}
|
||||
|
||||
func TestInterop(t *testing.T) {
|
||||
var fixtures FixturesModel
|
||||
_, err := ipld.Unmarshal(interopInvocation, dagjson.Decode, &fixtures, fixturesType(t))
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, vector := range fixtures.Valid {
|
||||
t.Run("valid "+vector.Name, func(t *testing.T) {
|
||||
err := decodeAndValidate(vector)
|
||||
require.NoError(t, err, "execution should have been allowed for invocation with %s", vector.Description)
|
||||
})
|
||||
}
|
||||
|
||||
for _, vector := range fixtures.Invalid {
|
||||
t.Run("invalid "+vector.Name, func(t *testing.T) {
|
||||
err := decodeAndValidate(vector)
|
||||
require.Error(t, err, "execution should not have been allowed for invocation because %s", vector.Description)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
type mapDelegationLoader struct {
|
||||
data map[cid.Cid]*delegation.Token
|
||||
}
|
||||
|
||||
func (ml *mapDelegationLoader) GetDelegation(cid cid.Cid) (*delegation.Token, error) {
|
||||
d, ok := ml.data[cid]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("delegation not found: %s", cid)
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
func decodeAndValidate(vector VectorModel) error {
|
||||
inv, err := invocation.Decode(vector.Invocation, dagcbor.Decode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
proofs, err := decodeProofs(vector.Proofs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = inv.ExecutionAllowed(&mapDelegationLoader{proofs})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func decodeProofs(vectorProofs [][]byte) (map[cid.Cid]*delegation.Token, error) {
|
||||
proofs := map[cid.Cid]*delegation.Token{}
|
||||
for _, p := range vectorProofs {
|
||||
dlg, err := delegation.Decode(p, dagcbor.Decode)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c, err := envelope.CIDFromBytes(p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
proofs[c] = dlg
|
||||
}
|
||||
return proofs, nil
|
||||
}
|
||||
@@ -14,15 +14,15 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/meta"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/internal/nonce"
|
||||
"code.sonr.org/go/ucan/token/internal/parse"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/nonce"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/parse"
|
||||
)
|
||||
|
||||
// Token is an immutable type that holds the fields of a UCAN invocation.
|
||||
|
||||
@@ -4,15 +4,15 @@ import (
|
||||
_ "embed"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/policy/policytest"
|
||||
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy/policytest"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
//go:embed testdata/new.dagjson
|
||||
|
||||
@@ -3,8 +3,8 @@ package invocation
|
||||
import (
|
||||
"io"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"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/datamodel"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
// ToSealed wraps the invocation token in an envelope, generates the
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
func TestSealUnsealRoundtrip(t *testing.T) {
|
||||
|
||||
@@ -3,10 +3,10 @@ package invocation
|
||||
import (
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
)
|
||||
|
||||
// Option is a type that allows optional fields to be set during the
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
// # Invocation token validation
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/node/bindnode"
|
||||
"github.com/ipld/go-ipld-prime/schema"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/meta"
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
)
|
||||
|
||||
// [Tag] is the string used as a key within the SigPayload that identifies
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
"encoding/base64"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
18
token/invocation/testdata/interop.ipldsch
vendored
Normal file
18
token/invocation/testdata/interop.ipldsch
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
type Fixtures struct {
|
||||
version String
|
||||
comments String
|
||||
valid [Vector]
|
||||
invalid [Vector]
|
||||
}
|
||||
|
||||
type Vector struct {
|
||||
name String
|
||||
description String
|
||||
invocation Bytes
|
||||
proofs [Bytes]
|
||||
error optional Error
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
name String
|
||||
}
|
||||
378
token/invocation/testdata/interop_invocation.json
vendored
Normal file
378
token/invocation/testdata/interop_invocation.json
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
{
|
||||
"comments": "Encoded as dag-json.",
|
||||
"invalid": [
|
||||
{
|
||||
"description": "it has no proofs",
|
||||
"error": {
|
||||
"name": "InvalidClaim"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAF7fivUGyq7qB6p9O9XzzA3Fpct17AiqtTGLjz1soHaTI/ik/Q5vRALuuFD4BEZbpvR3+a710lA+JHIS9RqWVA6JhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaAY3N1Yng4ZGlkOmtleTp6Nk1rbUpjZVZvUVNIczQ1Y1JlRVhvTHRXbTF3b3NDRzhSTHhmS3doeG9xem9Ua0NkYXJnc6Blbm9uY2VQAQIDBAECAwQBAgMEAQIDBA"
|
||||
}
|
||||
},
|
||||
"name": "no proof",
|
||||
"proofs": []
|
||||
},
|
||||
{
|
||||
"description": "a proof is not provided or resolvable externally",
|
||||
"error": {
|
||||
"name": "UnavailableProof"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhALmBqgaPi6kKawSh5pxVkDOlGgdNefcmjvnJ3YXE/zX+T1zwRdF4I8qxOjTzRbYijDaShIgLR20i1nPpRO15qC6JhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgMI8CZFZ8CH7BynpUg0BDCfuktrmFJjLSu+KK/DXIDmpjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2RhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "missing proof",
|
||||
"proofs": []
|
||||
},
|
||||
{
|
||||
"description": "a proof is expired",
|
||||
"error": {
|
||||
"name": "Expired"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAupTs833VJzKG3oeSpebiP/5P8AfBdRxEbUc9DxVRpbKXsysDTSnqftMLktOkWnlVmCGLiLzqh9uWKMQR4ERpCaJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgahqZy6Hcb2Q/Q6g1uJviOY/c7oHsoNyBTh+eDpoV3dJjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2RhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "expired proof",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAet8bzLxBK7Oeqxt6t/eeTYyHb/wh7odbGXA8weuljc9COjyNhs/DaMd8YyQH2TF3UyB36oEKm/TDY3DGyvkXDqJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhwGmj2GDNjaXNzeDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemNwb2yAY3N1Yng4ZGlkOmtleTp6Nk1rbVQ5ajZmVlpxelhWOHUyd1ZWU3U0OWdZU1JZR1NRbmR1V1hGNmZvQUpycXplbm9uY2VQAQIDBAECAwQBAgMEAQIDBA"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "a proof has a not before time in the future",
|
||||
"error": {
|
||||
"name": "TooEarly"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAbt3YbyszHCOW27S8A6Xy8fR/S2iDH2L8lYgyBoOkzgoC4Syeg2zcP/Hi7DXDobFrLlYWqgdpemdYKRe4jEOUBaJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIghcgCW54v0moLFh3AXOyu5eUzEy73I5sonBNPd+6avkBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2RhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "inactive proof",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAcWHiqJIcx2+8bfTXblonOaoi4if0kXWSZnw8ijBAZlblRspyJvt+YGSIMGSEEp/BIPmr2Qem3F/NqvASpitnBaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xqGNhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y25iZhsAAAA6//RBf2Nwb2yAY3N1Yng4ZGlkOmtleTp6Nk1rbVQ5ajZmVlpxelhWOHUyd1ZWU3U0OWdZU1JZR1NRbmR1V1hGNmZvQUpycXplbm9uY2VQAQIDBAECAwQBAgMEAQIDBA"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the issuer of a delegation in the proof chain is not the audience of the next delegation",
|
||||
"error": {
|
||||
"name": "InvalidAudience"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAV3jsUznrpXG+hac6mx+04u5vGp0vhJBRCQ4qbYD7AlfswNdxHWNBNKnU8VE84xdGR5N7Xc6fmxJfX8SbLd//AaJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIguIISrxoWsh3AnaF/wx3Skabg7tI8LNRsZi8txfnlPu7YKlglAAFxEiDBaGyFMdE9Md5+YWVv9anDlPXtGqNAmeBIYZifKHpV2WNzdWJ4OGRpZDprZXk6ejZNa2g3d0p0UmVDZWVUOXlEUjJuUjUyb21LQ2F5UzZ6Ymc4dG5XOEpvazlDSmhrZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "proof principal alignment",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAg4P89/nYQzrLHgCddyhPslAuiA/mgfDkIZBRKI2vQs8ybbtLHYSW+uo4Zgfn4blseU4YABu1tJs8ClXSpJ5cDaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3VieDhkaWQ6a2V5Ono2TWtoN3dKdFJlQ2VlVDl5RFIyblI1Mm9tS0NheVM2emJnOHRuVzhKb2s5Q0poa2Vub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA47UkXV3nVndtGRqPLlB2F3/TNDd5lg5F8++X6oqe+SENmVD8Jvj3+MwPSEW50vNlpQ3HXv8/RwXax5TFjU/7BaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa2g3d0p0UmVDZWVUOXlEUjJuUjUyb21LQ2F5UzZ6Ymc4dG5XOEpvazlDSmhrY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWtoN3dKdFJlQ2VlVDl5RFIyblI1Mm9tS0NheVM2emJnOHRuVzhKb2s5Q0poa2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the audience of the delegation is not the issuer of the invocation",
|
||||
"error": {
|
||||
"name": "InvalidAudience"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhA11XpH25/k+6xFkH3aiIZxEeFI2NE/9Iy4Di2VraiHbffqKeMlcSVN+DpE84xcdVbG/iv5e3kxFnoNVQHbaSyB6JhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIgMbdCFygvZdJDnLIXS+18gygbucsf10G6i6Qnv5hx7ALYKlglAAFxEiDBaGyFMdE9Md5+YWVv9anDlPXtGqNAmeBIYZifKHpV2WNzdWJ4OGRpZDprZXk6ejZNa2g3d0p0UmVDZWVUOXlEUjJuUjUyb21LQ2F5UzZ6Ymc4dG5XOEpvazlDSmhrZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "invocation principal alignment",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAvrf2Fq+KzyVLbMrHV+darhgqtO583QC8U7ZcPV6SgkN6r5fC/SbyzBcoaGxKgrRsE5wHZPXBBlaGAf4H6e40DqJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWtoN3dKdFJlQ2VlVDl5RFIyblI1Mm9tS0NheVM2emJnOHRuVzhKb2s5Q0poa2Vub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA47UkXV3nVndtGRqPLlB2F3/TNDd5lg5F8++X6oqe+SENmVD8Jvj3+MwPSEW50vNlpQ3HXv8/RwXax5TFjU/7BaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa2g3d0p0UmVDZWVUOXlEUjJuUjUyb21LQ2F5UzZ6Ymc4dG5XOEpvazlDSmhrY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWtoN3dKdFJlQ2VlVDl5RFIyblI1Mm9tS0NheVM2emJnOHRuVzhKb2s5Q0poa2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the subject is not the same for every delegation in the proof chain",
|
||||
"error": {
|
||||
"name": "InvalidSubject"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhA0Tyn7Eh9SFJnYJ4Q3/n0QYFdEnVHgHze9o1woHh9qXpBJIFy2e09r3dvziYIDi4aR98JpvoHb1oWSl/JxXyYDqJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIgMzCHsHkGw9b93/fHkm1OAu7W39a8kV2no54Oc03pnALYKlglAAFxEiCAZApnv/CyrmAr4/yrhGrA5kKuHKIghMOkcz9tkg+nJGNzdWJ4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "proof subject alignment",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA18glIcesPTSsyxIvvSsnrLctcBHs20EEAUI+WSnOJBwBElj2b6z0UhR2pz5MSR8cRxPWdp5NffgA08Hn7EsrB6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA1IoOl5rpsUsdwbfKD6Ly/Tf6h90ODLY5ru2FSDJ9s2Z5/kLmFvBlypu9Ff0fnoa7+pKtVlDsucD5aCYINbhRC6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the subject of the invocation is not the same as the subject of the delegation",
|
||||
"error": {
|
||||
"name": "InvalidSubject"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhA07DNIr7D+7fvC9HQjAFj0aWAUV5HAGohKLU15hOXgFcqETC2AfmWwuP9+F3c5ElM1Rb+6nbm4C3POSU3c7PuAKJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIgeYBtHcIlGGAgkV3vk0qB0sDih8Kco3ny/NHWBzcsM4HYKlglAAFxEiCAZApnv/CyrmAr4/yrhGrA5kKuHKIghMOkcz9tkg+nJGNzdWJ4OGRpZDprZXk6ejZNa2g3d0p0UmVDZWVUOXlEUjJuUjUyb21LQ2F5UzZ6Ymc4dG5XOEpvazlDSmhrZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "invocation subject alignment",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAlC+rtXKanMs7eUsDKDbzBoPI1RIoBhxs3nHh/XbBc9Ou5quAnDM987yV+PAgR6X8nmJ8hQozLL3yEJyCKhuyA6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA1IoOl5rpsUsdwbfKD6Ly/Tf6h90ODLY5ru2FSDJ9s2Z5/kLmFvBlypu9Ff0fnoa7+pKtVlDsucD5aCYINbhRC6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the invocation is expired",
|
||||
"error": {
|
||||
"name": "Expired"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAdRZEsVZjlWYsJywI48Ejjc1qPkr68ChTUU6Fgeq1JNY+uTB93mRA+uk5RShNJOVvdjR2fWtqpIiKp1ar4NohBaJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cBpo9hgzY2lhdBpo9XuAY2lzc3g4ZGlkOmtleTp6Nk1rZ0d5a045QVJORmpFem93VnE0bUxQMmtMNE5zeUFhREdYZUpGUTVxRTFiZmdjcHJmgdgqWCUAAXESIDCPAmRWfAh+wcp6VINAQwn7pLa5hSYy0rviivw1yA5qY3N1Yng4ZGlkOmtleTp6Nk1rbUpjZVZvUVNIczQ1Y1JlRVhvTHRXbTF3b3NDRzhSTHhmS3doeG9xem9Ua0NkYXJnc6Blbm9uY2VQBQYHCAUGBwgFBgcIBQYHCA"
|
||||
}
|
||||
},
|
||||
"name": "expired invocation",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAR4mfb8ah/x4Ec2ncbW1jfm4T/SSqX2rbe7XSLiXZPTRaSsdR94U/dyC0dviEpYjou21f0iC4DUho1DFzms/bAKJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemVub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the signature of a proof is not verifiable",
|
||||
"error": {
|
||||
"name": "InvalidSignature"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAHU3J47ECvjF9KCPCsIMmur6KzCbZbN1aIhzr7omh4Fpsi+XvLrnTX699HZwgGK4tBf3pi+cFrpxxR10KHxRLAqJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgZ2PkUy2e7sFj+vPz64bBtCo2vEklHkkDcH2bcqqGZu1jc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2RhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "invalid proof signature",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "gkMBAgOiYWhINAHtAe0BE3FzdWNhbi9kbGdAMS4wLjAtcmMuMadjYXVkeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NjbWRpL21zZy9zZW5kY2V4cPZjaXNzeDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemNwb2yAY3N1Yng4ZGlkOmtleTp6Nk1rbVQ5ajZmVlpxelhWOHUyd1ZWU3U0OWdZU1JZR1NRbmR1V1hGNmZvQUpycXplbm9uY2VQAQIDBAECAwQBAgMEAQIDBA"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the signature of the invocation is not verifiable",
|
||||
"error": {
|
||||
"name": "InvalidSignature"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "gkMBAgOiYWhINAHtAe0BE3FzdWNhbi9pbnZAMS4wLjAtcmMuMahjY21kaS9tc2cvc2VuZGNleHD2Y2lhdBpo9XuAY2lzc3g4ZGlkOmtleTp6Nk1rZ0d5a045QVJORmpFem93VnE0bUxQMmtMNE5zeUFhREdYZUpGUTVxRTFiZmdjcHJmgGNzdWJ4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDZGFyZ3OgZW5vbmNlUAECAwQBAgMEAQIDBAECAwQ"
|
||||
}
|
||||
},
|
||||
"name": "invalid invocation signature",
|
||||
"proofs": []
|
||||
},
|
||||
{
|
||||
"description": "the root delegation has a null subject",
|
||||
"error": {
|
||||
"name": "InvalidClaim"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAOf76yuhkNFory2OB/FwO+CNAk5gwLG4/Js0G0BcC722fg2ryeoNUG+c55CNufBk+fgH2i8ETe+fzMC0MKju1BqJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgt6n94T9vRWPC57vQapzS7XNBzK9V3I2xeygms8qzRiBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2RhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "invalid powerline",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA33+8rqRZRkeqDa0Yw2ihnWeEDIJMRw0NhO9GwJo4Y106Yw6FpzxZZAAHrhHwrSc5KIsz1hjnD9j+6N1IQiz0B6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3Vi9mVub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "the invocation violates a policy set in an delegation",
|
||||
"error": {
|
||||
"name": "MatchError"
|
||||
},
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAEthKYbrG9TZn8VtgFRXlLPvkNzruKldy9W0Fsz2uPG7QMwCCSLKVCZ6m6tkleuvfNjFHS7oUPTzlAJoVDPbOA6JhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgxwdNm1TWllZdDo20zoLeaPUWN3JXnT1yd1QNRXaLPyFjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemRhcmdzoWZhbnN3ZXIYKWVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "policy violation",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAJjUfUFt3TlI4pdVLEsOiqy60JIBJ7UPie3bvIdCtPa8pizVxOALlXPXgiPbY04X91l/pqfjLmjfvO0gukE/zBaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIGDYj09Zy5hbnN3ZXIYKmNzdWJ4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6ZW5vbmNlUAECAwQBAgMEAQIDBAECAwQ"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": [
|
||||
{
|
||||
"description": "no proofs, the subject is the issuer so no proof is necessary",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAUv3MZ6zkolZCY2CH7qdfIvjMlUTWsLwJ0YJSse71Y6CMxWZiRmCmSQnzF/rWjxqeWibDsAdnwbgeU5ZdehR/CqJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaAY3N1Yng4ZGlkOmtleTp6Nk1rZ0d5a045QVJORmpFem93VnE0bUxQMmtMNE5zeUFhREdYZUpGUTVxRTFiZmdkYXJnc6Blbm9uY2VQAQIDBAECAwQBAgMEAQIDBA"
|
||||
}
|
||||
},
|
||||
"name": "self signed",
|
||||
"proofs": []
|
||||
},
|
||||
{
|
||||
"description": "a single proof that has no expiry",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAdcYl9DBuAPXRsY+qsB2kemOcTvJ6vIKAsf3gIYL7imHQNAevH5sW2bKgb9btUM2Xjx9KD9PMHyEeM3Ls0bKJA6JhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgMI8CZFZ8CH7BynpUg0BDCfuktrmFJjLSu+KK/DXIDmpjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemRhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "single non-time bounded proof",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAR4mfb8ah/x4Ec2ncbW1jfm4T/SSqX2rbe7XSLiXZPTRaSsdR94U/dyC0dviEpYjou21f0iC4DUho1DFzms/bAKJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemVub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "a single proof that has no expiry and is active (a not before timestamp in the past)",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAOmm+7QD5uqpwCTiJuxauUWr0gTclEBpgddgeVQ+U2t8zEpVESwB+LVts+7IDSCfdo7AWAqg7hRBfc4xHXJ/XCqJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgTH8Q0Iflk+FIroLv27e/IMaijMXphLoS5grrbEfdOBxjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemRhcmdzoGVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "single active non-expired proof",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhATG1Om9LOQykef7Xp3WfygLsX1/4Fuul3y9BtWwHwwtXRAlKQg/TF45kmpiCEWPvO3fpeKFle3mrWV7dCEZNIAaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xqGNhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y25iZhpo9hgzY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemVub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "a proof chain more than one delegation long",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhA74q4zj+6ilxI0pO3LjdqWwwXha7edZX71ZxAb8AzD2/M/s4NykMa3YVKbpV5CiyB8onoFYNHTKAeIDqV4xVaAaJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIgeYBtHcIlGGAgkV3vk0qB0sDih8Kco3ny/NHWBzcsM4HYKlglAAFxEiCAZApnv/CyrmAr4/yrhGrA5kKuHKIghMOkcz9tkg+nJGNzdWJ4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "multiple proofs",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAlC+rtXKanMs7eUsDKDbzBoPI1RIoBhxs3nHh/XbBc9Ou5quAnDM987yV+PAgR6X8nmJ8hQozLL3yEJyCKhuyA6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA1IoOl5rpsUsdwbfKD6Ly/Tf6h90ODLY5ru2FSDJ9s2Z5/kLmFvBlypu9Ff0fnoa7+pKtVlDsucD5aCYINbhRC6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "a proof chain more than one delegation long where one or more proofs have a not before time in the past",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAf9uM0B1/N4AncATj1QGvs1s2OwR9p2Ha6s8zpbgFEVvQ2sUYZhsUQQ58TIOgzipukcVsipU7NbxJwWFGy/iEC6JhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIgWsLKG1xNCqD8GkqaZ/HxOEtMcnBqSebL3O7sCjUa8lXYKlglAAFxEiCAZApnv/CyrmAr4/yrhGrA5kKuHKIghMOkcz9tkg+nJGNzdWJ4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "multiple active proofs",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAGEQPkrF++2YMScD/UnB2gaGhwENHr4uUvGW5vIWmL5845cVBU5uxBknS5dVD+FU5rtuhH7JsExMsw9Gbvn6uBqJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xqGNhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y25iZhpo9hgzY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA1IoOl5rpsUsdwbfKD6Ly/Tf6h90ODLY5ru2FSDJ9s2Z5/kLmFvBlypu9Ff0fnoa7+pKtVlDsucD5aCYINbhRC6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "a proof chain with a powerline delegation (null value for subject)",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhAziUOhJX5mwR8NeB0oeN3N114ud9NPX4VSsZl5pvMwv1/J0y4YMO4dMnZMP4luZWVdMJDh384Ttf/p7U0tslaDKJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaC2CpYJQABcRIgYLbz3tTH2Ehxb9e7SjBbdU2a29964JR6TvWS9W0xlxbYKlglAAFxEiCAZApnv/CyrmAr4/yrhGrA5kKuHKIghMOkcz9tkg+nJGNzdWJ4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDZGFyZ3OgZW5vbmNlUAEBAwgBAQMIAQEDCAEBAwg"
|
||||
}
|
||||
},
|
||||
"name": "powerline",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAGIeARv6xTuoTDPhUnUfrJ+nNTp1DIhvYzmt55gB2vqAzlei5W5QfvGcSOlnZtCGmQjf/LT2pHFGTDJOqvrScB6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIBjc3Vi9mVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhA1IoOl5rpsUsdwbfKD6Ly/Tf6h90ODLY5ru2FSDJ9s2Z5/kLmFvBlypu9Ff0fnoa7+pKtVlDsucD5aCYINbhRC6JhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21KY2VWb1FTSHM0NWNSZUVYb0x0V20xd29zQ0c4Ukx4Zkt3aHhvcXpvVGtDY3BvbIBjc3VieDhkaWQ6a2V5Ono2TWttSmNlVm9RU0hzNDVjUmVFWG9MdFdtMXdvc0NHOFJMeGZLd2h4b3F6b1RrQ2Vub25jZVABAgMEAQIDBAECAwQBAgME"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "a policy that matches the invocation arguments",
|
||||
"invocation": {
|
||||
"/": {
|
||||
"bytes": "glhA8GJF1ltl/tiqkXXMVjB9eJMVkWJlbPn9wEE6y2nr1tySr1yjBcEaGZxpIF5MBxgoSn6vNVXSbwR7EBSn6shxBqJhaEg0Ae0B7QETcXN1Y2FuL2ludkAxLjAuMC1yYy4xqGNjbWRpL21zZy9zZW5kY2V4cPZjaWF0Gmj1e4BjaXNzeDhkaWQ6a2V5Ono2TWtnR3lrTjlBUk5GakV6b3dWcTRtTFAya0w0TnN5QWFER1hlSkZRNXFFMWJmZ2NwcmaB2CpYJQABcRIgxwdNm1TWllZdDo20zoLeaPUWN3JXnT1yd1QNRXaLPyFjc3VieDhkaWQ6a2V5Ono2TWttVDlqNmZWWnF6WFY4dTJ3VlZTdTQ5Z1lTUllHU1FuZHVXWEY2Zm9BSnJxemRhcmdzoWZhbnN3ZXIYKmVub25jZVAFBgcIBQYHCAUGBwgFBgcI"
|
||||
}
|
||||
},
|
||||
"name": "policy match",
|
||||
"proofs": [
|
||||
{
|
||||
"/": {
|
||||
"bytes": "glhAJjUfUFt3TlI4pdVLEsOiqy60JIBJ7UPie3bvIdCtPa8pizVxOALlXPXgiPbY04X91l/pqfjLmjfvO0gukE/zBaJhaEg0Ae0B7QETcXN1Y2FuL2RsZ0AxLjAuMC1yYy4xp2NhdWR4OGRpZDprZXk6ejZNa2dHeWtOOUFSTkZqRXpvd1ZxNG1MUDJrTDROc3lBYURHWGVKRlE1cUUxYmZnY2NtZGkvbXNnL3NlbmRjZXhw9mNpc3N4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6Y3BvbIGDYj09Zy5hbnN3ZXIYKmNzdWJ4OGRpZDprZXk6ejZNa21UOWo2ZlZacXpYVjh1MndWVlN1NDlnWVNSWUdTUW5kdVdYRjZmb0FKcnF6ZW5vbmNlUAECAwQBAgMEAQIDBAECAwQ"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": "1.0.0-rc.1"
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipld/go-ipld-prime"
|
||||
"github.com/ipld/go-ipld-prime/codec"
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||
"github.com/ipld/go-ipld-prime/datamodel"
|
||||
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
// FromSealed decodes an arbitrary token type from the binary data,
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
||||
)
|
||||
|
||||
func RequestResolver(r *http.Request) (*issuer.ResolvedRequest, error) {
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
|
||||
"code.sonr.org/go/ucan/toolkit/client"
|
||||
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
||||
)
|
||||
|
||||
var _ client.DelegationRequester = &Requester{}
|
||||
|
||||
@@ -13,20 +13,20 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
|
||||
"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"
|
||||
"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"
|
||||
|
||||
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||
protocol "code.sonr.org/go/ucan/toolkit/_example/_protocol-issuer"
|
||||
"code.sonr.org/go/ucan/toolkit/client"
|
||||
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||
"code.sonr.org/go/ucan/toolkit/server/bearer"
|
||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
||||
protocol "github.com/ucan-wg/go-ucan/toolkit/_example/_protocol-issuer"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/bearer"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -12,17 +12,17 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
didkeyctl "code.sonr.org/go/did-it/controller/did-key"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
didkeyctl "github.com/MetaMask/go-did-it/controller/did-key"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
|
||||
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||
protocol "code.sonr.org/go/ucan/toolkit/_example/_protocol-issuer"
|
||||
"code.sonr.org/go/ucan/toolkit/client"
|
||||
"code.sonr.org/go/ucan/toolkit/server/bearer"
|
||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
||||
protocol "github.com/ucan-wg/go-ucan/toolkit/_example/_protocol-issuer"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/bearer"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -11,17 +11,17 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
|
||||
"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/delegation"
|
||||
"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/delegation"
|
||||
|
||||
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||
protocol "code.sonr.org/go/ucan/toolkit/_example/_protocol-issuer"
|
||||
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
||||
protocol "github.com/ucan-wg/go-ucan/toolkit/_example/_protocol-issuer"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||
"code.sonr.org/go/ucan/toolkit/server/exectx"
|
||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/exectx"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -3,10 +3,10 @@ package example
|
||||
import (
|
||||
"encoding/base64"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
didkeyctl "code.sonr.org/go/did-it/controller/did-key"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
didkeyctl "github.com/MetaMask/go-did-it/controller/did-key"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
||||
)
|
||||
|
||||
// Endpoints
|
||||
|
||||
@@ -5,15 +5,15 @@ import (
|
||||
"fmt"
|
||||
"iter"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"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/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"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/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"iter"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
|
||||
"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"
|
||||
"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"
|
||||
)
|
||||
|
||||
func ExampleNewClient() {
|
||||
|
||||
@@ -5,12 +5,12 @@ import (
|
||||
"fmt"
|
||||
"iter"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
// DlgIssuingLogic is a function that decides what powers are given to a client.
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
type Pool struct {
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"iter"
|
||||
"math"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
// FindProof find in the pool the best (shortest, smallest in bytes) chain of delegation(s) matching the given invocation parameters.
|
||||
|
||||
@@ -4,12 +4,12 @@ import (
|
||||
"iter"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
||||
)
|
||||
|
||||
func TestFindProof(t *testing.T) {
|
||||
|
||||
@@ -5,11 +5,11 @@ import (
|
||||
"iter"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
"github.com/avast/retry-go/v4"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
type DelegationRequester interface {
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"iter"
|
||||
"net/http"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/toolkit/client"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
||||
)
|
||||
|
||||
type RequestResolver func(r *http.Request) (*ResolvedRequest, error)
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
"fmt"
|
||||
"iter"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
didkeyctl "code.sonr.org/go/did-it/controller/did-key"
|
||||
"code.sonr.org/go/did-it/crypto"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
didkeyctl "github.com/MetaMask/go-did-it/controller/did-key"
|
||||
"github.com/MetaMask/go-did-it/crypto"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/command"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/toolkit/client"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
||||
)
|
||||
|
||||
// RootIssuingLogic is a function that decides what powers are given to a client.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
)
|
||||
|
||||
var ErrNoUcan = fmt.Errorf("no ucan")
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
_ "code.sonr.org/go/did-it/verifiers/did-key"
|
||||
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/pkg/container/containertest"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container/containertest"
|
||||
)
|
||||
|
||||
func TestHTTPBearer(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"code.sonr.org/go/did-it"
|
||||
"github.com/MetaMask/go-did-it"
|
||||
|
||||
"code.sonr.org/go/ucan/toolkit/server/bearer"
|
||||
"github.com/ucan-wg/go-ucan/toolkit/server/bearer"
|
||||
)
|
||||
|
||||
// ExtractMW returns an HTTP middleware tasked with:
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/container"
|
||||
"code.sonr.org/go/ucan/token/delegation"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
"github.com/ucan-wg/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"
|
||||
|
||||
"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"
|
||||
"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"
|
||||
)
|
||||
|
||||
var _ delegation.Loader = &UcanCtx{}
|
||||
|
||||
@@ -8,19 +8,19 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/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"
|
||||
|
||||
"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"
|
||||
"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"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/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"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/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"
|
||||
|
||||
"code.sonr.org/go/ucan/pkg/args"
|
||||
"code.sonr.org/go/ucan/pkg/policy"
|
||||
"code.sonr.org/go/ucan/token/invocation"
|
||||
"github.com/ucan-wg/go-ucan/pkg/args"
|
||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
||||
)
|
||||
|
||||
// HttpArgsKey is the key in the args, used for:
|
||||
|
||||
@@ -5,15 +5,15 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"code.sonr.org/go/did-it/didtest"
|
||||
"github.com/MetaMask/go-did-it/didtest"
|
||||
"github.com/multiformats/go-multihash"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"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"
|
||||
"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"
|
||||
)
|
||||
|
||||
func TestHttp(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user