feat(invocation): produce example output similar to spec
This commit is contained in:
@@ -69,12 +69,14 @@ func New(iss, sub did.DID, cmd command.Command, prf []cid.Cid, opts ...Option) (
|
||||
}
|
||||
|
||||
iat := time.Now()
|
||||
metadata := meta.NewMeta()
|
||||
|
||||
tkn := Token{
|
||||
issuer: iss,
|
||||
subject: sub,
|
||||
command: cmd,
|
||||
proof: prf,
|
||||
meta: metadata,
|
||||
nonce: nonce,
|
||||
invokedAt: &iat,
|
||||
}
|
||||
@@ -85,6 +87,10 @@ func New(iss, sub did.DID, cmd command.Command, prf []cid.Cid, opts ...Option) (
|
||||
}
|
||||
}
|
||||
|
||||
if len(tkn.meta.Keys) == 0 {
|
||||
tkn.meta = nil
|
||||
}
|
||||
|
||||
return &tkn, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user