Skip to content

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

Merged
lidel merged 2 commits intomasterfrom
refactor/read-write-gateway
Feb 2, 2023
Merged

refactor: new go-libipfs/gateway API, deprecate Gateway.Writable#9616
lidel merged 2 commits intomasterfrom
refactor/read-write-gateway

Conversation

@hacdias
Copy link
Copy Markdown
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 force-pushed the refactor/read-write-gateway branch from 5eef1e8 to d4152d6 Compare January 31, 2023 12:36
@hacdias hacdias self-assigned this Jan 31, 2023
@hacdias hacdias force-pushed the refactor/read-write-gateway branch from d4152d6 to ccd1e83 Compare January 31, 2023 12:38
@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 force-pushed the refactor/read-write-gateway branch from 00e7f86 to 6e8f94d Compare January 31, 2023 17:02
@hacdias hacdias changed the title refactor: use minimized API from Gateway feat: use new gateway api from go-libipfs Jan 31, 2023
@hacdias hacdias force-pushed the refactor/read-write-gateway branch from 6e8f94d to 330175a Compare January 31, 2023 17:13
@hacdias hacdias marked this pull request as ready for review January 31, 2023 17:23

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
@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
Copy Markdown
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

3 participants