Skip to content

Commit

Permalink
REST API: support all authentication methods (#354)
Browse files Browse the repository at this point in the history
support all authentication methods, e.g. HTTP basic or subclasses of AuthBase
  • Loading branch information
willi-mueller authored Feb 15, 2024
1 parent 4428038 commit 6ec138c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/rest_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
HeaderLinkPaginator,
UnspecifiedPaginator,
)
from .auth import BearerTokenAuth
from .auth import BearerTokenAuth, AuthBase


PAGINATOR_MAP = {
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6ec138c

Please sign in to comment.