Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

HTTPError: file argument 'key' is required when using go-ipfs node with ipfs-http-client #3547

Closed
SahidMiller opened this issue Jan 23, 2021 · 6 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) kind/wontfix status/ready Ready to be worked

Comments

@SahidMiller
Copy link

Version information:

go-ipfs version: 0.7.0
Repo version: 10
System version: amd64/windows
Golang version: go1.14.4

Description:

There's an incompatibility with ipfs-http-client key import using pem and password resulting in an HTTPError: file argument 'key' is required

Steps to reproduce the error:

    const ipfsClient = require('ipfs-http-client')
    const ipfs = ipfsClient(await ipfsClient({
	url: __REMOTE_API_ADDRESS__, //Connect with go-ipfs node
	agent: ...
    })
    const key = await crypto.keys.generateKeyPair('rsa', 2048)
    const pem = await key.export("temppassword")
    const { id } = await ipfs.key.import(keyName, pem, "temppassword")
@Stebalien Stebalien transferred this issue from ipfs/kubo Feb 12, 2021
@welcome
Copy link

welcome bot commented Feb 12, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Feb 12, 2021
@ipfs ipfs deleted a comment from welcome bot Feb 12, 2021
@Stebalien
Copy link
Member

This appears to be an incompatibility between the js-ipfs HTTP API and the go-ipfs HTTP API.

@achingbrain
Copy link
Member

In a bit more detail, js-IPFS accepts the key as a query string argument, go-IPFS accepts it in the body of the POST request.

The http client sends it in the query string as I think it may have been done in js-IPFS first as the interface tests for the import operation are skipped for go-IPFS, the note says 'TODO not implemented in go-ipfs yet'.

It looks like it's been implemented, and implemented differently - js-IPFS should probably align with go-IPFS here.

@BigLep BigLep added the status/ready Ready to be worked label Mar 22, 2021
@BigLep
Copy link
Contributor

BigLep commented Mar 22, 2021

When this gets picked up, we should be using POST per verbal conversation on 2021-03-22 with @Stebalien and @achingbrain .

@Rinse12
Copy link

Rinse12 commented Apr 16, 2022

Are there any updates regarding this issue? It has been over a year

@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see #4336).

We won't be addressing this issue in ipfs-http-client, but you should look at kubo-rpc-client for handling this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws) kind/wontfix status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants