From 11ba55f4749a3b94639ddd5c6129272679d8dac8 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Fri, 21 Jan 2022 19:52:55 +0100 Subject: [PATCH 1/5] Update `create_engine` call to get rid of warning --- opentaxii/sqldb_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentaxii/sqldb_helper.py b/opentaxii/sqldb_helper.py index ffd9a714..a534862c 100644 --- a/opentaxii/sqldb_helper.py +++ b/opentaxii/sqldb_helper.py @@ -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) From c2cf09b03e71039c03e86b4253d515ec411f0b81 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Fri, 21 Jan 2022 19:53:40 +0100 Subject: [PATCH 2/5] Fix bug that prevented booting with only taxii1 config --- opentaxii/server.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/opentaxii/server.py b/opentaxii/server.py index 3cf28027..21ad146b 100644 --- a/opentaxii/server.py +++ b/opentaxii/server.py @@ -342,8 +342,8 @@ class TAXII2Server(BaseTAXIIServer): class ServerMapping(NamedTuple): - taxii1: TAXII1Server - taxii2: TAXII2Server + taxii1: Optional[TAXII1Server] + taxii2: Optional[TAXII2Server] class TAXIIServer: @@ -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")} @@ -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): From ca1b667865eabcdb0c2f046465499e87eee73546 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Fri, 21 Jan 2022 19:56:45 +0100 Subject: [PATCH 3/5] Fix docs --- CHANGES.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2ba1d49a..59ea77a1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,7 +2,7 @@ Changelog ========= 0.3.0a2 (2021-12-27) -------- +-------------------- * Merge changes from 0.2.3 maintenance release 0.3.0a1 @@ -16,7 +16,7 @@ Changelog 0.2.3 (2021-12-22) ------------------ -* Fix bug in multithreaded use of sqlite (`#210 `_ thanks `@rohits144 `_ for the report) +* Fix bug in multithreaded use of sqlite (`#210 `_ thanks `@rohits144 `_ for the report) 0.2.2 (2021-11-05) ------------------ From 03193be1b5cf1b68af2ea40b9f0e5deaa26a63d2 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Fri, 21 Jan 2022 19:56:53 +0100 Subject: [PATCH 4/5] Update docs --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 59ea77a1..fe098ac9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,10 @@ Changelog ========= +0.3.0a3 (2022-01-21) +-------------------- +* Fix bug that prevented booting with only taxii1 config (`#217 `_ thanks `@azurekid `_ for the report) + 0.3.0a2 (2021-12-27) -------------------- * Merge changes from 0.2.3 maintenance release From 1c3d2330778288a130f7af8432c45898b3ac6615 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Fri, 21 Jan 2022 19:57:23 +0100 Subject: [PATCH 5/5] Bump version --- opentaxii/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentaxii/_version.py b/opentaxii/_version.py index 750b3e02..a72abf67 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.0a2' +__version__ = '0.3.0a3'