Skip to content

Commit

Permalink
Sandbox URL Creation
Browse files Browse the repository at this point in the history
  • Loading branch information
pixee-b1171e79b0e16eb5[bot] authored Jul 18, 2024
1 parent 0431aca commit f275a3b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
6 changes: 3 additions & 3 deletions introduction/playground/A6/soln.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import requests
from security import safe_requests

def check_vuln(list_of_modules)->list:
vulns = []
for i in list_of_modules:
k = i.split("==")
url = f"https://pypi.org/pypi/{k[0]}/{k[1]}/json"
response = requests.get(url)
response = safe_requests.get(url)
response.raise_for_status()
info = response.json()
existing_vuln = info['vulnerabilities']
if len(existing_vuln) > 0:
vulns.append(existing_vuln)
return vulns
return vulns
28 changes: 14 additions & 14 deletions introduction/playground/A6/utility.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import requests

def check_vuln(list_of_modules)->list:
vulns = []
for i in list_of_modules:
k = i.split("==")
url = f"https://pypi.org/pypi/{k[0]}/{k[1]}/json"
response = requests.get(url)
response.raise_for_status()
info = response.json()
existing_vuln = info['vulnerabilities']
if len(existing_vuln) > 0:
vulns.append(existing_vuln)
return vulns
from security import safe_requests

def check_vuln(list_of_modules)->list:
vulns = []
for i in list_of_modules:
k = i.split("==")
url = f"https://pypi.org/pypi/{k[0]}/{k[1]}/json"
response = safe_requests.get(url)
response.raise_for_status()
info = response.json()
existing_vuln = info['vulnerabilities']
if len(existing_vuln) > 0:
vulns.append(existing_vuln)
return vulns
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ zipp==3.8.0
security==1.2.1 \
--hash=sha256:4ca5f8cfc6b836e2192a84bb5a28b72c17f3cd1abbfe3281f917394c6e6c9238
--hash=sha256:0a9dc7b457330e6d0f92bdae3603fecb85394beefad0fd3b5058758a58781ded
security==1.3.0

0 comments on commit f275a3b

Please sign in to comment.