File: idp.py

package info (click to toggle)
python-redis 6.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,432 kB
  • sloc: python: 60,318; sh: 179; makefile: 128
file content (28 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from abc import ABC, abstractmethod

from redis.auth.token import TokenInterface

"""
This interface is the facade of an identity provider
"""


class IdentityProviderInterface(ABC):
    """
    Receive a token from the identity provider.
    Receiving a token only works when being authenticated.
    """

    @abstractmethod
    def request_token(self, force_refresh=False) -> TokenInterface:
        pass


class IdentityProviderConfigInterface(ABC):
    """
    Configuration class that provides a configured identity provider.
    """

    @abstractmethod
    def get_provider(self) -> IdentityProviderInterface:
        pass