Skip to content

Commit

Permalink
Add versionadded tags to new funcs/params
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb committed Apr 24, 2024
1 parent 7c1922e commit 605e1ed
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/saltext/vault/utils/vault/leases.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def is_valid_for(self, valid_for=0, blur=0):

@property
def ttl_left(self):
"""
.. versionadded:: 1.1.0
Return the time in seconds until the lease expires.
"""
return max(self.expire_time - round(time.time()), 0)


Expand Down Expand Up @@ -183,18 +188,26 @@ class VaultLease(BaseLease):
valid for at least this amount of time, even if the
passed ``valid_for`` parameter is less.
.. versionadded:: 1.1.0
renew_increment
When renewing this lease, instead of the lease's default TTL,
default to this increment.
.. versionadded:: 1.1.0
revoke_delay
When revoking this lease, instead of the default value of 60,
default to this amount of time before having the Vault server
revoke it.
.. versionadded:: 1.1.0
meta
Cache arbitrary metadata together with the lease. It will
be included in expiry events.
.. versionadded:: 1.1.0
"""

def __init__(
Expand Down Expand Up @@ -451,6 +464,8 @@ def get(
check_server
Check on the Vault server whether the lease is still active and was not
revoked early. Defaults to false.
.. versionadded:: 1.1.0
"""
if renew_increment is not None and timestring_map(valid_for) > timestring_map(
renew_increment
Expand Down Expand Up @@ -543,6 +558,8 @@ def _list_cached_leases(self, match="*", flush=False):

def list_info(self, match="*"):
"""
.. versionadded:: 1.1.0
List cached leases.
match
Expand Down

0 comments on commit 605e1ed

Please sign in to comment.