Created
April 10, 2017 16:25
-
-
Save strfry/b433a8167f645306c8e7afa682353738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Exceptions Different Error Classes? | |
# - Card not present / token_id not found | |
# - Transport Error (try again) | |
# - Key Error (retry is futile?) | |
# - Unknown Token Error | |
class AuthenticationDriver(object): | |
def __init__(self, slot=4): | |
self.slot = slot | |
def detect(self): | |
"""Scans for Authentication Tokens, returns Token ID on success""" | |
return | |
def check(self, token_id, transport_key, known_secret): | |
"""Connect and read the token, verify against known secret | |
Returns True when auth token seems valid""" | |
return False | |
def withdraw(self, token_id, transport_key): | |
"""Invalidate a token (by overwriting secret with garbage)""" | |
return False | |
def assign(self, token_id, transport_key) | |
"""Initialize a new token with given parameters""" | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment