Skip to content

Commit 4553326

Browse files
committed
Merge branch 'master' of https://github.com/shuffle/python-apps
2 parents f7940e2 + 4127de1 commit 4553326

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

shuffle-tools/1.2.0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM frikky/shuffle:app_sdk as base
55
FROM base as builder
66

77
# Install all alpine build tools needed for our pip installs
8-
RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev git
8+
RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev git zlib-dev python3-dev
99

1010
# Install all of our pip packages in a single directory that we can copy to our base image later
1111
RUN mkdir /install
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
ioc_finder==7.3.0
22
py7zr==0.22.0
33
rarfile==4.2
4-
pyminizip==0.2.6
5-
requests==2.32.4
4+
pyzipper==0.3.6
5+
requests==2.32.3
66
xmltodict==0.14.2
77
json2xml==5.0.5
88
ipaddress==1.0.23
99
google.auth==2.37.0
1010
paramiko==3.5.0
11-
shuffle-sdk
12-
11+
shuffle-sdk==0.0.31

shuffle-tools/1.2.0/src/app.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from google.auth import jwt
3131

3232
import py7zr
33-
import pyminizip
33+
import pyzipper
3434
import rarfile
3535
import requests
3636
import tarfile
@@ -1447,9 +1447,19 @@ def create_archive(self, file_ids, fileformat, name, password=None):
14471447

14481448
if fileformat == "zip":
14491449
archive_name = "archive.zip" if not name else name
1450-
pyminizip.compress_multiple(
1451-
paths, [], archive.name, password, 5
1452-
)
1450+
1451+
pwd = password if isinstance(password, (bytes, bytearray)) else password.encode()
1452+
1453+
with pyzipper.AESZipFile(
1454+
archive.name,
1455+
"w",
1456+
compression=pyzipper.ZIP_DEFLATED
1457+
) as zf:
1458+
zf.setpassword(pwd)
1459+
zf.setencryption(pyzipper.WZ_AES, nbits=256)
1460+
1461+
for path in paths:
1462+
zf.write(path, arcname=os.path.basename(path))
14531463

14541464
elif fileformat == "7zip":
14551465
archive_name = "archive.7z" if not name else name

0 commit comments

Comments
 (0)