feat(invocation): ipld unseal to invocation

This commit is contained in:
Steve Moyer
2024-11-04 16:07:11 -05:00
parent a98653b769
commit 187e7a869c
5 changed files with 88 additions and 21 deletions

View File

@@ -86,6 +86,7 @@ func WithEmptyNonce() Option {
// value of the provided time.Time.
func WithExpiration(exp time.Time) Option {
return func(t *Token) error {
exp = exp.Round(time.Second)
t.expiration = &exp
return nil
@@ -96,7 +97,7 @@ func WithExpiration(exp time.Time) Option {
// Now() plus the given duration.
func WithExpirationIn(exp time.Duration) Option {
return func(t *Token) error {
expTime := time.Now().Add(exp)
expTime := time.Now().Add(exp).Round(time.Minute)
t.expiration = &expTime
return nil