Compare commits
15 Commits
attestatio
...
v1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fbb8568c0 | |||
| 36717a0826 | |||
| fe8b5a6e4c | |||
| 4c1ae3a0be | |||
| 1f69e9c2c4 | |||
| 4895a069dd | |||
| ec4cc024d4 | |||
| 0c35addf65 | |||
| c5b594dd69 | |||
| b23a6de775 | |||
| 499f83fd6f | |||
| d660445190 | |||
| 869e449383 | |||
| 6b9698c1e8 | |||
| 33841ea261 |
20
.github/Repo.toml
vendored
Normal file
20
.github/Repo.toml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[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"]
|
||||||
16
Readme.md
16
Readme.md
@@ -1,5 +1,5 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://github.com/ucan-wg/go-ucan" target="_blank">
|
<a href="https://code.sonr.org/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>
|
<img src="https://raw.githubusercontent.com/ucan-wg/go-ucan/v1/assets/logo.png" alt="go-ucan Logo" height="250"></img>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@@ -7,19 +7,19 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<img src="https://img.shields.io/badge/UCAN-v1.0.0--rc.1-blue" alt="UCAN v1.0.0-rc.1">
|
<img src="https://img.shields.io/badge/UCAN-v1.0.0--rc.1-blue" alt="UCAN v1.0.0-rc.1">
|
||||||
<a href="https://github.com/ucan-wg/go-ucan/tags">
|
<a href="https://code.sonr.org/go/ucan/tags">
|
||||||
<img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/ucan-wg/go-ucan">
|
<img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/ucan-wg/go-ucan">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/ucan-wg/go-ucan/actions?query=">
|
<a href="https://code.sonr.org/go/ucan/actions?query=">
|
||||||
<img src="https://github.com/ucan-wg/go-ucan/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
|
<img src="https://code.sonr.org/go/ucan/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://ucan-wg.github.io/go-ucan/dev/bench/">
|
<a href="https://ucan-wg.github.io/go-ucan/dev/bench/">
|
||||||
<img alt="Go benchmarks" src="https://img.shields.io/badge/Benchmarks-go-blue">
|
<img alt="Go benchmarks" src="https://img.shields.io/badge/Benchmarks-go-blue">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/ucan-wg/go-ucan/blob/v1/LICENSE.md">
|
<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">
|
<img alt="Apache 2.0 OR MIT License" src="https://img.shields.io/badge/License-Apache--2.0_OR_MIT-green">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://pkg.go.dev/github.com/ucan-wg/go-ucan">
|
<a href="https://pkg.go.dev/code.sonr.org/go/ucan">
|
||||||
<img src="https://img.shields.io/badge/Docs-godoc-blue" alt="Docs">
|
<img src="https://img.shields.io/badge/Docs-godoc-blue" alt="Docs">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://discord.gg/JSyFG6XgVM">
|
<a href="https://discord.gg/JSyFG6XgVM">
|
||||||
@@ -54,7 +54,7 @@ Not implemented yet:
|
|||||||
|
|
||||||
## Status
|
## 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://github.com/MetaMask/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://code.sonr.org/go/did-it) for easy and extensible DID support.
|
||||||
|
|
||||||
Besides that, `go-ucan` also includes:
|
Besides that, `go-ucan` also includes:
|
||||||
- support for encrypted values in token's metadata
|
- 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
|
## License
|
||||||
|
|
||||||
This project is licensed under the dual license [Apache 2.0 OR MIT](https://github.com/ucan-wg/go-ucan/blob/v1/LICENSE.md).
|
This project is licensed under the dual license [Apache 2.0 OR MIT](https://code.sonr.org/go/ucan/blob/v1/LICENSE.md).
|
||||||
|
|||||||
10
go.mod
10
go.mod
@@ -1,21 +1,21 @@
|
|||||||
module github.com/ucan-wg/go-ucan
|
module code.sonr.org/go/ucan
|
||||||
|
|
||||||
go 1.24.4
|
go 1.24.4
|
||||||
|
|
||||||
toolchain go1.24.5
|
toolchain go1.24.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/MetaMask/go-did-it v1.0.0-pre1
|
code.sonr.org/go/did-it v1.0.0
|
||||||
github.com/avast/retry-go/v4 v4.6.1
|
github.com/avast/retry-go/v4 v4.6.1
|
||||||
github.com/ipfs/go-cid v0.5.0
|
github.com/ipfs/go-cid v0.5.0
|
||||||
github.com/ipld/go-ipld-prime v0.21.0
|
github.com/ipld/go-ipld-prime v0.21.0
|
||||||
github.com/multiformats/go-multibase v0.2.0
|
github.com/multiformats/go-multibase v0.2.0
|
||||||
github.com/multiformats/go-multicodec v0.9.0
|
github.com/multiformats/go-multicodec v0.9.0
|
||||||
github.com/multiformats/go-multihash v0.2.3
|
github.com/multiformats/go-multihash v0.2.3
|
||||||
github.com/multiformats/go-varint v0.0.7
|
github.com/multiformats/go-varint v0.1.0
|
||||||
github.com/stretchr/testify v1.10.0
|
github.com/stretchr/testify v1.10.0
|
||||||
github.com/ucan-wg/go-varsig v1.0.0
|
github.com/ucan-wg/go-varsig v1.0.0
|
||||||
golang.org/x/crypto v0.40.0
|
golang.org/x/crypto v0.45.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -29,7 +29,7 @@ require (
|
|||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/polydawn/refmt v0.89.0 // indirect
|
github.com/polydawn/refmt v0.89.0 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
golang.org/x/sys v0.34.0 // indirect
|
golang.org/x/sys v0.38.0 // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
lukechampine.com/blake3 v1.3.0 // 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/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 h1:VkOLRubHdisGrHnTu89g08aQEWEgRU7LVEop3GbIcMk=
|
||||||
github.com/avast/retry-go/v4 v4.6.1/go.mod h1:V6oF8njAwxJ5gRo1Q7Cxab24xs5NCWZBeaHHBklR8mA=
|
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=
|
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-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 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
|
||||||
github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
|
github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
|
||||||
github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8=
|
github.com/multiformats/go-varint v0.1.0 h1:i2wqFp4sdl3IcIxfAonHQV9qU5OsZ4Ts9IOoETFs5dI=
|
||||||
github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
|
github.com/multiformats/go-varint v0.1.0/go.mod h1:5KVAVXegtfmNQQm/lCY+ATvDzvJJhSkUlGQV9wgObdI=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
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/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4=
|
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 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ=
|
||||||
github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw=
|
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.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
|
||||||
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
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.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
||||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
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=
|
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=
|
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/node/basicnode"
|
||||||
"github.com/ipld/go-ipld-prime/printer"
|
"github.com/ipld/go-ipld-prime/printer"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNotFound = errors.New("key not found in meta")
|
var ErrNotFound = errors.New("key not found in meta")
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ 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/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestArgs(t *testing.T) {
|
func TestArgs(t *testing.T) {
|
||||||
|
|||||||
@@ -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/pkg/args"
|
"code.sonr.org/go/ucan/pkg/args"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBuilder_XXX(t *testing.T) {
|
func TestBuilder_XXX(t *testing.T) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTop(t *testing.T) {
|
func TestTop(t *testing.T) {
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/codec/cbor"
|
"github.com/ipld/go-ipld-prime/codec/cbor"
|
||||||
"github.com/ipld/go-ipld-prime/datamodel"
|
"github.com/ipld/go-ipld-prime/datamodel"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/token"
|
"code.sonr.org/go/ucan/token"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNotFound = fmt.Errorf("not found")
|
var ErrNotFound = fmt.Errorf("not found")
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"github.com/MetaMask/go-did-it/controller/did-key"
|
"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/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestContainerRoundTrip(t *testing.T) {
|
func TestContainerRoundTrip(t *testing.T) {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime"
|
"github.com/ipld/go-ipld-prime"
|
||||||
"github.com/ipld/go-ipld-prime/printer"
|
"github.com/ipld/go-ipld-prime/printer"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/secretbox"
|
"code.sonr.org/go/ucan/pkg/secretbox"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNotFound = errors.New("key not found in meta")
|
var ErrNotFound = errors.New("key not found in meta")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
"code.sonr.org/go/ucan/pkg/meta"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMeta_Add(t *testing.T) {
|
func TestMeta_Add(t *testing.T) {
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/must"
|
"github.com/ipld/go-ipld-prime/must"
|
||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/selector"
|
"code.sonr.org/go/ucan/pkg/policy/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FromIPLD(node datamodel.Node) (Policy, error) {
|
func FromIPLD(node datamodel.Node) (Policy, error) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
|
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
|
||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Bool = basicnode.NewBool
|
var Bool = basicnode.NewBool
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/printer"
|
"github.com/ipld/go-ipld-prime/printer"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestList(t *testing.T) {
|
func TestList(t *testing.T) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMatch(t *testing.T) {
|
func TestMatch(t *testing.T) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime"
|
"github.com/ipld/go-ipld-prime"
|
||||||
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
"github.com/ipld/go-ipld-prime/codec/dagjson"
|
||||||
|
|
||||||
selpkg "github.com/ucan-wg/go-ucan/pkg/policy/selector"
|
selpkg "code.sonr.org/go/ucan/pkg/policy/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExamplePolicy() {
|
func ExamplePolicy() {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package policytest
|
|||||||
import (
|
import (
|
||||||
"github.com/ipld/go-ipld-prime"
|
"github.com/ipld/go-ipld-prime"
|
||||||
|
|
||||||
"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/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EmptyPolicy provides a Policy with no statements.
|
// EmptyPolicy provides a Policy with no statements.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
basicnode "github.com/ipld/go-ipld-prime/node/basic"
|
basicnode "github.com/ipld/go-ipld-prime/node/basic"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/selector"
|
"code.sonr.org/go/ucan/pkg/policy/selector"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestSupported Forms runs tests against the Selector according to the
|
// TestSupported Forms runs tests against the Selector according to the
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
|
|
||||||
"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/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"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 delegation.
|
// Token is an immutable type that holds the fields of a UCAN delegation.
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed testdata/new.dagjson
|
//go:embed testdata/new.dagjson
|
||||||
|
|||||||
@@ -9,17 +9,17 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"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"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"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"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -215,7 +215,7 @@ func (g *generator) writeGoFile() error {
|
|||||||
Println("import (")
|
Println("import (")
|
||||||
Println("\t\"github.com/ipfs/go-cid\"")
|
Println("\t\"github.com/ipfs/go-cid\"")
|
||||||
Println()
|
Println()
|
||||||
Println("\t\"github.com/ucan-wg/go-ucan/token/delegation\"")
|
Println("\t\"code.sonr.org/go/ucan/token/delegation\"")
|
||||||
Println(")")
|
Println(")")
|
||||||
|
|
||||||
refs := make(map[cid.Cid]string, len(g.dlgs))
|
refs := make(map[cid.Cid]string, len(g.dlgs))
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
|
_ "code.sonr.org/go/did-it/verifiers/did-key"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package delegationtest
|
|||||||
import (
|
import (
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ 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/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetDelegation(t *testing.T) {
|
func TestGetDelegation(t *testing.T) {
|
||||||
|
|||||||
@@ -8,17 +8,17 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The following example shows how to create a delegation.Token with
|
// The following example shows how to create a delegation.Token with
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"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/multiformats/go-varint"
|
"github.com/multiformats/go-varint"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package delegation
|
|||||||
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 delegation token in an envelope, generates the
|
// 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/node/bindnode"
|
||||||
"github.com/ipld/go-ipld-prime/schema"
|
"github.com/ipld/go-ipld-prime/schema"
|
||||||
|
|
||||||
"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 (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
"github.com/ipld/go-ipld-prime"
|
"github.com/ipld/go-ipld-prime"
|
||||||
"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/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/internal/envelope"
|
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed delegation.ipldsch
|
//go:embed delegation.ipldsch
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package token
|
|||||||
import (
|
import (
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Info = envelope.Info
|
type Info = envelope.Info
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/codec"
|
"github.com/ipld/go-ipld-prime/codec"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,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/internal/envelope"
|
"code.sonr.org/go/ucan/token/internal/envelope"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCidFromBytes(t *testing.T) {
|
func TestCidFromBytes(t *testing.T) {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"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/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/datamodel"
|
"github.com/ipld/go-ipld-prime/datamodel"
|
||||||
@@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/schema"
|
"github.com/ipld/go-ipld-prime/schema"
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/schema"
|
"github.com/ipld/go-ipld-prime/schema"
|
||||||
"github.com/ucan-wg/go-varsig"
|
"github.com/ucan-wg/go-varsig"
|
||||||
|
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
|
_ "code.sonr.org/go/did-it/verifiers/did-key"
|
||||||
"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/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"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDecode(t *testing.T) {
|
func TestDecode(t *testing.T) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
func OptionalDID(s *string) (did.DID, error) {
|
func OptionalDID(s *string) (did.DID, error) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/limits"
|
"code.sonr.org/go/ucan/pkg/policy/limits"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestOptionalTimestamp(t *testing.T) {
|
func TestOptionalTimestamp(t *testing.T) {
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"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,9 +12,9 @@ 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/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FromSealed decodes an arbitrary token type from the binary data,
|
// FromSealed decodes an arbitrary token type from the binary data,
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RequestResolver(r *http.Request) (*issuer.ResolvedRequest, error) {
|
func RequestResolver(r *http.Request) (*issuer.ResolvedRequest, error) {
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
"code.sonr.org/go/ucan/toolkit/client"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ client.DelegationRequester = &Requester{}
|
var _ client.DelegationRequester = &Requester{}
|
||||||
|
|||||||
@@ -13,20 +13,20 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
|
|
||||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||||
protocol "github.com/ucan-wg/go-ucan/toolkit/_example/_protocol-issuer"
|
protocol "code.sonr.org/go/ucan/toolkit/_example/_protocol-issuer"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
"code.sonr.org/go/ucan/toolkit/client"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/server/bearer"
|
"code.sonr.org/go/ucan/toolkit/server/bearer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -12,17 +12,17 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
|
|
||||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||||
protocol "github.com/ucan-wg/go-ucan/toolkit/_example/_protocol-issuer"
|
protocol "code.sonr.org/go/ucan/toolkit/_example/_protocol-issuer"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
"code.sonr.org/go/ucan/toolkit/client"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/server/bearer"
|
"code.sonr.org/go/ucan/toolkit/server/bearer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -11,17 +11,17 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
|
|
||||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||||
protocol "github.com/ucan-wg/go-ucan/toolkit/_example/_protocol-issuer"
|
protocol "code.sonr.org/go/ucan/toolkit/_example/_protocol-issuer"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/issuer"
|
"code.sonr.org/go/ucan/toolkit/issuer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
|
|
||||||
example "github.com/ucan-wg/go-ucan/toolkit/_example"
|
example "code.sonr.org/go/ucan/toolkit/_example"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/server/exectx"
|
"code.sonr.org/go/ucan/toolkit/server/exectx"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package example
|
|||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
|
||||||
"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"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
"github.com/MetaMask/go-did-it/crypto/ed25519"
|
"code.sonr.org/go/did-it/crypto/ed25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Endpoints
|
// Endpoints
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"iter"
|
"iter"
|
||||||
|
|
||||||
"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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"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"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import (
|
|||||||
"iter"
|
"iter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"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"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExampleNewClient() {
|
func ExampleNewClient() {
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"iter"
|
"iter"
|
||||||
|
|
||||||
"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/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DlgIssuingLogic is a function that decides what powers are given to a client.
|
// DlgIssuingLogic is a function that decides what powers are given to a client.
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"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/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Pool struct {
|
type Pool struct {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import (
|
|||||||
"iter"
|
"iter"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"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/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FindProof find in the pool the best (shortest, smallest in bytes) chain of delegation(s) matching the given invocation parameters.
|
// 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"
|
"iter"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation/delegationtest"
|
"code.sonr.org/go/ucan/token/delegation/delegationtest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFindProof(t *testing.T) {
|
func TestFindProof(t *testing.T) {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import (
|
|||||||
"iter"
|
"iter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
"github.com/avast/retry-go/v4"
|
"github.com/avast/retry-go/v4"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DelegationRequester interface {
|
type DelegationRequester interface {
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import (
|
|||||||
"iter"
|
"iter"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it"
|
"code.sonr.org/go/did-it"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
"code.sonr.org/go/ucan/toolkit/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestResolver func(r *http.Request) (*ResolvedRequest, error)
|
type RequestResolver func(r *http.Request) (*ResolvedRequest, error)
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"iter"
|
"iter"
|
||||||
|
|
||||||
"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"
|
"code.sonr.org/go/did-it/crypto"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/client"
|
"code.sonr.org/go/ucan/toolkit/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RootIssuingLogic is a function that decides what powers are given to a client.
|
// RootIssuingLogic is a function that decides what powers are given to a client.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNoUcan = fmt.Errorf("no ucan")
|
var ErrNoUcan = fmt.Errorf("no ucan")
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"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/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container/containertest"
|
"code.sonr.org/go/ucan/pkg/container/containertest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHTTPBearer(t *testing.T) {
|
func TestHTTPBearer(t *testing.T) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"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:
|
// ExtractMW returns an HTTP middleware tasked with:
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"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/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestExtractMW(t *testing.T) {
|
func TestExtractMW(t *testing.T) {
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ import (
|
|||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipld/go-ipld-prime/datamodel"
|
"github.com/ipld/go-ipld-prime/datamodel"
|
||||||
|
|
||||||
"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/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
"code.sonr.org/go/ucan/pkg/meta"
|
||||||
"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"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/server/extargs"
|
"code.sonr.org/go/ucan/toolkit/server/extargs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ delegation.Loader = &UcanCtx{}
|
var _ delegation.Loader = &UcanCtx{}
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/ipld/go-ipld-prime/datamodel"
|
"github.com/ipld/go-ipld-prime/datamodel"
|
||||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
"code.sonr.org/go/ucan/pkg/command"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/container"
|
"code.sonr.org/go/ucan/pkg/container"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
"code.sonr.org/go/ucan/token/delegation"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
"github.com/ucan-wg/go-ucan/toolkit/server/exectx"
|
"code.sonr.org/go/ucan/toolkit/server/exectx"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
|
|
||||||
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CustomExtArgs struct {
|
type CustomExtArgs struct {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/fluent/qp"
|
"github.com/ipld/go-ipld-prime/fluent/qp"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExampleCustomExtArgs() {
|
func ExampleCustomExtArgs() {
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/node/basicnode"
|
"github.com/ipld/go-ipld-prime/node/basicnode"
|
||||||
"github.com/multiformats/go-multihash"
|
"github.com/multiformats/go-multihash"
|
||||||
|
|
||||||
"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/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HttpArgsKey is the key in the args, used for:
|
// HttpArgsKey is the key in the args, used for:
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/MetaMask/go-did-it/didtest"
|
"code.sonr.org/go/did-it/didtest"
|
||||||
"github.com/multiformats/go-multihash"
|
"github.com/multiformats/go-multihash"
|
||||||
"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"
|
"code.sonr.org/go/ucan/pkg/policy"
|
||||||
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
|
"code.sonr.org/go/ucan/pkg/policy/literal"
|
||||||
"github.com/ucan-wg/go-ucan/token/invocation"
|
"code.sonr.org/go/ucan/token/invocation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHttp(t *testing.T) {
|
func TestHttp(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user