Skip to content

Commit

Permalink
Merge pull request #63 from DelineaXPM/snyk-fix-43f40a6360dedd5610e2d…
Browse files Browse the repository at this point in the history
…3a169f788e0

[Snyk] Security upgrade zipp from 3.15.0 to 3.19.1
  • Loading branch information
delineaKrehl authored Jul 24, 2024
2 parents 4056e1c + 09469bc commit d5eaad3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def env_vars():
"secret_id": os.getenv("TSS_SECRET_ID"),
"secret_path": os.getenv("TSS_SECRET_PATH"),
"folder_id": os.getenv("TSS_FOLDER_ID"),
"folder_path": os.getenv("TSS_FOLDER_PATH")
"folder_path": os.getenv("TSS_FOLDER_PATH"),
}


Expand Down
25 changes: 18 additions & 7 deletions delinea/secrets/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,17 @@ def get_secret_json(self, id, query_params=None):
endpoint_url = f"{self.api_url}/secrets/{id}"

if query_params is None:
return self.process(requests.get(endpoint_url, headers=self.headers(), timeout=60)).text
return self.process(
requests.get(endpoint_url, headers=self.headers(), timeout=60)
).text
else:
return self.process(
requests.get(
endpoint_url,
params=query_params,
headers=self.headers(),
timeout=60)
timeout=60,
)
).text

def get_folder_json(self, id, query_params=None, get_all_children=True):
Expand Down Expand Up @@ -424,15 +427,18 @@ def get_secret(self, id, fetch_file_attachments=True, query_params=None):
endpoint_url = f"{self.api_url}/secrets/{id}/fields/{item['slug']}"
if query_params is None:
item["itemValue"] = self.process(
requests.get(endpoint_url, headers=self.headers(), timeout=60)
requests.get(
endpoint_url, headers=self.headers(), timeout=60
)
)
else:
item["itemValue"] = self.process(
requests.get(
endpoint_url,
params=query_params,
headers=self.headers(),
timeout=60)
timeout=60,
)
)
return secret

Expand Down Expand Up @@ -517,14 +523,17 @@ def search_secrets(self, query_params=None):
endpoint_url = f"{self.api_url}/secrets"

if query_params is None:
return self.process(requests.get(endpoint_url, headers=self.headers(), timeout=60)).text
return self.process(
requests.get(endpoint_url, headers=self.headers(), timeout=60)
).text
else:
return self.process(
requests.get(
endpoint_url,
params=query_params,
headers=self.headers(),
timeout=60)
timeout=60,
)
).text

def lookup_folders(self, query_params=None):
Expand Down Expand Up @@ -568,7 +577,9 @@ def get_secret_ids_by_folderid(self, folder_id):
params = {"filter.folderId": folder_id}
endpoint_url = f"{self.api_url}/secrets/search-total"
params["take"] = self.process(
requests.get(endpoint_url, params=params, headers=self.headers(), timeout=60)
requests.get(
endpoint_url, params=params, headers=self.headers(), timeout=60
)
).text
response = self.search_secrets(query_params=params)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ python-dotenv
flit
black
urllib3==2.2.2 # not directly required, pinned by Snyk to avoid a vulnerability
zipp>=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability
1 change: 1 addition & 0 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_api_url(secret_server, env_vars):
== f"https://{env_vars['tenant']}.secretservercloud.com/api/v1"
)


def test_access_token_authorizer(env_vars, authorizer):
assert SecretServer(
f"https://{env_vars['tenant']}.secretservercloud.com/",
Expand Down

0 comments on commit d5eaad3

Please sign in to comment.