from typing import Dict
from datetime import datetime
import hmac
import hashlib


def get_headers(tokens: tuple, request: str) -> Dict[str, str]:
    """Returns the appropriate HTTP Header for token authentication.
    :type tokens: ``tuple``
    :param tokens: Tuple containing the PUBLIC and PRIVATE API tokens
    :type request: ``str``
    :param request: API request being made, ex: /modelbreaches
    :return:
        returns a Dictionary of the necessary HTTP Headers
    :rtype: ``Dict[str, str]``
    """
    d = datetime.utcnow()
    now = d.strftime('%Y%m%dT%H%M%S')
    public = tokens[0]
    private = tokens[1]
    maccer = hmac.new(private.encode('ASCII'),
                      (request + '\n' + public + '\n' + now).encode('ASCII'), hashlib.sha1)
    sig = maccer.hexdigest()
    headers = {'DTAPI-Token': public, 'DTAPI-Date': now, 'DTAPI-Signature': sig}
    return headers