add a new Attestation token, for proving claims or DID ownership
Specification is TBD
This commit is contained in:
committed by
Michael Muré
parent
4b99c9f1df
commit
3b8fb6d34d
@@ -31,7 +31,6 @@ func WithArgument(key string, val any) Option {
|
||||
func WithArguments(args *args.Args) Option {
|
||||
return func(t *Token) error {
|
||||
t.arguments.Include(args)
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -65,6 +64,23 @@ func WithMeta(key string, val any) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithMetaMap adds all key/value pairs in the provided map to the
|
||||
// Token's "meta" field.
|
||||
//
|
||||
// WithMetaMap can be used multiple times in the same call.
|
||||
// Accepted types for the value are: bool, string, int, int32, int64, []byte,
|
||||
// and ipld.Node.
|
||||
func WithMetaMap(m map[string]any) Option {
|
||||
return func(t *Token) error {
|
||||
for k, v := range m {
|
||||
if err := t.meta.Add(k, v); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithEncryptedMetaString adds a key/value pair in the "meta" field.
|
||||
// The string value is encrypted with the given aesKey.
|
||||
func WithEncryptedMetaString(key, val string, encryptionKey []byte) Option {
|
||||
|
||||
Reference in New Issue
Block a user