essentialkaos / branca

Authenticated encrypted API tokens (IETF XChaCha20-Poly1305 AEAD) for Golang
https://kaos.sh/g/branca.v2
MIT License
85 stars 8 forks source link

[Question]: Why no SetTTL method ? #66

Closed sh0umik closed 2 hours ago

sh0umik commented 3 hours ago

Question

Great library. I was using the other one for a while, but its not maintained anymore. Can not shift to this lib because of no SetTTL method ! Why is this missing ? Is this a design choice ?

Module version info

not using this yet, so ...
andyone commented 2 hours ago

There is no need for such a method. TTL is not part of the token. The token contains a timestamp of its generation. You can check the expiration of the token using the IsExpired method with your TTL.