From 07e6399bfb8d3b5aeb99821ad94e3c8522c39dbd Mon Sep 17 00:00:00 2001 From: Ben Webster Date: Fri, 4 Aug 2023 13:55:28 +0300 Subject: [PATCH] add support for token auth type used by taxii2client --- opentaxii/middleware.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opentaxii/middleware.py b/opentaxii/middleware.py index 02f8ebb1..af93de75 100644 --- a/opentaxii/middleware.py +++ b/opentaxii/middleware.py @@ -88,6 +88,11 @@ def _authenticate(server, headers): token = server.auth.authenticate(username, password) + # Support `token` type provided by `taxii2client` library + # https://github.com/oasis-open/cti-taxii-client/blob/54dabadf1a67517e99e6a8f2961614a2a4f5ad2c/taxii2client/common.py#L138 + elif auth_type == "token": + token = raw_token + elif auth_type == "bearer": token = raw_token else: