Skip to content

Commit 416fba8

Browse files
committed
Fix type hint of create_or_update_secret
The secret dict can have any value, e.g. a dict which is then stored as a JSON in vault
1 parent 4b150ae commit 416fba8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Any
2+
13
from hvac.api.vault_api_base import VaultApiBase
24

35
DEFAULT_MOUNT_POINT: str
@@ -6,6 +8,6 @@ class KvV1(VaultApiBase):
68
def read_secret(self, path: str, mount_point: str = "secret"): ...
79
def list_secrets(self, path: str, mount_point: str = "secret"): ...
810
def create_or_update_secret(
9-
self, path: str, secret: dict[str, str], method: str | None = None, mount_point: str = "secret"
11+
self, path: str, secret: dict[str, Any], method: str | None = None, mount_point: str = "secret"
1012
): ...
1113
def delete_secret(self, path: str, mount_point: str = "secret"): ...

stubs/hvac/hvac/api/secrets_engines/kv_v2.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Any
2+
13
from hvac.api.vault_api_base import VaultApiBase
24

35
DEFAULT_MOUNT_POINT: str
@@ -15,7 +17,7 @@ class KvV2(VaultApiBase):
1517
def read_secret_version(
1618
self, path: str, version: int | None = None, mount_point: str = "secret", raise_on_deleted_version: bool | None = None
1719
): ...
18-
def create_or_update_secret(self, path: str, secret: dict[str, str], cas: int | None = None, mount_point: str = "secret"): ...
20+
def create_or_update_secret(self, path: str, secret: dict[str, Any], cas: int | None = None, mount_point: str = "secret"): ...
1921
def patch(self, path: str, secret: dict[str, str], mount_point: str = "secret"): ...
2022
def delete_latest_version_of_secret(self, path: str, mount_point: str = "secret"): ...
2123
def delete_secret_versions(self, path: str, versions: list[int], mount_point: str = "secret"): ...

0 commit comments

Comments
 (0)