2factorauth / twofactorauth

List of sites with two factor auth support which includes SMS, email, phone calls, hardware, and software.
https://2fa.directory
Other
3.39k stars 1.78k forks source link

Latest Update changes API JSON format from array to object #8131

Closed xmok closed 4 months ago

xmok commented 4 months ago

Information about the bug:

Bug description: Previously, the API format was an array of arrays as shown on https://2fa.directory/api/.

[
  [
    "Site Name",
    {
      "domain": "example.com",
      "additional-domains": [
        "example.net"
      ],
      "tfa": [
        "sms",
        "call",
        "email",
        "totp",
        "u2f",
        "custom-software",
        "custom-hardware"
      ],
      "custom-software": [
        "Authy"
      ],
      "documentation": "<link to site TFA documentation>",
      "recovery": "<link to site TFA recovery documentation>",
      "keywords": [
        "keyword1",
        "keyword2"
      ]
    }
  ]
]

As of latest commits the output is now an object:

{
  "000webhost": {
    "domain": "000webhost.com",
    "contact": {
      "twitter": "000webhost_com",
      "facebook": "000webhost.Global"
    },
    "keywords": [
      "hosting"
    ]
  },
  "101domain": {
    "domain": "101domain.com",
    "tfa": [
      "totp"
    ],
    "documentation": "https://help.101domain.com/kb/setup-two-factor-authentication",
    "keywords": [
      "domains"
    ]
  },

Bug reproduction: View the API file e.g. https://api.2fa.directory/v3/all.json

Impacted devices: All?

Expected behavior: The object format seems OK to me but need confirmation if this is the new format or if the old format will be brought back as it's currently breaking integrations.

Additional information: N/A

Carlgo11 commented 4 months ago

Hello @xmok, Thank you for the bug report!

The changed JSON structure was introduced in a previous bug fix and has now been rolled back. The example structure on https://2fa.directory/api/ is still the official one, and we only intentionally change it when we move to different API versions.