ipfs / infra

Tools and systems for the IPFS community
MIT License
133 stars 41 forks source link

Enable `/api/v0/cid` at ipfs.io #495

Closed lidel closed 4 years ago

lidel commented 4 years ago

We already expose public endpoint for DNSLink lookups: https://ipfs.io/api/v0/dns/docs.ipfs.io

However, there is no endpoint for converting any CID to cidv1base32: https://ipfs.io/api/v0/cid/base32?arg=QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR (returns 404 atm)

Expected result:

$ curl 'http://localhost:5001/api/v0/cid/base32?arg=QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR'
{"CidStr":"QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR","Formatted":"bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi","ErrorMsg":""}

@olizilla Can we unblock /api/v0/cid at the gateway?

olizilla commented 4 years ago

yes we caaaaaan

mburns commented 4 years ago
$ curl -s -X POST 'https://ipfs.io/api/v0/cid/base32?arg=QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR' | jq                                                     fix-ipn.io-redirect
{
  "CidStr": "QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR",
  "Formatted": "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi",
  "ErrorMsg": ""
}

note: this is only enabled on HTTPS, not HTTP.