Skip to content

Commit

Permalink
fixed security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Jan 4, 2025
1 parent 055185e commit 67c0d1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions hack/rules-and-dashboards/sync_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,9 @@ def write_dashboard_to_file(resource_name, content, charts):

def jsonnet_import(directory, file_name):
src = join(directory, file_name)
if file_name.startswith("github.com"):
(empty, repo_org, repo_name, repo_path) = urlparse(
f"https://{file_name}"
).path.split("/", 3)
parsed_url = urlparse(f"https://{file_name}")
if parsed_url.hostname == "github.com":
(empty, repo_org, repo_name, repo_path) = parsed_url.path.split("/", 3)
repo_slug = f"{repo_org}/{repo_name}"
repo_resp = requests.get(f"https://api.github.com/repos/{repo_slug}")
if repo_resp.status_code != 200:
Expand Down
7 changes: 3 additions & 4 deletions hack/rules-and-dashboards/sync_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,9 @@ def write_group_to_file(group, url, charts):

def jsonnet_import(directory, file_name):
src = join(directory, file_name)
if file_name.startswith("github.com"):
(empty, repo_org, repo_name, repo_path) = urlparse(
f"https://{file_name}"
).path.split("/", 3)
parsed_url = urlparse(f"https://{file_name}")
if parsed_url.hostname == "github.com":
(empty, repo_org, repo_name, repo_path) = parsed_url.path.split("/", 3)
repo_slug = f"{repo_org}/{repo_name}"
repo_resp = requests.get(f"https://api.github.com/repos/{repo_slug}")
if repo_resp.status_code != 200:
Expand Down

0 comments on commit 67c0d1e

Please sign in to comment.