RangerMauve / js-ipfs-fetch

Use the same `fetch()` API browsers provide for HTTP, but for IPFS
https://youtu.be/kI9Issf3MNc?t=1606
MIT License
65 stars 8 forks source link

Figure out how to import keys using PEM format #8

Open RangerMauve opened 2 years ago

RangerMauve commented 2 years ago

Based on work in the IPFS gateway

RangerMauve commented 2 years ago

On approach that's based on what @resession in bt-fetch is to specify the key info inside the authorization header when performing the POST or PUT request.

RangerMauve commented 2 years ago

Some other thoughts. At the moment we generate keys using POST ipns://localhost?key=whatever. Maybe this could be extended with having the PEM data inside the body?

Would also be good to think about how to export. Maybe GET ipns://localhost?key=whatever&format=pem or specifying something in the Accept header? Might be good to put this behind a user prompt to make it harder for malicious websites to steal your keys.