Skip to content

Service that acts as a Third Party Integrations resolver exposing only the healthy ones.

License

Notifications You must be signed in to change notification settings

decentraland/third-party-providers-resolver

Repository files navigation

Third Party Providers Resolver

Coverage Status

This service filters and returns the Third Party Providers that are in a healthy state.

The purpose of this service is to prevent unnecessary timeouts for consumers by avoiding calls to API resolvers that are unresponsive or offline when validating item ownership.

Implementation

What this service does:

  1. Retrieves all Third Party Providers from TheGraph
  2. Checks the health of each Third Party Provider by fetching the endpoint required in the ADR-42
  3. Caches the providers that are healthy in a memory storage (LRU cache)
  4. Returns the healthy providers every time the endpoint GET /providers is called

What healthy means on this service's context?

If any Third Party Provider's endpoint returns a 200 OK status code when fetched, it will be regarded as healthy.

Exposed endpoints

This service only exposes GET /providers endpoint which returns a JSON containing the healthy providers (the unhealthy providers are not returned on this endpoint). Response example:

{
  "thirdPartyProviders": [
    {
      "id": "urn:decentraland:mumbai:collections-thirdparty:first-collection",
      "resolver": "https://third-party-resolver-api.decentraland.zone/v1",
      "metadata": {
        "thirdParty": {
          "name": "First collection",
          "description": "Nonexistent: only for docs purposes."
        }
      }
    },
    {
      "id": "urn:decentraland:mumbai:collections-thirdparty:second-collection",
      "resolver": "https://third-party-resolver-api.decentraland.zone/v1",
      "metadata": {
        "thirdParty": {
          "name": "Second collection",
          "description": "Nonexistent: only for docs purposes."
        }
      }
    }
  ]
}