From f241b260d7da75ec6b007723db708b16e3edaa19 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 29 Jan 2023 08:20:24 +0100 Subject: [PATCH] Updated requirements Bugfix from testrun Testresults --- cps/kobo_auth.py | 1 + cps/search.py | 4 +- cps/web.py | 2 +- setup.cfg | 27 +- test/Calibre-Web TestSummary_Linux.html | 5661 +++++++++++++++++++---- 5 files changed, 4878 insertions(+), 817 deletions(-) diff --git a/cps/kobo_auth.py b/cps/kobo_auth.py index 92ac4c18..efbb3080 100644 --- a/cps/kobo_auth.py +++ b/cps/kobo_auth.py @@ -164,6 +164,7 @@ def requires_kobo_auth(f): ) if user is not None: login_user(user) + [limiter.limiter.storage.clear(k.key) for k in limiter.current_limits] return f(*args, **kwargs) log.debug("Received Kobo request without a recognizable auth token.") return abort(401) diff --git a/cps/search.py b/cps/search.py index e10a84ff..096b2928 100644 --- a/cps/search.py +++ b/cps/search.py @@ -17,12 +17,12 @@ import json from datetime import datetime -from flask import Blueprint, request, redirect, url_for, flash, get_flashed_messages +from flask import Blueprint, request, redirect, url_for, flash from flask import session as flask_session from flask_login import current_user from flask_babel import format_date from flask_babel import gettext as _ -from sqlalchemy.sql.expression import func, not_, and_, or_, text, false +from sqlalchemy.sql.expression import func, not_, and_, or_, text, true from sqlalchemy.sql.functions import coalesce from . import logger, db, calibre_db, config, ub diff --git a/cps/web.py b/cps/web.py index 0d79c8f5..c1b8f876 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1309,7 +1309,7 @@ def login(): @web.route('/login', methods=['POST']) @limiter.limit("40/day", key_func=lambda: request.form.get('username', "").strip().lower()) -@limiter.limit("2/minute", key_func=lambda: request.form.get('username', "").strip().lower()) +@limiter.limit("3/minute", key_func=lambda: request.form.get('username', "").strip().lower()) def login_post(): try: limiter.check() diff --git a/setup.cfg b/setup.cfg index 9be77e7f..597aa5fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,33 +58,34 @@ install_requires = flask-wtf>=0.14.2,<1.2.0 chardet>=3.0.0,<4.1.0 advocate>=1.0.0,<1.1.0 + Flask-Limiter>=2.3.0,<3.2.0 [options.extras_require] gdrive = - google-api-python-client>=1.7.11,<2.50.0 - gevent>20.6.0,<22.0.0 - greenlet>=0.4.17,<1.2.0 - httplib2>=0.9.2,<0.21.0 + google-api-python-client>=1.7.11,<2.75.0 + gevent>20.6.0,<23.0.0 + greenlet>=0.4.17,<2.1.0 + httplib2>=0.9.2,<0.22.0 oauth2client>=4.0.0,<4.1.4 uritemplate>=3.0.0,<4.2.0 pyasn1-modules>=0.0.8,<0.3.0 pyasn1>=0.1.9,<0.5.0 - PyDrive2>=1.3.1,<1.11.0 + PyDrive2>=1.3.1,<1.16.0 PyYAML>=3.12 - rsa>=3.4.2,<4.9.0 + rsa>=3.4.2,<4.10.0 gmail = - google-auth-oauthlib>=0.4.3,<0.6.0 - google-api-python-client>=1.7.11,<2.50.0 + google-auth-oauthlib>=0.4.3,<0.9.0 + google-api-python-client>=1.7.11,<2.75.0 goodreads = goodreads>=0.3.2,<0.4.0 - python-Levenshtein>=0.12.0,<0.13.0 + python-Levenshtein>=0.12.0,<0.21.0 ldap = python-ldap>=3.0.0,<3.5.0 Flask-SimpleLDAP>=1.4.0,<1.5.0 oauth = - Flask-Dance>=2.0.0,<5.2.0 - SQLAlchemy-Utils>=0.33.5,<0.39.0 + Flask-Dance>=2.0.0,<6.3.0 + SQLAlchemy-Utils>=0.33.5,<0.40.0 metadata = rarfile>=3.2 scholarly>=1.2.0,<1.8 @@ -94,8 +95,8 @@ metadata = beautifulsoup4>=4.0.1,<4.12.0 cchardet>=2.0.0,<2.2.0 comics = - natsort>=2.2.0,<8.2.0 + natsort>=2.2.0,<8.3.0 comicapi>=2.2.0,<2.3.0 kobo = - jsonschema>=3.2.0,<4.9.0 + jsonschema>=3.2.0,<4.18.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 82051912..36a3c808 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2022-06-17 21:15:12

