from typing import Dict
import json
import base64


def decode_base64json(data: str) -> Dict:
    """Decode base64'd JSON to a dictionary"""
    data += '=' * (-len(data) % 4)  # restore stripped '='s
    return json.loads(base64.b64decode(data).decode("utf-8"))