Hi Alex,
On Thu, Oct 22, 2015 at 10:31 AM, Alex Urcioli <
ale...@gmail.com> wrote:
> I've created a token from the CLI and mapped it to a policy. This token will
> be used to access a "master seed" value for some totp codes. Documentation
> specifically states that: "Every token has a lease associated with it. After
> the lease period is up, the token will no longer function. In addition to no
> longer functioning, Vault will revoke it."
> (
https://www.vaultproject.io/docs/concepts/tokens.html)
> However, when I query the API /auth/token/lookup/<created_token> (using my
> root token as x-vault-token header), I get the following response:
> How come I can not renew this token, and how come it has no lease_id? Does
> this token never expire?
Root tokens are special -- unlike other tokens, they are allowed to
have an infinite lifetime. So this particular token will indeed never
expire, and since only tokens that can expire are renewable, this
token is not renewable. If you attempt to hit the
/v1/auth/token/renew-self endpoint you will see that you get an error,
but any non-root token will have a finite lifetime and be renewable.
How renewability is handled in a general sense varies a little bit
per-backend (something that we hope to make more standardized going
forward). In general, if you give an explicit TTL, the lease will be
renewable; if not, it will not be.
The reason you don't have a lease-id is that leases are associated
with tokens, not the other way around. That part of the documentation
is still a holdover that we've slowly been fixing up from when "lease"
was overloaded to mean both "borrowed metadata/credentials, including
a duration" and simply "a duration". I'll mark that to get fixed.
> Will it expire after 30 days? If this token expires
> and I am no longer able to access the "master seed" then the entire database
> of codes becomes unusable.
The root token will not expire, so can always be used to access the
information, or create more tokens. Generally policies are created to
control access to various parts of the vault, then the various
authentication backends are used to create and distribute access
tokens after successful authentication.
Let us know if you have more questions!
--Jeff