foojayio / discoapi

The foojay discovery api (discoapi) is made to discover java packages (jre/jdk) from different distributions.
GNU General Public License v2.0
111 stars 13 forks source link

Epemeral package info URL doesn't work #37

Closed jexp closed 3 years ago

jexp commented 3 years ago

Not sure what I'm doing wrong, I used: https://api.foojay.io/swagger-ui#/default/getPackgeInfoV2

curl https://api.foojay.io/disco/v2.0/packages/43afdc6785055999f3104208d4b9d703 | jq .
{
  "result": [
    {
      "id": "43afdc6785055999f3104208d4b9d703",
      "archive_type": "tar.gz",
      "distribution": "zulu",
      "major_version": 16,
      "java_version": "16.0.1",
      "distribution_version": "16.30.15",
      "latest_build_available": true,
      "release_status": "ga",
      "term_of_support": "sts",
      "operating_system": "linux",
      "lib_c_type": "musl",
      "architecture": "x64",
      "package_type": "jdk",
      "javafx_bundled": false,
      "directly_downloadable": true,
      "filename": "zulu16.30.15-ca-jdk16.0.1-linux_musl_x64.tar.gz",
      "ephemeral_id": "a518226a4bf6fa0250cd8ba0f06545bb2ff6ad5c",
      "links": {
        "pkg_info_uri": "https://api.foojay.io/disco/v2.0/ephemeral_ids/a518226a4bf6fa0250cd8ba0f06545bb2ff6ad5c"
      },
      "free_use_in_production": true,
      "feature": []
    }
  ],
  "message": ""
}

$ curl -s https://api.foojay.io/disco/v2.0/ephemeral_ids/a518226a4bf6fa0250cd8ba0f06545bb2ff6ad5c | jq .
{
  "result": [],
  "message": "Ephemeral id not found or outdated"
}

Same happens in the swagger UI

image

HanSolo commented 3 years ago

Hmm…interesting, you did nothing wrong, it should work that way. Will check what went wrong here, thx for the info.

HanSolo commented 3 years ago

Tried it using Paw on MacOS and from the browser directly and it worked directly BUT in the swagger-ui it did not work. The reason is that the ephemeral_id is not the right one, looks like it uses a cached older one. The ephemeral_id changes every 10min for each package but this should usually not happen unless you use an outdated ephemeral_id.

HanSolo commented 3 years ago

Ok, I've found the problem and will fix it asap, will close this issue as soon as the issue will be fixed and the next version is deployed.

jexp commented 3 years ago

Super. Thanks so much.

HanSolo commented 3 years ago

Issue should be fixed with latest deployment.