Skip to content

Commit 2bc52de

Browse files
committed
fix blasthttp headers type and event loop, fix fetch_asns list/set bug, bump app-token and docker tags, add .so to gitignore
1 parent 83ef3a7 commit 2bc52de

8 files changed

Lines changed: 20 additions & 11 deletions

File tree

.github/workflows/daily-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Generate app token
2323
id: app-token
24-
uses: actions/create-github-app-token@v1
24+
uses: actions/create-github-app-token@v3
2525
with:
2626
app-id: ${{ secrets.CLOUDCHECK_APP_ID }}
2727
private-key: ${{ secrets.CLOUDCHECK_APP_PRIVATE_KEY }}

.github/workflows/docker-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
type=ref,event=pr
6161
type=sha,prefix=sha-
6262
type=raw,value=latest,enable={{is_default_branch}}
63-
type=raw,value=v9
64-
type=raw,value=v9.2
65-
type=raw,value=v9.2.0
63+
type=raw,value=v11
64+
type=raw,value=v11.0
65+
type=raw,value=v11.0.0
6666
6767
- name: Build and push Docker image
6868
uses: docker/build-push-action@v7

.github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
steps:
5353
- name: Generate app token
5454
id: app-token
55-
uses: actions/create-github-app-token@v1
55+
uses: actions/create-github-app-token@v3
5656
with:
5757
app-id: ${{ secrets.CLOUDCHECK_APP_ID }}
5858
private-key: ${{ secrets.CLOUDCHECK_APP_PRIVATE_KEY }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
# Python
66
__pycache__/
7+
*.so

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloudcheck/helpers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,15 @@ def request(url, include_api_key=False, browser_headers=False, timeout=60, **kwa
228228
"running the update.",
229229
file=sys.stderr,
230230
)
231-
kwargs["headers"] = headers
231+
kwargs["headers"] = list(headers.items())
232232
kwargs["timeout"] = timeout
233233
kwargs.setdefault("follow_redirects", True)
234234
kwargs.setdefault("verify_certs", True)
235-
return asyncio.run(_client.request(url, **kwargs))
235+
236+
async def _send():
237+
return await _client.request(url, **kwargs)
238+
239+
return asyncio.run(_send())
236240

237241

238242
def parse_v2fly_domain_file(file_path: Path) -> Set[str]:

cloudcheck/providers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def fetch_org_ids(
222222

223223
def fetch_asns(self) -> List[Union[ipaddress.IPv4Network, ipaddress.IPv6Network]]:
224224
"""Fetch CIDRs for a given list of ASNs from ASNDB."""
225-
cidrs = []
225+
cidrs = set()
226226
errors = []
227227
print(f"Fetching {len(self.asns)} ASNs for {self.name}")
228228
for asn in self.asns:

cloudcheck/providers/microsoft.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ class Microsoft(BaseProvider):
2929
],
3030
}
3131

32-
_ips_confirmation_url = "https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519"
32+
_ips_confirmation_url = (
33+
"https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519"
34+
)
3335

3436
def fetch_cidrs(self):
3537
confirmation = self.request(self._ips_confirmation_url, browser_headers=True)
36-
match = re.search(r'https://download\.microsoft\.com/download/[^"]+\.json', confirmation.text)
38+
match = re.search(
39+
r'https://download\.microsoft\.com/download/[^"]+\.json', confirmation.text
40+
)
3741
if not match:
3842
raise ValueError("Could not find Azure IP ranges download URL")
3943
response = self.request(match.group(0))

0 commit comments

Comments
 (0)