add an early version of a UCAN client
This commit is contained in:
committed by
Michael Muré
parent
174bf01c64
commit
4c08b22c61
19
toolkit/client/requester.go
Normal file
19
toolkit/client/requester.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"iter"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/did"
|
||||
"github.com/ucan-wg/go-ucan/pkg/command"
|
||||
"github.com/ucan-wg/go-ucan/token/delegation"
|
||||
)
|
||||
|
||||
type DelegationRequester interface {
|
||||
// RequestDelegation retrieve a delegation or chain of delegation for the given parameters.
|
||||
// - cmd: the command to execute
|
||||
// - issuer: the DID of the client, also the issuer of the invocation token
|
||||
// - audience: the DID of the resource to operate on, also the subject (or audience if defined) of the invocation token
|
||||
// Note: the returned delegation(s) don't have to match exactly the parameters, as long as they allow them.
|
||||
RequestDelegation(ctx context.Context, cmd command.Command, audience did.DID, subject did.DID) (iter.Seq2[*delegation.Bundle, error], error)
|
||||
}
|
||||
Reference in New Issue
Block a user