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

feat(gateway): redirect ipns b58mh to cid #236

Merged
merged 1 commit into from
May 16, 2023
Merged

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Mar 30, 2023

Closes ipfs/kubo#9749. Redirects base58 encoded peer IDs to CID under the /ipns namespace.

Sharness will fail here. Kubo PR: ipfs/kubo#9785

@hacdias hacdias requested a review from lidel as a code owner March 30, 2023 12:44
@hacdias hacdias self-assigned this Mar 30, 2023
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #236 (4bb1a26) into main (dc731ca) will decrease coverage by 0.21%.
The diff coverage is 65.71%.

❗ Current head 4bb1a26 differs from pull request most recent head c3d3dde. Consider uploading reports for the commit c3d3dde to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   48.02%   47.82%   -0.21%     
==========================================
  Files         279      273       -6     
  Lines       33439    33221     -218     
==========================================
- Hits        16059    15887     -172     
+ Misses      15694    15646      -48     
- Partials     1686     1688       +2     
Impacted Files Coverage Δ
gateway/handler.go 57.00% <65.71%> (+0.60%) ⬆️

... and 23 files with indirect coverage changes

@hacdias hacdias requested a review from a team as a code owner March 30, 2023 13:27
@hacdias hacdias marked this pull request as draft March 30, 2023 13:58
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 3 times, most recently from dd34f67 to 55d1258 Compare March 30, 2023 14:04
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 5 times, most recently from 1d1d52d to d8d1f54 Compare March 31, 2023 13:48
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 2 times, most recently from b25da2d to 8891a97 Compare March 31, 2023 13:56
@hacdias hacdias marked this pull request as ready for review March 31, 2023 14:05
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 2 times, most recently from e8b153e to 2ce2c08 Compare April 3, 2023 08:39
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 2 times, most recently from e9cb71d to 0eb11f1 Compare April 5, 2023 08:20
.github/workflows/gateway-sharness.yml Outdated Show resolved Hide resolved
gateway/handler.go Outdated Show resolved Hide resolved
gateway/handler.go Outdated Show resolved Hide resolved
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 2 times, most recently from 4db0e2c to e776521 Compare April 6, 2023 08:18
@hacdias
Copy link
Member Author

hacdias commented Apr 6, 2023

@lidel I updated to use peer.Decode as you asked, but please note that we will be executing this for more cases than before, that is, we will also be executing peer.Decode for Peer IDs that are already CIDv1s. Then, we compare with what we already have and only redirect if they don't match. I also moved the testing to the Kubo PR.

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.

Thanks, I think normalization to base36 reduces confusion (IPNS Names always looking the same).

Good for now, I think we will improve it further when we have time for productizing boxo/ipns as part of ipfs/specs#376.

(not merging yet, as I want to check other PRs and merge in least painful order)

gateway/handler.go Outdated Show resolved Hide resolved
gateway/handler.go Outdated Show resolved Hide resolved
gateway/handler.go Show resolved Hide resolved
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 2 times, most recently from 210ccaa to 19eb6b2 Compare April 25, 2023 08:57
@hacdias hacdias requested a review from lidel May 2, 2023 12:05
@hacdias hacdias force-pushed the gw/redirect-m58b-ipns branch 2 times, most recently from 7bcc0e6 to 603bdfe Compare May 4, 2023 09:51
@hacdias hacdias requested a review from Jorropo May 4, 2023 09:51
@lidel lidel self-assigned this May 11, 2023
@lidel lidel merged commit 5e94b9d into main May 16, 2023
@lidel lidel deleted the gw/redirect-m58b-ipns branch May 16, 2023 10:27
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.

Gateway support for signed IPNS records doesn't work with raw base58 PeerIDs
2 participants