File: webauthn_handler_factory.py

package info (click to toggle)
python-google-auth 2.40.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,232 kB
  • sloc: python: 31,383; sh: 80; makefile: 9
file content (16 lines) | stat: -rw-r--r-- 429 bytes parent folder | download | duplicates (6)
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