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

refactor: new go-libipfs/gateway API, deprecate Gateway.Writable #9616

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Jan 31, 2023

This PR updates the Gateway code to use the newer interface from go-libipfs (ipfs/boxo#145).

@hacdias hacdias self-assigned this Jan 31, 2023
@hacdias hacdias marked this pull request as ready for review January 31, 2023 12:52
@hacdias hacdias requested a review from lidel as a code owner January 31, 2023 12:52
@hacdias hacdias marked this pull request as draft January 31, 2023 15:58
@hacdias hacdias changed the title refactor: use minimized API from Gateway feat: use new gateway api from go-libipfs Jan 31, 2023
@hacdias hacdias marked this pull request as ready for review January 31, 2023 17:23
cmd/ipfs/daemon.go Outdated Show resolved Hide resolved

i.addUserHeaders(w) // ok, _now_ write user's headers.
w.Header().Set("IPFS-Hash", p.Cid().String())
log.Debugw("CID created, http redirect", "from", r.URL, "to", p, "status", http.StatusCreated)

Check failure

Code scanning / CodeQL

Log entries created from user input

This log entry depends on a [user-provided value](1).
w.Header().Set("IPFS-Hash", newcid.String())

redirectURL := gopath.Join(ipfsPathPrefix, newcid.String(), newPath)
log.Debugw("CID replaced, redirect", "from", r.URL, "to", redirectURL, "status", http.StatusCreated)

Check failure

Code scanning / CodeQL

Log entries created from user input

This log entry depends on a [user-provided value](1).
@hacdias hacdias changed the title feat: use new gateway api from go-libipfs feat: use new gateway api from go-libipfs, deprecate writable gateway Feb 1, 2023
@hacdias hacdias force-pushed the refactor/read-write-gateway branch 3 times, most recently from 7e03f4c to 72cf86c Compare February 1, 2023 09:07
@hacdias hacdias requested a review from lidel February 1, 2023 09:25
cmd/ipfs/daemon.go Outdated Show resolved Hide resolved
config/gateway.go Outdated Show resolved Hide resolved
docs/config.md Outdated Show resolved Hide resolved
cmd/ipfs/daemon.go Outdated Show resolved Hide resolved
@lidel lidel force-pushed the refactor/read-write-gateway branch from 497b038 to f97dfb8 Compare February 2, 2023 00:42
@lidel lidel changed the title feat: use new gateway api from go-libipfs, deprecate writable gateway refactor: new go-libipfs/gateway API, deprecate Gateway.Writable Feb 2, 2023
@lidel lidel force-pushed the refactor/read-write-gateway branch from f97dfb8 to 82db057 Compare February 2, 2023 01:09
@lidel lidel force-pushed the refactor/read-write-gateway branch from 82db057 to 3eb0053 Compare February 2, 2023 01:11
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, merged ipfs/boxo#145 rebased and added some deprecation docs pointing people at ipfs/specs#375 (if they care).

(security warnings above are triggered by Gateway.Writable code that was moved out and back, not a blocker)

@lidel lidel force-pushed the refactor/read-write-gateway branch from 3eb0053 to 2a8c524 Compare February 2, 2023 01:17
@lidel lidel merged commit 14649aa into master Feb 2, 2023
@lidel lidel deleted the refactor/read-write-gateway branch February 2, 2023 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Deprecate Gateway.Writable in Kubo 0.19
2 participants