Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web3 pinning service returns invalid PinStatus object #1221

Closed
SgtPooki opened this issue Apr 5, 2022 · 3 comments · Fixed by #1267
Closed

web3 pinning service returns invalid PinStatus object #1221

SgtPooki opened this issue Apr 5, 2022 · 3 comments · Fixed by #1267
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization topic/psa

Comments

@SgtPooki
Copy link

SgtPooki commented Apr 5, 2022

I am working on ipfs/pinning-services-api-spec#64 and ipfs-shipyard/pinning-service-compliance#4. While attempting to delete all existing pins, I ran into an error with web3.storage's pinning service because the PinResults returned has the property requestId instead of requestid.

Check the spec at https://ipfs.github.io/pinning-services-api-spec/#tag/pins/paths/~1pins/get:
image

Compliance report:

Request - GET: https://api.web3.storage/pins?status=failed%2Cpinned%2Cpinning%2Cqueued

Headers
{
  "Authorization": "Bearer REDACTED"
}
Body
undefined

Response - OK (200)

Headers
{
  "access-control-allow-origin": "*",
  "access-control-expose-headers": "Link",
  "cf-ray": "6f74509648ab0911-SEA",
  "connection": "close",
  "content-encoding": "gzip",
  "content-type": "application/json;charset=UTF-8",
  "date": "Tue, 05 Apr 2022 18:23:26 GMT",
  "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
  "server": "cloudflare",
  "transfer-encoding": "chunked",
  "vary": "Accept-Encoding"
}
Body
{
  "count": 3,
  "results": [
    {
      "requestId": "1dfb96af-ab6f-4149-bd4a-e4a043980e40",
      "status": "queued",
      "created": "2022-04-05T17:57:57.774+00:00",
      "pin": {
        "cid": "bafkqadjrgy2dsmjyge2domjsgm2a",
        "_id": "1dfb96af-ab6f-4149-bd4a-e4a043980e40",
        "sourceCid": "bafkqadjrgy2dsmjyge2domjsgm2a",
        "contentCid": "bafkqadjrgy2dsmjyge2domjsgm2a",
        "authKey": REDACTED,
        "name": null,
        "meta": null,
        "deleted": null,
        "created": "2022-04-05T17:57:57.774+00:00",
        "updated": "2022-04-05T17:57:57.774+00:00",
        "pins": [
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWR19qPPiZH4khepNjS3CLXiB7AbrbAD4ZcDjN1UjGUNE1",
            "peerName": "web3-storage-sv15",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWSnniGsyAF663gvHdqhyfJMCjWJv54cGSzcPiEMAfanvU",
            "peerName": "web3-storage-dc13",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWPySxxWQjBgX9Jp6uAHQfVmdq8HG1gVvS1fRawHNSrmqW",
            "peerName": "web3-storage-am6",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWEDMw7oRqQkdCJbyeqS5mUmWGwTp8JJ2tjCzTkHboF6wK",
            "peerName": "web3-storage-sv15-2",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWNuoVEfVLJvU3jWY2zLYjGUaathsecwT19jhByjnbQvkj",
            "peerName": "web3-storage-am6-2",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWKytRAd2ujxhGzaLHKJuje8sVrHXvjGNvHXovpar5KaKQ",
            "peerName": "web3-storage-dc13-2",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWJEfH2MB4RsUoaJPogDPRWbFTi8iehsxsqrQpiJwFNDrP",
            "peerName": "web3-storage-dc13-3",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWRi18oHN1j8McxS9RMnuibcTwxu6VCTYHyLNH2R14qhTy",
            "peerName": "web3-storage-sv15-3",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWQYBPcvxFnnWzPGEx6JuBnrbF1FZq4jTahczuG2teEk1m",
            "peerName": "web3-storage-am6-3",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWDdzN3snjaMJEH9zuq3tjKUFpYHeSGNkiAreF6dQSbCiL",
            "peerName": "web3-storage-am6-4",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWEzCun34s9qpYEnKkG6epx2Ts9oVGRGnzCvM2s2edioLA",
            "peerName": "web3-storage-am6-5",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWHpE5KiQTkqbn8KbU88ZxwJxYJFaqP4mp9Z9bhNPhym9V",
            "peerName": "web3-storage-dc13-4",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWBHvsSSKHeragACma3HUodK5FcPUpXccLu2vHooNsDf9k",
            "peerName": "web3-storage-dc13-5",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWAdxvJCV5KXZ6zveTJmnYGrSzAKuLUKZYkZssLk7UKv4i",
            "peerName": "web3-storage-sv15-5",
            "region": null
          },
          {
            "status": "Unpinned",
            "updated": "2022-04-05T17:57:57.774+00:00",
            "peerId": "12D3KooWKhPb9tSnCqBswVfC5EPE7iSTXhbF4Ywwz2MKg5UCagbr",
            "peerName": "web3-storage-sv15-4",
            "region": null
          }
        ]
      },
      "delegates": []
    },
    {
      "requestId": "817a3ffb-d7ce-4e5b-9a61-d522ce071ea7",
      "status": "pinned",
      "created": "2022-03-29T19:00:54.948+00:00",
      "pin": {
        "cid": "bafkqadjrgy2dqnjyga2diobvge4q",
        "_id": "817a3ffb-d7ce-4e5b-9a61-d522ce071ea7",
        "sourceCid": "bafkqadjrgy2dqnjyga2diobvge4q",
        "contentCid": "bafkqadjrgy2dqnjyga2diobvge4q",
        "authKey": REDACTED,
        "name": null,
        "meta": null,
        "deleted": null,
        "created": "2022-03-29T19:00:54.948+00:00",
        "updated": "2022-03-29T19:00:54.948+00:00",
        "pins": [
          {
            "status": "Pinned",
            "updated": "2022-03-30T22:44:56.649046+00:00",
            "peerId": "12D3KooWJEfH2MB4RsUoaJPogDPRWbFTi8iehsxsqrQpiJwFNDrP",
            "peerName": "web3-storage-dc13-3",
            "region": null
          },
          {
            "status": "Pinned",
            "updated": "2022-03-30T13:45:53.98255+00:00",
            "peerId": "12D3KooWRi18oHN1j8McxS9RMnuibcTwxu6VCTYHyLNH2R14qhTy",
            "peerName": "web3-storage-sv15-3",
            "region": null
          },
          {
            "status": "Pinned",
            "updated": "2022-03-30T19:54:54.839236+00:00",
            "peerId": "12D3KooWQYBPcvxFnnWzPGEx6JuBnrbF1FZq4jTahczuG2teEk1m",
            "peerName": "web3-storage-am6-3",
            "region": null
          }
        ]
      },
      "delegates": []
    },
    {
      "requestId": "52007e1d-a718-4625-b523-9d84db74b0b3",
      "status": "pinned",
      "created": "2022-03-29T18:52:37.675+00:00",
      "pin": {
        "cid": "bafkqadjrgy2dqnjxhe4tkmjtga3a",
        "_id": "52007e1d-a718-4625-b523-9d84db74b0b3",
        "sourceCid": "bafkqadjrgy2dqnjxhe4tkmjtga3a",
        "contentCid": "bafkqadjrgy2dqnjxhe4tkmjtga3a",
        "authKey": REDACTED,
        "name": null,
        "meta": null,
        "deleted": null,
        "created": "2022-03-29T18:52:37.675+00:00",
        "updated": "2022-03-29T18:52:37.675+00:00",
        "pins": [
          {
            "status": "Pinned",
            "updated": "2022-03-30T13:26:26.782542+00:00",
            "peerId": "12D3KooWJEfH2MB4RsUoaJPogDPRWbFTi8iehsxsqrQpiJwFNDrP",
            "peerName": "web3-storage-dc13-3",
            "region": null
          },
          {
            "status": "Pinned",
            "updated": "2022-03-30T16:19:20.628727+00:00",
            "peerId": "12D3KooWRi18oHN1j8McxS9RMnuibcTwxu6VCTYHyLNH2R14qhTy",
            "peerName": "web3-storage-sv15-3",
            "region": null
          },
          {
            "status": "Pinned",
            "updated": "2022-03-31T03:59:37.478391+00:00",
            "peerId": "12D3KooWQYBPcvxFnnWzPGEx6JuBnrbF1FZq4jTahczuG2teEk1m",
            "peerName": "web3-storage-am6-3",
            "region": null
          }
        ]
      },
      "delegates": []
    }
  ]
}
@SgtPooki SgtPooki added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Apr 5, 2022
@dchoi27
Copy link
Contributor

