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

Support CID playback URL lookup for assets with IPFS gateway URL #1575

Open
yondonfu opened this issue Jan 3, 2023 · 0 comments
Open

Support CID playback URL lookup for assets with IPFS gateway URL #1575

yondonfu opened this issue Jan 3, 2023 · 0 comments

Comments

@yondonfu
Copy link
Member

yondonfu commented Jan 3, 2023

What's the problem? (required) Describe the problem or need in exactly 1
sentence. Ex. "I'm unable to [...]", or "I am confused by [...]"

If I upload an asset with an IPFS gateway URL, I cannot lookup the playback URL of the asset using a CID.

What's the current behavior? (required) A clear and concise description of
the current behavior of the DApp or package (or lack thereof).

If I upload an asset with the URL ipfs://<CID>, then I can lookup the playback URL using a call to /playback/<CID> because the API will lookup the playback URL for the asset with the upload URL ipfs://<CID> in this function.

If I upload an asset with the URL https://ipfs.io/ipfs/<CID>, then I can not lookup the playback URL using a call to /playback/<CID> because the API will not find this asset with the upload URL ipfs://<CID> since the upload URL will be https://ipfs.io/ipfs/<CID>.

Do you have any personal experiences dealing with this problem? (optional)
Describe your personal experiences related this problem in 1-4 sentences.

The current design looks up playback URLs using ipfs://<CID> because CID playback URL lookup is only supported for assets with the upload URL of ipfs://<CID>. And the original reason for this was to have the API/Catalyst be responsible for downloading the file using a trusted gateway to ensure that the file matches the CID - we wanted to avoid someone uploading with a URL with a CID, but the file downloaded does not match the CID.

Describe a possible solution you've considered (optional) A clear and
concise description of what you want to happen.

We might be able to detect CIDs/IPFS gateway URLs (see example and use CAR retrieval to trustlessly download a file with a CID from a gateway. Perhaps this goes into Catalyst though?

An up-to-date gateway should support CAR responses, but we might need to have a fallback path in case the gateway used does not support CAR responses.

Additional context (optional) Add any other context or screenshots about the
enhancement or feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant