From f5f49a23abe368f40b22102f34c300e07ff7986c Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Mon, 27 Dec 2021 12:29:56 +0100 Subject: [PATCH 1/7] Version bump --- opentaxii/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentaxii/_version.py b/opentaxii/_version.py index 8cdfc355..4af68473 100644 --- a/opentaxii/_version.py +++ b/opentaxii/_version.py @@ -3,4 +3,4 @@ This module defines the package version for use in __init__.py and setup.py. """ -__version__ = '0.2.2' +__version__ = '0.2.3' From 09420ddeb74b573b067eba8a8b6e7ead5cf658cb Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Mon, 11 Apr 2022 21:23:28 +0200 Subject: [PATCH 2/7] Make sure werkzeug <2.1 and >=2.1 work correctly with auth --- opentaxii/management.py | 4 ++-- tox.ini | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/opentaxii/management.py b/opentaxii/management.py index 88b50ad0..ec03c387 100644 --- a/opentaxii/management.py +++ b/opentaxii/management.py @@ -1,4 +1,4 @@ -from flask import Blueprint, request, jsonify, abort +from flask import Blueprint, abort, jsonify, request from .local import context @@ -7,7 +7,7 @@ @management.route('/auth', methods=['POST']) def auth(): - data = request.get_json() or request.form + data = request.get_json(silent=True) or request.form username = data.get('username') password = data.get('password') diff --git a/tox.ini b/tox.ini index dc08f6ba..5086f05f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = True -envlist = py{36,37,38,39,py3,ston}-sqlalchemy{13,14}-{sqlite,mysql,mariadb,postgres}, flake8 +envlist = py{36,37,38,39,py3,ston}-sqlalchemy{13,14}-werkzeug{lt21,gte21}-{sqlite,mysql,mariadb,postgres}, flake8 [gh-actions] python = @@ -20,6 +20,8 @@ deps = postgres-pypy3: -rrequirements-dev-postgres-pypy.txt sqlalchemy13: sqlalchemy>=1.3,<1.4 sqlalchemy14: sqlalchemy>=1.4,<1.5 + werkzeuglt21: werkzeug<2.1 + werkzeuggte21: werkzeug>=2.1 setenv = LC_ALL=en_US.UTF-8 sqlite: DBTYPE=sqlite From 6275c6802bec2b17839ff1ec9e9ef6265c4db4f8 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Tue, 12 Apr 2022 11:28:27 +0200 Subject: [PATCH 3/7] Only run py36 tests against werkzeug<2.1 --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 5086f05f..5c3cf66f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,8 @@ [tox] skipsdist = True -envlist = py{36,37,38,39,py3,ston}-sqlalchemy{13,14}-werkzeug{lt21,gte21}-{sqlite,mysql,mariadb,postgres}, flake8 +envlist = py36-sqlalchemy{13,14}-werkzeuglt21-{sqlite,mysql,mariadb,postgres}, + py{37,38,39,py3,ston}-sqlalchemy{13,14}-werkzeug{lt21,gte21}-{sqlite,mysql,mariadb,postgres}, + flake8 [gh-actions] python = From 3fa6e282394a9c3102a109310d9c00ac474ed1ed Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Tue, 12 Apr 2022 12:04:27 +0200 Subject: [PATCH 4/7] Update scopefunc for werkzeug upgrade --- opentaxii/sqldb_helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opentaxii/sqldb_helper.py b/opentaxii/sqldb_helper.py index 90d0c02a..bac39186 100644 --- a/opentaxii/sqldb_helper.py +++ b/opentaxii/sqldb_helper.py @@ -1,4 +1,5 @@ -from flask import _app_ctx_stack +from threading import get_ident + from sqlalchemy import engine, orm from sqlalchemy.orm.exc import UnmappedClassError @@ -44,11 +45,10 @@ def create_scoped_session(self, options=None): options = options or {} - scopefunc = _app_ctx_stack.__ident_func__ options.setdefault('query_cls', self.Query) return orm.scoped_session( - self.create_session(options), scopefunc=scopefunc) + self.create_session(options), scopefunc=get_ident) def create_session(self, options): return orm.sessionmaker(bind=self.engine, **options) From 5e7a081111147062430981200ea587760c0b01ca Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Wed, 13 Apr 2022 11:24:28 +0200 Subject: [PATCH 5/7] Update changelog --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index fc819a87..215bfe32 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,10 @@ Changelog ========= +0.2.4 (2022-04-13) +------------------ +* Make sure werkzeug <2.1 and >=2.1 work correctly with auth system + 0.2.3 (2021-12-22) ------------------ * Fix bug in multithreaded use of sqlite (`#210 `_ thanks `@rohits144 `_ for the report) From 5b09ef16f4aa3a29f8ae9ea862d6b8144cfe21a9 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Wed, 13 Apr 2022 13:15:36 +0200 Subject: [PATCH 6/7] Bump version --- opentaxii/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentaxii/_version.py b/opentaxii/_version.py index 4af68473..b54d2ffd 100644 --- a/opentaxii/_version.py +++ b/opentaxii/_version.py @@ -3,4 +3,4 @@ This module defines the package version for use in __init__.py and setup.py. """ -__version__ = '0.2.3' +__version__ = '0.2.4' From ea2c50984f8c702c0a0803ecd0b2a1b7fb91b3c4 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Wed, 13 Apr 2022 13:23:44 +0200 Subject: [PATCH 7/7] Bump version --- CHANGES.rst | 4 ++++ opentaxii/_version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8370e53c..813547c7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,10 @@ Changelog ========= +0.3.0a4 (2022-04-13) +-------------------- +* Merge changes from 0.2.4 maintenance release + 0.3.0a3 (2022-01-21) -------------------- * Fix bug that prevented booting with only taxii1 config (`#217 `_ thanks `@azurekid `_ for the report) diff --git a/opentaxii/_version.py b/opentaxii/_version.py index a72abf67..ee4cbff8 100644 --- a/opentaxii/_version.py +++ b/opentaxii/_version.py @@ -3,4 +3,4 @@ This module defines the package version for use in __init__.py and setup.py. """ -__version__ = '0.3.0a3' +__version__ = '0.3.0a4'