dchoi27 commented Apr 11, 2022

@mbommerez FYI - would be great to do alongside the rest of the PSA cleanup!

@SgtPooki
Copy link
Author

SgtPooki commented May 19, 2022

Can we re-open this until it's deployed on to the web3.storage pinning service endpoint?

#### Response data from https://api.web3.storage/pins

    {
      requestId: '821c1c2b-8be0-4370-8780-09db154163f6',
      status: 'queued',
      created: '2022-05-19T22:10:24.75+00:00',
      pin: {
        cid: 'baeaaadjrgy2teojzhazdemzvga3a',
        _id: '821c1c2b-8be0-4370-8780-09db154163f6',
        sourceCid: 'baeaaadjrgy2teojzhazdemzvga3a',
        contentCid: 'baeaaadjrgy2teojzhazdemzvga3a',
        authKey: 'REDACTED',
        name: null,
        origins: null,
        meta: null,
        deleted: null,
        created: '2022-05-19T22:10:24.75+00:00',
        updated: '2022-05-19T22:10:24.75+00:00',
        pins: [
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWR19qPPiZH4khepNjS3CLXiB7AbrbAD4ZcDjN1UjGUNE1',
            peerName: 'web3-storage-sv15',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWSnniGsyAF663gvHdqhyfJMCjWJv54cGSzcPiEMAfanvU',
            peerName: 'web3-storage-dc13',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWPySxxWQjBgX9Jp6uAHQfVmdq8HG1gVvS1fRawHNSrmqW',
            peerName: 'web3-storage-am6',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWEDMw7oRqQkdCJbyeqS5mUmWGwTp8JJ2tjCzTkHboF6wK',
            peerName: 'web3-storage-sv15-2',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWNuoVEfVLJvU3jWY2zLYjGUaathsecwT19jhByjnbQvkj',
            peerName: 'web3-storage-am6-2',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWKytRAd2ujxhGzaLHKJuje8sVrHXvjGNvHXovpar5KaKQ',
            peerName: 'web3-storage-dc13-2',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWJEfH2MB4RsUoaJPogDPRWbFTi8iehsxsqrQpiJwFNDrP',
            peerName: 'web3-storage-dc13-3',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWRi18oHN1j8McxS9RMnuibcTwxu6VCTYHyLNH2R14qhTy',
            peerName: 'web3-storage-sv15-3',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWQYBPcvxFnnWzPGEx6JuBnrbF1FZq4jTahczuG2teEk1m',
            peerName: 'web3-storage-am6-3',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWDdzN3snjaMJEH9zuq3tjKUFpYHeSGNkiAreF6dQSbCiL',
            peerName: 'web3-storage-am6-4',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWEzCun34s9qpYEnKkG6epx2Ts9oVGRGnzCvM2s2edioLA',
            peerName: 'web3-storage-am6-5',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWHpE5KiQTkqbn8KbU88ZxwJxYJFaqP4mp9Z9bhNPhym9V',
            peerName: 'web3-storage-dc13-4',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWBHvsSSKHeragACma3HUodK5FcPUpXccLu2vHooNsDf9k',
            peerName: 'web3-storage-dc13-5',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWAdxvJCV5KXZ6zveTJmnYGrSzAKuLUKZYkZssLk7UKv4i',
            peerName: 'web3-storage-sv15-5',
            region: null
          },
          {
            status: 'Unpinned',
            updated: '2022-05-19T22:10:24.75+00:00',
            peerId: '12D3KooWKhPb9tSnCqBswVfC5EPE7iSTXhbF4Ywwz2MKg5UCagbr',
            peerName: 'web3-storage-sv15-4',
            region: null
          }
        ]
      },
      delegates: []
    }

#### Response data after being parsed by RemotePinningServiceClient

    {
      requestid: undefined,
      status: 'queued',
      created: 2022-05-19T22:10:24.750Z,
      pin: {
        cid: 'baeaaadjrgy2teojzhazdemzvga3a',
        name: undefined,
        origins: undefined,
        meta: undefined
      },
      delegates: [],
      info: undefined
    }

#### Response - Accepted (202)

##### Headers

    {
      "access-control-allow-origin": "*",
      "access-control-expose-headers": "Link",
      "cf-ray": "70e029913df40871-SEA",
      "connection": "close",
      "content-length": "3081",
      "content-type": "application/json;charset=UTF-8",
      "date": "Thu, 19 May 2022 22:10:25 GMT",
      "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
      "server": "cloudflare",
      "vary": "Accept-Encoding"
    }

@SgtPooki
Copy link
Author

@flea89 @alanshaw ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization topic/psa
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants