Skip to content

Commit

Permalink
Merge pull request #218 from eclecticiq/2022-01-21-bugfixes
Browse files Browse the repository at this point in the history
2022 01 21 bugfixes
  • Loading branch information
erwin-eiq committed Jan 21, 2022
2 parents ff56954 + 1c3d233 commit c41728d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 6 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Changelog
=========

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)

0.3.0a2 (2021-12-27)
-------
--------------------
* Merge changes from 0.2.3 maintenance release

0.3.0a1
Expand All @@ -16,7 +20,7 @@ Changelog

0.2.3 (2021-12-22)
------------------
* Fix bug in multithreaded use of sqlite (`#210 <https://github.com/eclecticiq/OpenTAXII/issues/114>`_ thanks `@rohits144 <https://github.com/rohits144>`_ for the report)
* Fix bug in multithreaded use of sqlite (`#210 <https://github.com/eclecticiq/OpenTAXII/issues/210>`_ thanks `@rohits144 <https://github.com/rohits144>`_ for the report)

0.2.2 (2021-11-05)
------------------
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.0a2'
__version__ = '0.3.0a3'
12 changes: 8 additions & 4 deletions opentaxii/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ class TAXII2Server(BaseTAXIIServer):


class ServerMapping(NamedTuple):
taxii1: TAXII1Server
taxii2: TAXII2Server
taxii1: Optional[TAXII1Server]
taxii2: Optional[TAXII2Server]


class TAXIIServer:
Expand All @@ -364,7 +364,10 @@ class TAXIIServer:

def __init__(self, config: ServerConfig):
self.config = config
servers_kwargs = {}
servers_kwargs = {
"taxii1": None,
"taxii2": None,
}
if "taxii1" in config and config["taxii1"]:
servers_kwargs["taxii1"] = TAXII1Server(
{**config["taxii1"], "domain": config.get("domain")}
Expand All @@ -382,7 +385,8 @@ def init_app(self, app: Flask):
"""Connect taxii1, taxii2 and auth to flask."""
self.app = app
for server in self.servers:
server.init_app(app)
if server is not None:
server.init_app(app)
self.auth.api.init_app(app)

def is_basic_auth_supported(self):
Expand Down
2 changes: 1 addition & 1 deletion opentaxii/sqldb_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SQLAlchemyDB:
'''

def __init__(self, db_connection, base_model, session_options=None, **kwargs):
self.engine = engine.create_engine(db_connection, convert_unicode=True, **kwargs)
self.engine = engine.create_engine(db_connection, **kwargs)
self.Query = orm.Query
self.session = self.create_scoped_session(session_options)
self.Model = self.extend_base_model(base_model)
Expand Down

0 comments on commit c41728d

Please sign in to comment.