Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions commands/access/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions commands/access/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

package access

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
command "github.com/fil-forge/ucantone/ucan/command"
)

type ClaimArguments = commands.Unit

// Claim can be invoked by an agent to claim a set of delegations from the
// account.
var Claim = commands.MustParse[*ClaimArguments]("/access/claim")
var Claim = binding.Bind[*ClaimArguments, *ClaimOK](command.MustParse("/access/claim"))
5 changes: 3 additions & 2 deletions commands/access/confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
package access

import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/errors"
command "github.com/fil-forge/ucantone/ucan/command"
)

// ConfirmOK mirrors ClaimOK — confirming an access request grants the same
Expand All @@ -17,7 +18,7 @@ type ConfirmOK = ClaimOK
const ConfirmMetaKey = "accessConfirm"

// Confirm can be invoked by an agent to confirm an access request.
var Confirm = commands.MustParse[*ConfirmArguments]("/access/confirm")
var Confirm = binding.Bind[*ConfirmArguments, *ConfirmOK](command.MustParse("/access/confirm"))

const (
InvalidAccessConfirmSubjectErrorName = "InvalidAccessConfirmSubject"
Expand Down
8 changes: 6 additions & 2 deletions commands/access/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

package access

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
command "github.com/fil-forge/ucantone/ucan/command"
)

type DelegateOK = commands.Unit

// Delegate can be invoked by an agent to delegate a set of capabilities that
// may be subsequently claimed by another agent.
var Delegate = commands.MustParse[*DelegateArguments]("/access/delegate")
var Delegate = binding.Bind[*DelegateArguments, *DelegateOK](command.MustParse("/access/delegate"))

const (
DelegationNotFoundErrorName = "DelegationNotFound"
Expand Down
6 changes: 3 additions & 3 deletions commands/access/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
package access

import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/errors"

"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/ucan/command"
)

const GrantCommand = "/access/grant"
Expand All @@ -18,7 +18,7 @@ type GrantOK = ClaimOK
// Grant can be invoked by an agent to request that a set of capabilities be
// granted directly. Unlike Request -> Confirm, Grant is one-shot: the
// executor decides immediately whether to issue the delegation.
var Grant = commands.MustParse[*GrantArguments](GrantCommand)
var Grant = binding.Bind[*GrantArguments, *GrantOK](command.MustParse(GrantCommand))

const (
UnknownAbilityErrorName = "UnknownAbility"
Expand Down
25 changes: 8 additions & 17 deletions commands/access/json_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions commands/access/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package access

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
command "github.com/fil-forge/ucantone/ucan/command"
)

// RequestFactKey is the key in metadata in any delegation created by a
// successful access request. The value is a link back to the `/access/request`
Expand All @@ -11,7 +14,7 @@ const RequestMetaKey = "accessRequest"

// Request can be invoked by an agent to request set of capabilities from the
// account.
var Request = commands.MustParse[*RequestArguments]("/access/request")
var Request = binding.Bind[*RequestArguments, *RequestOK](command.MustParse("/access/request"))

const (
InvalidAuthorizationAccountErrorName = "InvalidAuthorizationAccount"
Expand Down
8 changes: 6 additions & 2 deletions commands/assert/equals.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

package assert

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

type EqualsOK = commands.Unit

// Equals claims data is referred to by another CID e.g CAR CID & Piece CID
var Equals = commands.MustParse[*EqualsArguments]("/assert/equals")
var Equals = binding.Bind[*EqualsArguments, *EqualsOK](command.MustParse("/assert/equals"))
8 changes: 6 additions & 2 deletions commands/assert/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

package assert

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

type IndexOK = commands.Unit

// Index claims that a content graph can be found in blob(s) that are identified
// and indexed in the given index CID.
var Index = commands.MustParse[*IndexArguments]("/assert/index")
var Index = binding.Bind[*IndexArguments, *IndexOK](command.MustParse("/assert/index"))
8 changes: 6 additions & 2 deletions commands/assert/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

package assert

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

type LocationOK = commands.Unit

var Location = commands.MustParse[*LocationArguments]("/assert/location")
var Location = binding.Bind[*LocationArguments, *LocationOK](command.MustParse("/assert/location"))
16 changes: 0 additions & 16 deletions commands/bind.go

This file was deleted.

7 changes: 5 additions & 2 deletions commands/blob/accept.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

var Accept = commands.MustParse[*AcceptArguments]("/blob/accept")
var Accept = binding.Bind[*AcceptArguments, *AcceptOK](command.MustParse("/blob/accept"))
7 changes: 5 additions & 2 deletions commands/blob/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

var Add = commands.MustParse[*AddArguments]("/blob/add")
var Add = binding.Bind[*AddArguments, *AddOK](command.MustParse("/blob/add"))
7 changes: 5 additions & 2 deletions commands/blob/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

const MaxBlobSize = 268_435_456

var Allocate = commands.MustParse[*AllocateArguments]("/blob/allocate")
var Allocate = binding.Bind[*AllocateArguments, *AllocateOK](command.MustParse("/blob/allocate"))
7 changes: 5 additions & 2 deletions commands/blob/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

var List = commands.MustParse[*ListArguments]("/blob/list")
var List = binding.Bind[*ListArguments, *ListOK](command.MustParse("/blob/list"))
8 changes: 6 additions & 2 deletions commands/blob/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/libforge/commands"
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

type RemoveOK = commands.Unit

var Remove = commands.MustParse[*RemoveArguments]("/blob/remove")
var Remove = binding.Bind[*RemoveArguments, *RemoveOK](command.MustParse("/blob/remove"))
7 changes: 5 additions & 2 deletions commands/blob/replica/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package replica

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

var Allocate = commands.MustParse[*AllocateArguments]("/blob/replica/allocate")
var Allocate = binding.Bind[*AllocateArguments, *AllocateOK](command.MustParse("/blob/replica/allocate"))
7 changes: 5 additions & 2 deletions commands/blob/replica/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package replica

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

var Transfer = commands.MustParse[*TransferArguments]("/blob/replica/transfer")
var Transfer = binding.Bind[*TransferArguments, *TransferOK](command.MustParse("/blob/replica/transfer"))
7 changes: 5 additions & 2 deletions commands/blob/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

// Replicate is a capability that allows an agent to replicate a Blob into a
// space identified by did:key in the `with` field.
Expand All @@ -18,4 +21,4 @@ import "github.com/fil-forge/libforge/commands"
// transferred and stored the blob. The number of `/blob/replica/allocate` and
// `/blob/replica/transfer` tasks corresponds directly to number of replicas
// requested.
var Replicate = commands.MustParse[*ReplicateArguments]("/blob/replicate")
var Replicate = binding.Bind[*ReplicateArguments, *ReplicateOK](command.MustParse("/blob/replicate"))
7 changes: 5 additions & 2 deletions commands/blob/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

package blob

import "github.com/fil-forge/libforge/commands"
import (
"github.com/fil-forge/ucantone/binding"
"github.com/fil-forge/ucantone/ucan/command"
)

// Retrieve is the service-level retrieval capability (e.g. used by the
// indexer to fetch content claims from a Piri node). It is NOT space-scoped:
Expand All @@ -12,4 +15,4 @@ import "github.com/fil-forge/libforge/commands"
// For user-facing retrieval that requires an allocation in a specific space
// see `libforge/commands/content.Retrieve` (the `/content/retrieve`
// capability).
var Retrieve = commands.MustParse[*RetrieveArguments]("/blob/retrieve")
var Retrieve = binding.Bind[*RetrieveArguments, *RetrieveOK](command.MustParse("/blob/retrieve"))
Loading
Loading