+

Start Time: 2023-01-28 19:00:52

-

Stop Time: 2022-06-18 03:11:38

+

Stop Time: 2023-01-29 00:44:54

-

Duration: 5h 2 min

+

Duration: 4h 53 min

@@ -465,220 +465,3633 @@ - + TestEbookConvertCalibre - 15 - 15 + 30 0 0 + 30 0 - Detail + Detail - +
TestEbookConvertCalibre - test_calibre_log
- PASS + +
+ ERROR +
+ + + + - + -
TestEbookConvertCalibre - test_convert_deactivate
+
TestEbookConvertCalibre - test_calibre_log
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_email
+
TestEbookConvertCalibre - test_convert_deactivate
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_failed_and_email
+
TestEbookConvertCalibre - test_convert_deactivate
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_only
+
TestEbookConvertCalibre - test_convert_email
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_options
+
TestEbookConvertCalibre - test_convert_email
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_parameter
+
TestEbookConvertCalibre - test_convert_failed_and_email
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_wrong_excecutable
+
TestEbookConvertCalibre - test_convert_failed_and_email
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_convert_xss
+
TestEbookConvertCalibre - test_convert_only
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_email_failed
+
TestEbookConvertCalibre - test_convert_only
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_email_only
+
TestEbookConvertCalibre - test_convert_options
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_kindle_send_not_configured
+
TestEbookConvertCalibre - test_convert_options
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_ssl_smtp_setup_error
+
TestEbookConvertCalibre - test_convert_parameter
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_starttls_smtp_setup_error
+
TestEbookConvertCalibre - test_convert_parameter
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibre - test_user_convert_xss
+
TestEbookConvertCalibre - test_convert_wrong_excecutable
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_convert_wrong_excecutable
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_convert_xss
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_convert_xss
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_email_failed
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_email_failed
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_email_only
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_email_only
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_kindle_send_not_configured
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_kindle_send_not_configured
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_ssl_smtp_setup_error
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_ssl_smtp_setup_error
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_starttls_smtp_setup_error
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_starttls_smtp_setup_error
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_user_convert_xss
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibre - test_user_convert_xss
+ + +
+ ERROR +
+ + + + + + + + + + + _ErrorHolder + 5 + 0 + 0 + 5 + 0 + + Detail + + + + + + + +
tearDownClass (test_ebook_convert)
+ + +
+ ERROR +
+ + + + + + + + + + +
tearDownClass (test_email_STARTTLS)
+ + +
+ ERROR +
+ + + + + + + + + + +
setUpClass (test_email_ssl)
+ + +
+ ERROR +
+ + + + + + + + + + +
setUpClass (test_register)
+ + +
+ ERROR +
+ + + + + + + + + + +
setUpClass (test_zz_helper)
+ + +
+ ERROR +
+ + + - PASS - + TestEbookConvertCalibreGDrive - 6 - 6 + 13 0 0 + 13 0 - Detail + Detail - +
TestEbookConvertCalibreGDrive - test_convert_email
- PASS + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_email
+ + +
+ ERROR +
+ + + + - +
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
- PASS + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_failed_and_email
+ + +
+ ERROR +
+ + + + - +
TestEbookConvertCalibreGDrive - test_convert_only
- PASS + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_only
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_convert_parameter
+ + +
+ ERROR +
+ + + + - +
TestEbookConvertCalibreGDrive - test_convert_parameter
- PASS + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_email_failed
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_email_failed
+ + +
+ ERROR +
+ + + + + + + + + + +
TestEbookConvertCalibreGDrive - test_email_only
+ + +
+ ERROR +
+ + + + - + -
TestEbookConvertCalibreGDrive - test_email_failed
+
TestEbookConvertCalibreGDrive - test_email_only
+ + +
+ ERROR +
+ + + - PASS - + -
TestEbookConvertCalibreGDrive - test_email_only
+
TestEbookConvertCalibreGDrive - test_thumbnail_cache
+ + +
+ ERROR +
+ + + - PASS @@ -692,13 +4105,13 @@ 0 0 - Detail + Detail - +
TestEbookConvertKepubify - test_convert_deactivate
@@ -707,7 +4120,7 @@ - +
TestEbookConvertKepubify - test_convert_only
@@ -716,7 +4129,7 @@ - +
TestEbookConvertKepubify - test_convert_wrong_excecutable
@@ -734,13 +4147,13 @@ 0 0 - Detail + Detail - +
TestEbookConvertGDriveKepubify - test_convert_deactivate
@@ -749,7 +4162,7 @@ - +
TestEbookConvertGDriveKepubify - test_convert_only
@@ -758,7 +4171,7 @@ - +
TestEbookConvertGDriveKepubify - test_convert_wrong_excecutable
@@ -776,13 +4189,13 @@ 0 1 - Detail + Detail - +
TestEditAdditionalBooks - test_cbz_comicinfo
@@ -791,7 +4204,7 @@ - +
TestEditAdditionalBooks - test_change_upload_formats
@@ -800,7 +4213,7 @@ - +
TestEditAdditionalBooks - test_delete_book
@@ -809,7 +4222,7 @@ - +
TestEditAdditionalBooks - test_delete_role
@@ -818,7 +4231,7 @@ - +
TestEditAdditionalBooks - test_details_popup
@@ -827,7 +4240,7 @@ - +
TestEditAdditionalBooks - test_edit_book_identifier
@@ -836,7 +4249,7 @@ - +
TestEditAdditionalBooks - test_edit_book_identifier_capital
@@ -845,7 +4258,7 @@ - +
TestEditAdditionalBooks - test_edit_book_identifier_standard
@@ -854,7 +4267,7 @@ - +
TestEditAdditionalBooks - test_edit_special_book_identifier
@@ -863,7 +4276,7 @@ - +
TestEditAdditionalBooks - test_title_sort
@@ -872,7 +4285,7 @@ - +
TestEditAdditionalBooks - test_upload_cbz_coverformats
@@ -881,7 +4294,7 @@ - +
TestEditAdditionalBooks - test_upload_edit_role
@@ -890,7 +4303,7 @@ - +
TestEditAdditionalBooks - test_upload_metadata_cbr
@@ -899,7 +4312,7 @@ - +
TestEditAdditionalBooks - test_upload_metadata_cbt
@@ -908,7 +4321,7 @@ - +
TestEditAdditionalBooks - test_xss_author_edit
@@ -917,7 +4330,7 @@ - +
TestEditAdditionalBooks - test_xss_comment_edit
@@ -926,7 +4339,7 @@ - +
TestEditAdditionalBooks - test_xss_custom_comment_edit
@@ -944,13 +4357,13 @@ 0 1 - Detail + Detail - +
TestEditBooks - test_download_book
@@ -959,7 +4372,7 @@ - +
TestEditBooks - test_edit_author
@@ -968,7 +4381,7 @@ - +
TestEditBooks - test_edit_category
@@ -977,7 +4390,7 @@ - +
TestEditBooks - test_edit_comments
@@ -986,7 +4399,7 @@ - +
TestEditBooks - test_edit_custom_bool
@@ -995,7 +4408,7 @@ - +
TestEditBooks - test_edit_custom_categories
@@ -1004,7 +4417,7 @@ - +
TestEditBooks - test_edit_custom_comment
@@ -1013,7 +4426,7 @@ - +
TestEditBooks - test_edit_custom_date
@@ -1022,7 +4435,7 @@ - +
TestEditBooks - test_edit_custom_float
@@ -1031,7 +4444,7 @@ - +
TestEditBooks - test_edit_custom_int
@@ -1040,7 +4453,7 @@ - +
TestEditBooks - test_edit_custom_rating
@@ -1049,7 +4462,7 @@ - +
TestEditBooks - test_edit_custom_single_select
@@ -1058,7 +4471,7 @@ - +
TestEditBooks - test_edit_custom_text
@@ -1067,7 +4480,7 @@ - +
TestEditBooks - test_edit_language
@@ -1076,7 +4489,7 @@ - +
TestEditBooks - test_edit_publisher
@@ -1085,7 +4498,7 @@ - +
TestEditBooks - test_edit_publishing_date
@@ -1094,7 +4507,7 @@ - +
TestEditBooks - test_edit_rating
@@ -1103,7 +4516,7 @@ - +
TestEditBooks - test_edit_series
@@ -1112,7 +4525,7 @@ - +
TestEditBooks - test_edit_title
@@ -1121,19 +4534,19 @@ - +
TestEditBooks - test_rename_uppercase_lowercase
- SKIP + SKIP
-