EDUPERSON_OID = "urn:oid:1.3.6.1.4.1.5923.1.1.1."
NETSCAPE_LDAP = "urn:oid:2.16.840.1.113730.3.1."
NOREDUPERSON_OID = "urn:oid:1.3.6.1.4.1.2428.90.1."
PKCS_9 = "urn:oid:1.2.840.113549.1.9."
UCL_DIR_PILOT = "urn:oid:0.9.2342.19200300.100.1."
UMICH = "urn:oid:1.3.6.1.4.1.250.1.57."
X500ATTR = "urn:oid:2.5.4."


MAP = {
    "identifier": "urn:mace:shibboleth:1.0:attributeNamespace:uri",
    "fro": {
        f"{EDUPERSON_OID}1": "eduPersonAffiliation",
        f"{EDUPERSON_OID}2": "eduPersonNickname",
        f"{EDUPERSON_OID}3": "eduPersonOrgDN",
        f"{EDUPERSON_OID}4": "eduPersonOrgUnitDN",
        f"{EDUPERSON_OID}5": "eduPersonPrimaryAffiliation",
        f"{EDUPERSON_OID}6": "eduPersonPrincipalName",
        f"{EDUPERSON_OID}7": "eduPersonEntitlement",
        f"{EDUPERSON_OID}8": "eduPersonPrimaryOrgUnitDN",
        f"{EDUPERSON_OID}9": "eduPersonScopedAffiliation",
        f"{EDUPERSON_OID}10": "eduPersonTargetedID",
        f"{EDUPERSON_OID}11": "eduPersonAssurance",
        f"{EDUPERSON_OID}12": "eduPersonPrincipalNamePrior",
        f"{EDUPERSON_OID}13": "eduPersonUniqueId",
        f"{EDUPERSON_OID}16": "eduPersonOrcid",
        f"{NETSCAPE_LDAP}1": "carLicense",
        f"{NETSCAPE_LDAP}2": "departmentNumber",
        f"{NETSCAPE_LDAP}3": "employeeNumber",
        f"{NETSCAPE_LDAP}4": "employeeType",
        f"{NETSCAPE_LDAP}13": "mailLocalAddress",
        f"{NETSCAPE_LDAP}39": "preferredLanguage",
        f"{NETSCAPE_LDAP}40": "userSMIMECertificate",
        f"{NETSCAPE_LDAP}216": "userPKCS12",
        f"{NETSCAPE_LDAP}241": "displayName",
        f"{NOREDUPERSON_OID}1": "norEduOrgUniqueNumber",
        f"{NOREDUPERSON_OID}2": "norEduOrgUnitUniqueNumber",
        f"{NOREDUPERSON_OID}3": "norEduPersonBirthDate",
        f"{NOREDUPERSON_OID}4": "norEduPersonLIN",
        f"{NOREDUPERSON_OID}5": "norEduPersonNIN",
        f"{NOREDUPERSON_OID}6": "norEduOrgAcronym",
        f"{NOREDUPERSON_OID}7": "norEduOrgUniqueIdentifier",
        f"{NOREDUPERSON_OID}8": "norEduOrgUnitUniqueIdentifier",
        f"{NOREDUPERSON_OID}9": "federationFeideSchemaVersion",
        f"{PKCS_9}1": "email",
        f"{UCL_DIR_PILOT}3": "mail",
        f"{UCL_DIR_PILOT}25": "dc",
        f"{UCL_DIR_PILOT}37": "associatedDomain",
        f"{UCL_DIR_PILOT}60": "jpegPhoto",
        f"{X500ATTR}2": "knowledgeInformation",
        f"{X500ATTR}4": "sn",
        f"{X500ATTR}5": "serialNumber",
        f"{X500ATTR}6": "c",
        f"{X500ATTR}7": "l",
        f"{X500ATTR}8": "st",
        f"{X500ATTR}9": "street",
        f"{X500ATTR}10": "o",
        f"{X500ATTR}11": "ou",
        f"{X500ATTR}12": "title",
        f"{X500ATTR}14": "searchGuide",
        f"{X500ATTR}15": "businessCategory",
        f"{X500ATTR}16": "postalAddress",
        f"{X500ATTR}17": "postalCode",
        f"{X500ATTR}18": "postOfficeBox",
        f"{X500ATTR}19": "physicalDeliveryOfficeName",
        f"{X500ATTR}20": "telephoneNumber",
        f"{X500ATTR}21": "telexNumber",
        f"{X500ATTR}22": "teletexTerminalIdentifier",
        f"{X500ATTR}23": "facsimileTelephoneNumber",
        f"{X500ATTR}24": "x121Address",
        f"{X500ATTR}25": "internationaliSDNNumber",
        f"{X500ATTR}26": "registeredAddress",
        f"{X500ATTR}27": "destinationIndicator",
        f"{X500ATTR}28": "preferredDeliveryMethod",
        f"{X500ATTR}29": "presentationAddress",
        f"{X500ATTR}30": "supportedApplicationContext",
        f"{X500ATTR}31": "member",
        f"{X500ATTR}32": "owner",
        f"{X500ATTR}33": "roleOccupant",
        f"{X500ATTR}36": "userCertificate",
        f"{X500ATTR}37": "cACertificate",
        f"{X500ATTR}38": "authorityRevocationList",
        f"{X500ATTR}39": "certificateRevocationList",
        f"{X500ATTR}40": "crossCertificatePair",
        f"{X500ATTR}42": "givenName",
        f"{X500ATTR}43": "initials",
        f"{X500ATTR}44": "generationQualifier",
        f"{X500ATTR}45": "x500UniqueIdentifier",
        f"{X500ATTR}46": "dnQualifier",
        f"{X500ATTR}47": "enhancedSearchGuide",
        f"{X500ATTR}48": "protocolInformation",
        f"{X500ATTR}50": "uniqueMember",
        f"{X500ATTR}51": "houseIdentifier",
        f"{X500ATTR}52": "supportedAlgorithms",
        f"{X500ATTR}53": "deltaRevocationList",
        f"{X500ATTR}54": "dmdName",
        f"{X500ATTR}65": "pseudonym",
    },
    "to": {
        "associatedDomain": f"{UCL_DIR_PILOT}37",
        "authorityRevocationList": f"{X500ATTR}38",
        "businessCategory": f"{X500ATTR}15",
        "c": f"{X500ATTR}6",
        "cACertificate": f"{X500ATTR}37",
        "carLicense": f"{NETSCAPE_LDAP}1",
        "certificateRevocationList": f"{X500ATTR}39",
        "countryName": f"{X500ATTR}6",
        "crossCertificatePair": f"{X500ATTR}40",
        "dc": f"{UCL_DIR_PILOT}25",
        "deltaRevocationList": f"{X500ATTR}53",
        "departmentNumber": f"{NETSCAPE_LDAP}2",
        "destinationIndicator": f"{X500ATTR}27",
        "displayName": f"{NETSCAPE_LDAP}241",
        "dmdName": f"{X500ATTR}54",
        "dnQualifier": f"{X500ATTR}46",
        "domainComponent": f"{UCL_DIR_PILOT}25",
        "eduPersonAffiliation": f"{EDUPERSON_OID}1",
        "eduPersonEntitlement": f"{EDUPERSON_OID}7",
        "eduPersonNickname": f"{EDUPERSON_OID}2",
        "eduPersonOrgDN": f"{EDUPERSON_OID}3",
        "eduPersonOrgUnitDN": f"{EDUPERSON_OID}4",
        "eduPersonPrimaryAffiliation": f"{EDUPERSON_OID}5",
        "eduPersonPrimaryOrgUnitDN": f"{EDUPERSON_OID}8",
        "eduPersonPrincipalName": f"{EDUPERSON_OID}6",
        "eduPersonPrincipalNamePrior": f"{EDUPERSON_OID}12",
        "eduPersonScopedAffiliation": f"{EDUPERSON_OID}9",
        "eduPersonTargetedID": f"{EDUPERSON_OID}10",
        "eduPersonAssurance": f"{EDUPERSON_OID}11",
        "eduPersonUniqueId": f"{EDUPERSON_OID}13",
        "eduPersonOrcid": f"{EDUPERSON_OID}16",
        "email": f"{PKCS_9}1",
        "emailAddress": f"{PKCS_9}1",
        "employeeNumber": f"{NETSCAPE_LDAP}3",
        "employeeType": f"{NETSCAPE_LDAP}4",
        "enhancedSearchGuide": f"{X500ATTR}47",
        "facsimileTelephoneNumber": f"{X500ATTR}23",
        "fax": f"{X500ATTR}23",
        "federationFeideSchemaVersion": f"{NOREDUPERSON_OID}9",
        "generationQualifier": f"{X500ATTR}44",
        "givenName": f"{X500ATTR}42",
        "gn": f"{X500ATTR}42",
        "houseIdentifier": f"{X500ATTR}51",
        "initials": f"{X500ATTR}43",
        "internationaliSDNNumber": f"{X500ATTR}25",
        "jpegPhoto": f"{UCL_DIR_PILOT}60",
        "knowledgeInformation": f"{X500ATTR}2",
        "l": f"{X500ATTR}7",
        "localityName": f"{X500ATTR}7",
        "mail": f"{UCL_DIR_PILOT}3",
        "mailLocalAddress": f"{NETSCAPE_LDAP}13",
        "member": f"{X500ATTR}31",
        "norEduOrgAcronym": f"{NOREDUPERSON_OID}6",
        "norEduOrgUniqueIdentifier": f"{NOREDUPERSON_OID}7",
        "norEduOrgUniqueNumber": f"{NOREDUPERSON_OID}1",
        "norEduOrgUnitUniqueIdentifier": f"{NOREDUPERSON_OID}8",
        "norEduOrgUnitUniqueNumber": f"{NOREDUPERSON_OID}2",
        "norEduPersonBirthDate": f"{NOREDUPERSON_OID}3",
        "norEduPersonLIN": f"{NOREDUPERSON_OID}4",
        "norEduPersonNIN": f"{NOREDUPERSON_OID}5",
        "o": f"{X500ATTR}10",
        "organizationName": f"{X500ATTR}10",
        "organizationalUnitName": f"{X500ATTR}11",
        "ou": f"{X500ATTR}11",
        "owner": f"{X500ATTR}32",
        "physicalDeliveryOfficeName": f"{X500ATTR}19",
        "pkcs9email": f"{PKCS_9}1",
        "postOfficeBox": f"{X500ATTR}18",
        "postalAddress": f"{X500ATTR}16",
        "postalCode": f"{X500ATTR}17",
        "preferredDeliveryMethod": f"{X500ATTR}28",
        "preferredLanguage": f"{NETSCAPE_LDAP}39",
        "presentationAddress": f"{X500ATTR}29",
        "protocolInformation": f"{X500ATTR}48",
        "pseudonym": f"{X500ATTR}65",
        "registeredAddress": f"{X500ATTR}26",
        "rfc822Mailbox": f"{UCL_DIR_PILOT}3",
        "roleOccupant": f"{X500ATTR}33",
        "searchGuide": f"{X500ATTR}14",
        "serialNumber": f"{X500ATTR}5",
        "sn": f"{X500ATTR}4",
        "st": f"{X500ATTR}8",
        "stateOrProvinceName": f"{X500ATTR}8",
        "street": f"{X500ATTR}9",
        "streetAddress": f"{X500ATTR}9",
        "supportedAlgorithms": f"{X500ATTR}52",
        "supportedApplicationContext": f"{X500ATTR}30",
        "surname": f"{X500ATTR}4",
        "telephoneNumber": f"{X500ATTR}20",
        "teletexTerminalIdentifier": f"{X500ATTR}22",
        "telexNumber": f"{X500ATTR}21",
        "title": f"{X500ATTR}12",
        "uniqueMember": f"{X500ATTR}50",
        "userCertificate": f"{X500ATTR}36",
        "userPKCS12": f"{NETSCAPE_LDAP}216",
        "userSMIMECertificate": f"{NETSCAPE_LDAP}40",
        "x121Address": f"{X500ATTR}24",
        "x500UniqueIdentifier": f"{X500ATTR}45",
    },
}
