consul icon indicating copy to clipboard operation
consul copied to clipboard

acl: Token API should return TTL

Open msbit01 opened this issue 7 years ago • 2 comments

Consul 1.5.0 added optional acl token expiration TTLs, which is awesome, but now I'm not seeing a way to check what the TTL is on a token. The "read" API does not include that information: https://www.consul.io/api/acl/tokens.html#read-a-token

Is there a way to check when a token will expire? If not, would it be reasonable to add something to the API for this?

msbit01 avatar Jul 25 '19 18:07 msbit01

Setting an expiration time on an ACL token using a TTL is a convenience feature. It is converted into an explicit expiration time before being persisted to the underlying database.

If you read a token that has has an expiration time it will come back in a field named ExpirationTime

rboyer avatar Jul 26 '19 14:07 rboyer

Ah, my mistake, I hadn't noticed the ExpirationTime. Thank you!

msbit01 avatar Jul 26 '19 18:07 msbit01