mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-02-24 00:59:59 -05:00
Mypy missing types fix
This commit is contained in:
parent
73106611ec
commit
419a95fba7
@ -23,8 +23,8 @@ mypy:
|
|||||||
- apt-get -qqy update
|
- apt-get -qqy update
|
||||||
- apt-get -qqy install --no-install-recommends python3-pip
|
- apt-get -qqy install --no-install-recommends python3-pip
|
||||||
- pip3 install mypy
|
- pip3 install mypy
|
||||||
- pip3 install -r requirements.txt
|
- pip3 install -r requirements-test.txt
|
||||||
- mypy --ignore-missing-imports main.py
|
- mypy --ignore-missing-imports matweb main.py
|
||||||
|
|
||||||
bandit:
|
bandit:
|
||||||
image:
|
image:
|
||||||
|
@ -2,6 +2,7 @@ import hmac
|
|||||||
import os
|
import os
|
||||||
import hashlib
|
import hashlib
|
||||||
import mimetypes as mtype
|
import mimetypes as mtype
|
||||||
|
from typing import Tuple
|
||||||
|
|
||||||
from flask_restful import abort, current_app
|
from flask_restful import abort, current_app
|
||||||
from libmat2 import parser_factory
|
from libmat2 import parser_factory
|
||||||
@ -97,7 +98,7 @@ def get_file_paths(filename, upload_folder):
|
|||||||
return complete_path, filepath
|
return complete_path, filepath
|
||||||
|
|
||||||
|
|
||||||
def is_valid_api_download_file(filename: str, key: str, secret: str, upload_folder: str) -> [str, str]:
|
def is_valid_api_download_file(filename: str, key: str, secret: str, upload_folder: str) -> Tuple[str, str]:
|
||||||
if filename != secure_filename(filename):
|
if filename != secure_filename(filename):
|
||||||
current_app.logger.error('Insecure filename %s', filename)
|
current_app.logger.error('Insecure filename %s', filename)
|
||||||
abort(400, message='Insecure filename')
|
abort(400, message='Insecure filename')
|
||||||
|
@ -1 +1,4 @@
|
|||||||
openapi-spec-validator==0.2.8
|
openapi-spec-validator==0.2.8
|
||||||
|
types-Flask==1.1.0
|
||||||
|
types-Jinja2==2.11.1
|
||||||
|
types-PyYAML==0.1.7
|
@ -10,6 +10,3 @@ Flask-Testing==0.8.1
|
|||||||
blinker==1.4
|
blinker==1.4
|
||||||
iknl-flasgger==0.9.2.post1
|
iknl-flasgger==0.9.2.post1
|
||||||
Flask-Assets==2.0
|
Flask-Assets==2.0
|
||||||
types-Flask==1.1.0
|
|
||||||
types-Jinja2==2.11.1
|
|
||||||
types-PyYAML==0.1.7
|
|
Loading…
x
Reference in New Issue
Block a user