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 POST-only HTTP API #1429

Closed
1 task done
lidel opened this issue Apr 4, 2020 · 1 comment · Fixed by #1430
Closed
1 task done

Support POST-only HTTP API #1429

lidel opened this issue Apr 4, 2020 · 1 comment · Fixed by #1430
Assignees
Labels
effort/hours Estimated to take one or several hours kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/triage Needs initial labeling and prioritization P0 Critical: Tackled by core team ASAP status/in-progress In progress

Comments

@lidel
Copy link
Member

lidel commented Apr 4, 2020

PR at ipfs/kubo#7097 will block GET on /api/v0 on API port.

Seems that we need to fix ipfs-webui and release a new version so mentioned PR can be merged.

cc @hsanjuan @Stebalien

Known problems

@lidel lidel added status/in-progress In progress P0 Critical: Tackled by core team ASAP need/triage Needs initial labeling and prioritization kind/maintenance Work required to avoid breaking changes or harm to project's status quo effort/hours Estimated to take one or several hours labels Apr 4, 2020
@lidel lidel self-assigned this Apr 4, 2020
@lidel
Copy link
Member Author

lidel commented Apr 4, 2020

ipfs-webui uses ipfs-redux-bundle v6.0.1 which depends on old js-ipfs-http-client v39.0.2

This is pretty bad news, as fixing it means we need to update HTTP client to the latest version (ipfs-http-client@43.0.0), which brings breaking changes made in 41.x all over the JS API: https://blog.ipfs.io/2020-02-13-js-ipfs-0-41/

I'll jump into this for an hour or two and re-evaluate if its more than that.


Sidenote: While ls is the only problem for webui, everyone using older version may stumble uppon issues when using cat get refs/local pubsub/peers pubsub/ls config/profile/list

$ rg "ky.get" v39.0.2/src

src/cat.js
23:    const res = await ky.get('cat', {

src/files-regular/refs.js
52:    const res = await ky.get('refs', {

src/files-regular/get.js
39:    const res = await ky.get('get', {

src/files-regular/refs-local.js
12:    const res = await ky.get('refs/local', {

src/files-regular/ls.js
34:    const res = await ky.get('ls', {

src/pubsub/peers.js
17:    const { Strings } = await ky.get('pubsub/peers', {

src/pubsub/ls.js
9:    const { Strings } = await ky.get('pubsub/ls', {

src/config/profiles/list.js
11:    const res = await ky.get('config/profile/list', {

I believe we should not invest time in fixing that – everyone should upgrade to async iterables version of JS API (js-ipfs-http-client >=41.x)

lidel added a commit to ipfs-inactive/ipfs-redux-bundle that referenced this issue Apr 4, 2020
ipfs/kubo#7097 will block `GET` commands on
API port, switching everything to POST.

This breaks Files screen in ipfs-webui as noted in
ipfs/ipfs-webui#1429

ipfs-webui is using older version of js-ipfs-http-client, one before
huge refactor into async iterables, which means switching to the latest
version won't be a trivial task.

For now, we just apply simple patch on top of ipfs-http-client v39.0.2
to ensure it sends commands as POST.

Proper fix will land when ipfs-webui is refactored to work with
ipfs-http-client >41.x

Closes #1429
lidel added a commit that referenced this issue Apr 4, 2020
ipfs/kubo#7097 will block `GET` commands on
API port, switching everything to POST.

This breaks Files screen in ipfs-webui as noted in
#1429

ipfs-webui is using older version of js-ipfs-http-client, one before
huge refactor into async iterables, which means switching to the latest
version won't be a trivial task.

For now, we just apply simple patch on top of ipfs-http-client v39.0.2
to ensure it sends commands as POST.

Proper fix will land when ipfs-webui is refactored to work with
ipfs-http-client >41.x

Closes #1429
lidel added a commit that referenced this issue Apr 4, 2020
* fix: support POST-only HTTP API

ipfs/kubo#7097 will block `GET` commands on
API port, switching everything to POST.

This breaks Files screen in ipfs-webui as noted in
#1429

ipfs-webui is using older version of js-ipfs-http-client, one before
huge refactor into async iterables, which means switching to the latest
version won't be a trivial task.

For now, we just apply simple patch on top of ipfs-http-client v39.0.2
to ensure it sends commands as POST.

Proper fix will land when ipfs-webui is refactored to work with
ipfs-http-client >41.x

Closes #1429

* docs: remove GET from CORS setup for API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/triage Needs initial labeling and prioritization P0 Critical: Tackled by core team ASAP status/in-progress In progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant