add a new Attestation token, for proving claims or DID ownership

Specification is TBD
This commit is contained in:
Michael Muré
2026-01-07 13:11:07 +01:00
committed by Michael Muré
parent 4b99c9f1df
commit 3b8fb6d34d
14 changed files with 1450 additions and 1 deletions

View File

@@ -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 {