class_docstr: Implements the authorization protocol for a moderated Hivemind network.
  See https://github.com/learning-at-home/hivemind/issues/253
class_docstr_tok: ["Implements","the","authorization","protocol","for","a","moderated","Hivemind","network",".","See","https",":","\/\/github.com\/learning-at-home\/hivemind\/issues\/253"]
code: def __init__(self, local_private_key: Optional[RSAPrivateKey] = None):
      if local_private_key is None:
          local_private_key = RSAPrivateKey.process_wide()
      self._local_private_key = local_private_key
      self._local_public_key = local_private_key.get_public_key()
  
      self._local_access_token = None
      self._refresh_lock = asyncio.Lock()
  
      self._recent_nonces = TimedStorage()
  
imports: import asyncio
  import functools
  import secrets
  from abc import ABC, abstractmethod
  from datetime import timedelta
  from enum import Enum
  from typing import Optional
  from hivemind.proto.auth_pb2 import AccessToken, RequestAuthInfo, ResponseAuthInfo
  from hivemind.utils.crypto import RSAPrivateKey, RSAPublicKey
  from hivemind.utils.logging import get_logger
  from hivemind.utils.timed_storage import TimedStorage, get_dht_time
label_desc: Use image node_id 1 to create a new TokenAuthorizerBase object from inherited base classes: AuthorizerBase with example: obj = TokenAuthorizerBase(local_private_key)