Skip to content

Commit

Permalink
Merge pull request #225 from eclecticiq/werkzeug21-master
Browse files Browse the repository at this point in the history
Werkzeug21 master
  • Loading branch information
erwin-eiq authored Apr 13, 2022
2 parents c41728d + ea2c509 commit 9290097
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/eclecticiq/OpenTAXII/issues/217>`_ thanks `@azurekid <https://github.com/azurekid>`_ for the report)
Expand All @@ -18,6 +22,10 @@ Changelog
* Enablement for future taxii2 implementation
* Fix documentation build issues

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 <https://github.com/eclecticiq/OpenTAXII/issues/210>`_ thanks `@rohits144 <https://github.com/rohits144>`_ for the report)
Expand Down
2 changes: 1 addition & 1 deletion opentaxii/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions opentaxii/management.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Blueprint, request, jsonify, abort
from flask import Blueprint, abort, jsonify, request

from .local import context

Expand All @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions opentaxii/sqldb_helper.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
skipsdist = True
envlist = py{36,37,38,39,310,py3,ston}-sqlalchemy{13,14}-{sqlite,mysql,mariadb,postgres}
envlist = py36-sqlalchemy{13,14}-werkzeuglt21-{sqlite,mysql,mariadb,postgres},
py{37,38,39,310,py3,ston}-sqlalchemy{13,14}-werkzeug{lt21,gte21}-{sqlite,mysql,mariadb,postgres}

[gh-actions]
python =
Expand All @@ -21,6 +22,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
Expand Down

0 comments on commit 9290097

Please sign in to comment.