Skip to content

Commit

Permalink
Merge branch '0.2.x' into werkzeug21-master
Browse files Browse the repository at this point in the history
  • Loading branch information
erwin-eiq committed Apr 13, 2022
2 parents c41728d + 5b09ef1 commit c529185
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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
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 c529185

Please sign in to comment.