feat(libp2phttp): More ergonomic auth#3188
Merged
Merged
Conversation
sukunrt
approved these changes
Feb 24, 2025
Comment on lines
+582
to
+583
| // Include after path since it may include other relevant parts (/p2p?) | ||
| if afterPath != nil { | ||
| withNewPath = withNewPath.Encapsulate(afterPath) | ||
| } |
Member
There was a problem hiding this comment.
NIT:
I think the /p2p bit in the comment is wrong, as the spec says p2p must come before:
https://github.com/multiformats/multiaddr/blob/master/protocols/http-path.md?plain=1#L27
But the logic seems okay.
Collaborator
Author
There was a problem hiding this comment.
Thanks. Looking at this method, it isn't handling relative uris properly. I'll
fix it now.
Member
|
Can you add some detail to the PR description for the change. Would be nice to be able to git blame and see what's happening. |
Auth is now more uniform across HTTP and stream transports.
1828d07 to
451a39b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auth is now uniform across HTTP and stream transports and easier to use. See
ExampleHost_authenticatedHTTPfor an example. This will also show up in the docs page.Adds:
ServerPeerID()function to get a server's peer id from an*http.Response. Used by clients.ClientPeerID()function to get a client's peer id from an*http.Request. Used by servers.ServerPeerIDAuthandClientPeerIDAuthfields in the http.Host struct, to specify the key used to authenticate.