Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Security upgrade zipp from 3.15.0 to 3.19.1 #63

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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