pyquocca 0.2.3__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyquocca-0.2.3 → pyquocca-0.3.0}/PKG-INFO +4 -4
- pyquocca-0.3.0/bump.zsh +26 -0
- pyquocca-0.3.0/bump_examples.zsh +26 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/docker-compose.yml +3 -3
- {pyquocca-0.2.3 → pyquocca-0.3.0}/pyproject.toml +2 -2
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/gunicorn.py +2 -2
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/logging.py +1 -1
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/pgsql.py +6 -6
- pyquocca-0.2.3/bump.zsh +0 -21
- pyquocca-0.2.3/bump_examples.zsh +0 -21
- {pyquocca-0.2.3 → pyquocca-0.3.0}/.gitignore +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/.python-version +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/Dockerfile +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/README.md +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/__init__.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/envvars.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/flags.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/header_utils.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/mysql.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/py.typed +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/pyquocca/xssbot.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/test_app/main.py +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/src/test_app/sqlimports-mysql/init.sql +0 -0
- {pyquocca-0.2.3/src/test_app/sqlimports-pgsql → pyquocca-0.3.0/src/test_app/sqlimports-postgres}/init.sql +0 -0
- {pyquocca-0.2.3 → pyquocca-0.3.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyquocca
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Challenge utilities for SecEDU CTFs (primarily UNSW's COMP6[48]43).
|
|
5
5
|
Author-email: Hamish Cox <hamish.cox@unsw.edu.au>
|
|
6
6
|
Maintainer-email: Hamish Cox <hamish.cox@unsw.edu.au>
|
|
@@ -13,9 +13,9 @@ Requires-Dist: requests>=2.31.0
|
|
|
13
13
|
Requires-Dist: typing-extensions>=4.10.0
|
|
14
14
|
Provides-Extra: mysql
|
|
15
15
|
Requires-Dist: pymysql>=1.0.2; extra == 'mysql'
|
|
16
|
-
Provides-Extra:
|
|
17
|
-
Requires-Dist: psycopg-binary>=3.2.4; extra == '
|
|
18
|
-
Requires-Dist: psycopg[pool]>=3.2.4; extra == '
|
|
16
|
+
Provides-Extra: postgres
|
|
17
|
+
Requires-Dist: psycopg-binary>=3.2.4; extra == 'postgres'
|
|
18
|
+
Requires-Dist: psycopg[pool]>=3.2.4; extra == 'postgres'
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
|
|
21
21
|
# QuoccaBank Standard Library
|
pyquocca-0.3.0/bump.zsh
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env zsh
|
|
2
|
+
|
|
3
|
+
cd $(dirname "$0")
|
|
4
|
+
|
|
5
|
+
version=$(yq '.project.version' pyproject.toml)
|
|
6
|
+
echo "Using version $version for pyquocca packages..."
|
|
7
|
+
|
|
8
|
+
# Update parent module challenges
|
|
9
|
+
cd ../../../challenges
|
|
10
|
+
|
|
11
|
+
for file in **/requirements.txt; do
|
|
12
|
+
old=$(grep "^pyquocca" $file)
|
|
13
|
+
if [[ -n $old ]]; then
|
|
14
|
+
current_version=$(echo $old | grep -oE '==(.*)' | cut -d'=' -f3)
|
|
15
|
+
|
|
16
|
+
if [[ $current_version == $version ]]; then
|
|
17
|
+
echo $(dirname $file): up to date
|
|
18
|
+
else
|
|
19
|
+
echo $(dirname $file): updating $old '->' $version
|
|
20
|
+
# Match pyquocca with optional extras, followed by any version
|
|
21
|
+
sed -E -i '' '/^pyquocca(\[[^]]*\])?==.*/s//pyquocca\1=='$version'/' $file
|
|
22
|
+
fi
|
|
23
|
+
else
|
|
24
|
+
echo $(dirname $file): no pyquocca requirement
|
|
25
|
+
fi
|
|
26
|
+
done
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env zsh
|
|
2
|
+
|
|
3
|
+
cd $(dirname "$0")
|
|
4
|
+
|
|
5
|
+
version=$(yq '.project.version' pyproject.toml)
|
|
6
|
+
echo "Using version $version for pyquocca packages..."
|
|
7
|
+
|
|
8
|
+
# Update example challenges
|
|
9
|
+
cd ../../challenges
|
|
10
|
+
|
|
11
|
+
for file in **/requirements.txt; do
|
|
12
|
+
old=$(grep "^pyquocca" $file)
|
|
13
|
+
if [[ -n $old ]]; then
|
|
14
|
+
current_version=$(echo $old | grep -oE '==(.*)' | cut -d'=' -f3)
|
|
15
|
+
|
|
16
|
+
if [[ $current_version == $version ]]; then
|
|
17
|
+
echo $(dirname $file): up to date
|
|
18
|
+
else
|
|
19
|
+
echo $(dirname $file): updating $old '->' $version
|
|
20
|
+
# Match pyquocca with optional extras, followed by any version
|
|
21
|
+
sed -E -i '' '/^pyquocca(\[[^]]*\])?==.*/s//pyquocca\1=='$version'/' $file
|
|
22
|
+
fi
|
|
23
|
+
else
|
|
24
|
+
echo $(dirname $file): no pyquocca requirement
|
|
25
|
+
fi
|
|
26
|
+
done
|
|
@@ -6,7 +6,7 @@ services:
|
|
|
6
6
|
ports:
|
|
7
7
|
- "8000:8000"
|
|
8
8
|
environment:
|
|
9
|
-
- POSTGRES_HOST=
|
|
9
|
+
- POSTGRES_HOST=postgres
|
|
10
10
|
- POSTGRES_USER=user
|
|
11
11
|
- POSTGRES_PASSWORD=verysecure
|
|
12
12
|
- POSTGRES_DB=challengedb
|
|
@@ -26,11 +26,11 @@ services:
|
|
|
26
26
|
# volumes:
|
|
27
27
|
# - ./src/test_app/sqlimports-mysql:/docker-entrypoint-initdb.d
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
postgres:
|
|
30
30
|
image: postgres:17-alpine
|
|
31
31
|
environment:
|
|
32
32
|
- POSTGRES_USER=user
|
|
33
33
|
- POSTGRES_PASSWORD=verysecure
|
|
34
34
|
- POSTGRES_DB=challengedb
|
|
35
35
|
volumes:
|
|
36
|
-
- ./src/test_app/sqlimports-
|
|
36
|
+
- ./src/test_app/sqlimports-postgres:/docker-entrypoint-initdb.d
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyquocca"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = "Challenge utilities for SecEDU CTFs (primarily UNSW's COMP6[48]43)."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.9"
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
[project.optional-dependencies]
|
|
19
|
-
|
|
19
|
+
postgres = ["psycopg[pool]>=3.2.4", "psycopg-binary>=3.2.4"]
|
|
20
20
|
mysql = ["pymysql>=1.0.2"]
|
|
21
21
|
|
|
22
22
|
[build-system]
|
|
@@ -80,10 +80,10 @@ logconfig_dict = {
|
|
|
80
80
|
"handlers": ["console_error"],
|
|
81
81
|
"qualname": "gunicorn.error",
|
|
82
82
|
},
|
|
83
|
-
"pyquocca.
|
|
83
|
+
"pyquocca.postgres": {
|
|
84
84
|
"level": "DEBUG",
|
|
85
85
|
"handlers": ["console"],
|
|
86
|
-
"qualname": "pyquocca.
|
|
86
|
+
"qualname": "pyquocca.postgres",
|
|
87
87
|
},
|
|
88
88
|
"pyquocca.mysql": {
|
|
89
89
|
"level": "DEBUG",
|
|
@@ -11,5 +11,5 @@ def setup_dev_server_logging():
|
|
|
11
11
|
# Don't overwrite the format of the dev server.
|
|
12
12
|
logging.getLogger("werkzeug").propagate = False
|
|
13
13
|
# Log debugging for SQL.
|
|
14
|
-
logging.getLogger("pyquocca.
|
|
14
|
+
logging.getLogger("pyquocca.postgres").setLevel("DEBUG")
|
|
15
15
|
logging.getLogger("pyquocca.mysql").setLevel("DEBUG")
|
|
@@ -22,7 +22,7 @@ class LoggingCursor(Cursor):
|
|
|
22
22
|
prepare: Optional[bool] = None,
|
|
23
23
|
binary: Optional[bool] = None,
|
|
24
24
|
):
|
|
25
|
-
logger = logging.getLogger("pyquocca.
|
|
25
|
+
logger = logging.getLogger("pyquocca.postgres")
|
|
26
26
|
|
|
27
27
|
start = time.monotonic_ns()
|
|
28
28
|
try:
|
|
@@ -161,13 +161,13 @@ class FlaskPostgres(Generic[T]):
|
|
|
161
161
|
"This Flask extension has not been initialised with .init_app() yet (required for auto-commit)."
|
|
162
162
|
)
|
|
163
163
|
|
|
164
|
-
# g.
|
|
164
|
+
# g._postgres_connections is a dictionary of database names to connections.
|
|
165
165
|
try:
|
|
166
|
-
assert type(g.
|
|
167
|
-
return g.
|
|
166
|
+
assert type(g._postgres_connections) is dict
|
|
167
|
+
return g._postgres_connections
|
|
168
168
|
except (AttributeError, AssertionError):
|
|
169
|
-
g.
|
|
170
|
-
return g.
|
|
169
|
+
g._postgres_connections = {}
|
|
170
|
+
return g._postgres_connections
|
|
171
171
|
|
|
172
172
|
def _get_connection(self):
|
|
173
173
|
connections = self._get_connections_dict()
|
pyquocca-0.2.3/bump.zsh
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env zsh
|
|
2
|
-
|
|
3
|
-
cd $(dirname "$0")
|
|
4
|
-
|
|
5
|
-
new="pyquocca==$(yq '.project.version' pyproject.toml)"
|
|
6
|
-
echo Replacing existing pyquocca requirements with $new...
|
|
7
|
-
|
|
8
|
-
# Update parent module challenges
|
|
9
|
-
cd ../../../challenges
|
|
10
|
-
|
|
11
|
-
for file in **/requirements.txt; do
|
|
12
|
-
old=$(grep -E 'pyquocca==\d+\.\d+\.\d+' $file)
|
|
13
|
-
if [[ $? == '0' ]]; then
|
|
14
|
-
echo $(dirname $file): $old '-->' $new
|
|
15
|
-
safe=$(sed 's/\./\\./g' <<<$old)
|
|
16
|
-
sed -i.bak s/$safe/$new/g $file
|
|
17
|
-
rm $file.bak
|
|
18
|
-
else
|
|
19
|
-
echo $(dirname $file): no pyquocca requirement
|
|
20
|
-
fi
|
|
21
|
-
done
|
pyquocca-0.2.3/bump_examples.zsh
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env zsh
|
|
2
|
-
|
|
3
|
-
cd $(dirname "$0")
|
|
4
|
-
|
|
5
|
-
new="pyquocca==$(yq '.project.version' pyproject.toml)"
|
|
6
|
-
echo Replacing existing pyquocca requirements with $new...
|
|
7
|
-
|
|
8
|
-
# Update example challenges
|
|
9
|
-
cd ../../challenges
|
|
10
|
-
|
|
11
|
-
for file in **/requirements.txt; do
|
|
12
|
-
old=$(grep -E 'pyquocca==\d+\.\d+\.\d+' $file)
|
|
13
|
-
if [[ $? == '0' ]]; then
|
|
14
|
-
echo $(dirname $file): $old '-->' $new
|
|
15
|
-
safe=$(sed 's/\./\\./g' <<<$old)
|
|
16
|
-
sed -i.bak s/$safe/$new/g $file
|
|
17
|
-
rm $file.bak
|
|
18
|
-
else
|
|
19
|
-
echo $(dirname $file): no pyquocca requirement
|
|
20
|
-
fi
|
|
21
|
-
done
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|