aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/google-auth/py3/google/oauth2/webauthn_handler_factory.py
blob: 184329fed7e921cff1003a91ddd4c9819618a065 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from typing import List, Optional

from google.oauth2.webauthn_handler import PluginHandler, WebAuthnHandler


class WebauthnHandlerFactory:
    handlers: List[WebAuthnHandler]

    def __init__(self):
        self.handlers = [PluginHandler()]

    def get_handler(self) -> Optional[WebAuthnHandler]:
        for handler in self.handlers:
            if handler.is_available():
                return handler
        return None