VaultAPI-Client 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {VaultAPI_Client-0.1.0.dist-info → VaultAPI_Client-0.1.2.dist-info}/METADATA +1 -1
- VaultAPI_Client-0.1.2.dist-info/RECORD +13 -0
- vaultapi/__init__.py +1 -1
- vaultapi/aws.py +12 -4
- vaultapi/config.py +1 -0
- vaultapi/main.py +14 -0
- VaultAPI_Client-0.1.0.dist-info/RECORD +0 -13
- {VaultAPI_Client-0.1.0.dist-info → VaultAPI_Client-0.1.2.dist-info}/LICENSE +0 -0
- {VaultAPI_Client-0.1.0.dist-info → VaultAPI_Client-0.1.2.dist-info}/WHEEL +0 -0
- {VaultAPI_Client-0.1.0.dist-info → VaultAPI_Client-0.1.2.dist-info}/entry_points.txt +0 -0
- {VaultAPI_Client-0.1.0.dist-info → VaultAPI_Client-0.1.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
vaultapi/__init__.py,sha256=4Qrvj-J-MKCdBly6xVIxdVV1ueDp30hwqSfiBWjab8I,1507
|
|
2
|
+
vaultapi/aws.py,sha256=FpFDP9jDmiXek_zzgVMQ5FZoqzyh0HIR4vqnry0Ap-U,2722
|
|
3
|
+
vaultapi/config.py,sha256=06PBsWd5RxehK1BvFfDCzm96Dic1RK-qOp9rCRpZC6k,3873
|
|
4
|
+
vaultapi/exceptions.py,sha256=KUTAshsxk7ewcZsjGibGP0076L0QrLzuADRnrv30FK4,90
|
|
5
|
+
vaultapi/main.py,sha256=zcVAPOzKVdB0eDqbxr8GNCNBXfC3L2LSEc2Jh8lim1o,6593
|
|
6
|
+
vaultapi/transit.py,sha256=VaP4bSryulgpMn4tXcGnEUCJ1AAZYzHw4EwYhdIF4XE,2878
|
|
7
|
+
vaultapi/util.py,sha256=REd8SIycx9q6AQoaHG8UfkbWfPHUtSSz7E3ngWRc4WM,262
|
|
8
|
+
VaultAPI_Client-0.1.2.dist-info/LICENSE,sha256=_sOIKJWdD2o1WwwDIwYB2qTP2nlSWqT5Tyg9jr1Xa4w,1070
|
|
9
|
+
VaultAPI_Client-0.1.2.dist-info/METADATA,sha256=3sWt5TXIHhgB0uWooRgHbYVK3YJL8u6e_a0QCSqi3ko,5683
|
|
10
|
+
VaultAPI_Client-0.1.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
11
|
+
VaultAPI_Client-0.1.2.dist-info/entry_points.txt,sha256=MKe6sVDEAHC3YBZoYWLMvgwupRE_QJ_iHK0umfgGOzs,50
|
|
12
|
+
VaultAPI_Client-0.1.2.dist-info/top_level.txt,sha256=17jtNvOOJqazNgWn2ZTmJqfQau5jan_xF82NAJOINQg,9
|
|
13
|
+
VaultAPI_Client-0.1.2.dist-info/RECORD,,
|
vaultapi/__init__.py
CHANGED
vaultapi/aws.py
CHANGED
|
@@ -30,7 +30,7 @@ class AWSClient:
|
|
|
30
30
|
self.secret_client = session.client(service_name="secretsmanager")
|
|
31
31
|
self.ssm_client = session.client(service_name="ssm")
|
|
32
32
|
|
|
33
|
-
def get_aws_secrets(self, name: str = None) -> str | List[str]:
|
|
33
|
+
def get_aws_secrets(self, name: str = None) -> str | List[str] | None:
|
|
34
34
|
"""Get secrets from AWS secretsmanager.
|
|
35
35
|
|
|
36
36
|
Args:
|
|
@@ -42,13 +42,17 @@ class AWSClient:
|
|
|
42
42
|
"""
|
|
43
43
|
if name:
|
|
44
44
|
LOGGER.info("Retrieving the secret '%s' from AWS secrets manager", name)
|
|
45
|
-
|
|
45
|
+
try:
|
|
46
|
+
response = self.secret_client.get_secret_value(SecretId=name)
|
|
47
|
+
except Exception as error:
|
|
48
|
+
LOGGER.exception(error)
|
|
49
|
+
return
|
|
46
50
|
return response["SecretString"]
|
|
47
51
|
paginator = self.secret_client.get_paginator("list_secrets")
|
|
48
52
|
page_results = paginator.paginate().build_full_result()
|
|
49
53
|
return [page["Name"] for page in page_results["SecretList"]]
|
|
50
54
|
|
|
51
|
-
def get_aws_params(self, name: str = None) -> str | List[str]:
|
|
55
|
+
def get_aws_params(self, name: str = None) -> str | List[str] | None:
|
|
52
56
|
"""Get SSM parameters from AWS.
|
|
53
57
|
|
|
54
58
|
Args:
|
|
@@ -60,7 +64,11 @@ class AWSClient:
|
|
|
60
64
|
"""
|
|
61
65
|
if name:
|
|
62
66
|
LOGGER.info("Retrieving the parameter '%s' from AWS parameter store", name)
|
|
63
|
-
|
|
67
|
+
try:
|
|
68
|
+
response = self.ssm_client.get_parameter(Name=name, WithDecryption=True)
|
|
69
|
+
except Exception as error:
|
|
70
|
+
LOGGER.exception(error)
|
|
71
|
+
return
|
|
64
72
|
return response["Parameter"]["Value"]
|
|
65
73
|
paginator = self.ssm_client.get_paginator("describe_parameters")
|
|
66
74
|
page_results = paginator.paginate().build_full_result()
|
vaultapi/config.py
CHANGED
vaultapi/main.py
CHANGED
|
@@ -135,6 +135,20 @@ class VaultAPIClient:
|
|
|
135
135
|
response = self.SESSION.post(url, params={"table_name": table_name})
|
|
136
136
|
return process_response(response)
|
|
137
137
|
|
|
138
|
+
def delete_table(self, table_name: str) -> Dict[str, str]:
|
|
139
|
+
"""Deletes an existing table.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
table_name: Table name.
|
|
143
|
+
|
|
144
|
+
Returns:
|
|
145
|
+
Dict[str, str]:
|
|
146
|
+
Returns the server response.
|
|
147
|
+
"""
|
|
148
|
+
url = urljoin(self.env_config.vault_server, server_map.delete_table)
|
|
149
|
+
response = self.SESSION.delete(url, params={"table_name": table_name})
|
|
150
|
+
return process_response(response)
|
|
151
|
+
|
|
138
152
|
def get_secret(self, key: str, table_name: str) -> Dict[str, str]:
|
|
139
153
|
"""Retrieves multiple secrets from a table.
|
|
140
154
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
vaultapi/__init__.py,sha256=tlrVdlm1LXLG38bMaRQSxFnG6M7treDVWFpx2gaIChI,1507
|
|
2
|
-
vaultapi/aws.py,sha256=ixP9xNzBaboszpBfT4dvxq2C8SbDQU-F4tRoYXGJnMQ,2462
|
|
3
|
-
vaultapi/config.py,sha256=F34DUlIu229fBxqZiRSs40aD1vk4wCeZC6w0TDhumL4,3833
|
|
4
|
-
vaultapi/exceptions.py,sha256=KUTAshsxk7ewcZsjGibGP0076L0QrLzuADRnrv30FK4,90
|
|
5
|
-
vaultapi/main.py,sha256=6o1lREgJtZIT_t-JeCtaWROkZEVs1EYL4PI1z2oysi8,6143
|
|
6
|
-
vaultapi/transit.py,sha256=VaP4bSryulgpMn4tXcGnEUCJ1AAZYzHw4EwYhdIF4XE,2878
|
|
7
|
-
vaultapi/util.py,sha256=REd8SIycx9q6AQoaHG8UfkbWfPHUtSSz7E3ngWRc4WM,262
|
|
8
|
-
VaultAPI_Client-0.1.0.dist-info/LICENSE,sha256=_sOIKJWdD2o1WwwDIwYB2qTP2nlSWqT5Tyg9jr1Xa4w,1070
|
|
9
|
-
VaultAPI_Client-0.1.0.dist-info/METADATA,sha256=a5uqugklOlWchOj94moFJ9aH2yXlVNwssVVBOGvq5bQ,5683
|
|
10
|
-
VaultAPI_Client-0.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
11
|
-
VaultAPI_Client-0.1.0.dist-info/entry_points.txt,sha256=MKe6sVDEAHC3YBZoYWLMvgwupRE_QJ_iHK0umfgGOzs,50
|
|
12
|
-
VaultAPI_Client-0.1.0.dist-info/top_level.txt,sha256=17jtNvOOJqazNgWn2ZTmJqfQau5jan_xF82NAJOINQg,9
|
|
13
|
-
VaultAPI_Client-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|