from datetime import datetime
from typing import Dict
from typing import Any


def userinfo_token(
        token_subject: str,
        token_idp: str,
        token_issued: datetime,
        token_tin: str,
        token_aud: str,
        token_transaction_id: str,
) -> Dict[str, Any]:
    """Mock userinfo-token from Identity Provider (unencoded)."""

    return {
        "iss": "https://pp.netseidbroker.dk/op",
        "nbf": 1643290895,
        "iat": 1643290895,
        "exp": 1643291195,
        "amr": [
            "nemid.otp"
        ],
        "idp": token_idp,
        "nemid.ssn": "CVR:39315041-RID:35613330",
        "nemid.common_name": "TEST - Jakob Kristensen",
        "nemid.dn": "CN=TEST - Jakob Kristensen+SERIALNUMBER=CVR:39315041-RID:35613330,O=Energinet DataHub A/S // CVR:39315041,C=DK",  # noqa: E501
        "nemid.rid": "35613330",
        "nemid.company_name": "Energinet DataHub A/S ",
        "nemid.cvr": token_tin,
        "identity_type": "professional",
        "auth_time": int(token_issued.timestamp()),
        "sub": token_subject,
        "transaction_id": token_transaction_id,
        "aud": token_aud,
    }