go-bitswap
go-bitswap copied to clipboard
[experiment] authentication tokens
Not much to see here, just a stab at what it might look like to have authentication in Bitswap. Very not production ready.
Is this orthogonal or an alternative to the idea to put this into Protocol Select?
Is this orthogonal or an alternative to the idea to put this into Protocol Select?
Perhaps orthogonal, there are lots of ways to do auth. In this case putting auth into Protocol Select means Bitswap mechanics would need to change to have a new stream per auth token/channel which depending on the design may/may not be excessive/problematic.
I suspect if we had a nice design for negotiating per-stream auth that protocols would attempt to use it before designing something more special cased.
Some tricky areas here that might cause necessitate more than stream based auth include:
- What if I need lots of auth tokens? I lose any efficiencies from bundling up wantlists.
- What if I want to download a block and could use multiple tokens to do so? Should the client just pick one to use, send duplicate requests, or something else? This might be made easier or more efficient if the requests came together.
- Could I run into stream limits if I'm a proxy making thousands of requests with different auth tokens for others?
Does this still match the current spec work? is there an alternative version of auth that's available in the current bitswap?
This repository has been moved to https://github.com/ipfs/go-libipfs. There is not an easy way to transfer PRs, so if you would like to continue with this PR then please re-open it in the new repository and link to this PR.