hyb
2025-12-23 10f3a1daddfbc7fa3dd2069197d83e8b6ef19176
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