Skip to content

Commit

Permalink
Implement activedirectory.rotate_credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
hkgnobody committed Apr 15, 2024
1 parent a0418e2 commit 8058eb0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hvac/api/secrets_engines/active_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,18 @@ def generate_credentials(self, name, mount_point=DEFAULT_MOUNT_POINT):
return self._adapter.get(
url=api_path,
)

def rotate_credentials(self, name, mount_point=DEFAULT_MOUNT_POINT):
"""This endpoint triggers a force rotate LDAP password for the associated account
:param name: Specifies the name of the role to request credentials from.
:type name: str | unicode
:param mount_point: Specifies the place where the secrets engine will be accessible (default: ad).
:type mount_point: str | unicode
:return: The response of the request.
:rtype: requests.Response
"""
api_path = utils.format_url("/v1/{}/rotate-role/{}", mount_point, name)
return self._adapter.post(
url=api_path,
)

0 comments on commit 8058eb0

Please sign in to comment.