From 6ec138c8a13c5d82bf2a74d739f7968733d97189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Willi=20M=C3=BCller?= Date: Thu, 15 Feb 2024 18:34:44 +0100 Subject: [PATCH] REST API: support all authentication methods (#354) support all authentication methods, e.g. HTTP basic or subclasses of AuthBase --- sources/rest_api/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/rest_api/__init__.py b/sources/rest_api/__init__.py index cb217a1f3..14089336d 100644 --- a/sources/rest_api/__init__.py +++ b/sources/rest_api/__init__.py @@ -19,7 +19,7 @@ HeaderLinkPaginator, UnspecifiedPaginator, ) -from .auth import BearerTokenAuth +from .auth import BearerTokenAuth, AuthBase PAGINATOR_MAP = { @@ -83,7 +83,7 @@ def create_paginator(paginator_config): def create_auth(auth_config): - if isinstance(auth_config, BearerTokenAuth): + if isinstance(auth_config, AuthBase): return auth_config return BearerTokenAuth(auth_config.get("token")) if auth_config else None