wip API exploration
This commit is contained in:
@@ -7,30 +7,17 @@ import (
|
|||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipld/go-ipld-prime/codec"
|
"github.com/ipld/go-ipld-prime/codec"
|
||||||
"github.com/libp2p/go-libp2p/core/crypto"
|
"github.com/libp2p/go-libp2p/core/crypto"
|
||||||
"github.com/ucan-wg/go-ucan/did"
|
|
||||||
"github.com/ucan-wg/go-ucan/pkg/meta"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Token interface {
|
type Token interface {
|
||||||
Marshaller
|
Marshaller
|
||||||
|
|
||||||
// Issuer returns the did.DID representing the Token's issuer.
|
|
||||||
Issuer() did.DID
|
|
||||||
// Meta returns the Token's metadata.
|
|
||||||
Meta() meta.ReadOnly
|
|
||||||
// TODO: not sure we actually need that interface
|
|
||||||
|
|
||||||
// IsValidNow verifies that the token can be used at the current time, based on expiration or "not before" fields.
|
// IsValidNow verifies that the token can be used at the current time, based on expiration or "not before" fields.
|
||||||
// This does NOT do any other kind of verifications.
|
// This does NOT do any other kind of verifications.
|
||||||
IsValidNow() bool
|
IsValidNow() bool
|
||||||
// IsValidNow verifies that the token can be used at the given time, based on expiration or "not before" fields.
|
// IsValidNow verifies that the token can be used at the given time, based on expiration or "not before" fields.
|
||||||
// This does NOT do any other kind of verifications.
|
// This does NOT do any other kind of verifications.
|
||||||
IsValidAt(t time.Time) bool
|
IsValidAt(t time.Time) bool
|
||||||
|
|
||||||
// // Issuer returns the did.DID representing the Token's issuer.
|
|
||||||
// Issuer() did.DID
|
|
||||||
// // Meta returns the Token's metadata.
|
|
||||||
// Meta() *meta.Meta
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Marshaller interface {
|
type Marshaller interface {
|
||||||
|
|||||||
Reference in New Issue
Block a user