Skip to content

Commit

Permalink
Add read for static roles in database engine (#1009)
Browse files Browse the repository at this point in the history
Add a method to read static roles in the database engine
  • Loading branch information
mimato committed Jun 21, 2023
1 parent 3b4e5ca commit 2786bb8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions hvac/api/secrets_engines/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,25 @@ def read_role(self, name, mount_point=DEFAULT_MOUNT_POINT):
url=api_path,
)

def read_static_role(self, name, mount_point=DEFAULT_MOUNT_POINT):
"""This endpoint queries the static role definition.
:param name: Specifies the name of the role to read.
:type name: str | unicode
:param mount_point: The "path" the method/backend was mounted on.
:type mount_point: str | unicode
:return: The response of the request.
:rtype: requests.Response
"""

api_path = utils.format_url(
"/v1/{mount_point}/static-roles/{name}", mount_point=mount_point, name=name
)

return self._adapter.get(
url=api_path,
)

def list_roles(self, mount_point=DEFAULT_MOUNT_POINT):
"""This endpoint returns a list of available roles.
Expand Down

0 comments on commit 2786bb8

Please sign in to comment.