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

fix: multibase in pubsub http rpc #8183

Merged
merged 17 commits into from
Nov 29, 2021

Commits on Oct 25, 2021

  1. multibase encoding on pubsub

    Cory Schwartz authored and lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    a6ffb28 View commit details
    Browse the repository at this point in the history
  2. emit multibase for json clients

    Cory Schwartz authored and lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    fce6413 View commit details
    Browse the repository at this point in the history
  3. Update core/commands/pubsub.go

    Co-authored-by: Marcin Rataj <lidel@lidel.org>
    Cory Schwartz and lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    a663e78 View commit details
    Browse the repository at this point in the history
  4. refactor(pubsub): base64url for all URL args

    This makes it easier to reason about.
    Also added better helptext to each command explaining how the binary
    data is encoded on the wire, and how to process it in userland.
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    d075dd6 View commit details
    Browse the repository at this point in the history
  5. refactor: remove ndpayload and lenpayload

    Those output formats are undocumented and seem to be only used in tests.
    This change removes their implementation and replaces it with error
    message to use JSON instead.
    
    I also refactored tests to test the --enc=json response format instead
    of imaginary one, making tests more useful as they also act as
    regression tests for HTTP RPC.
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    82a0a95 View commit details
    Browse the repository at this point in the history
  6. test(pubsub): go-ipfs-api

    Testing against compatible version from
    ipfs/go-ipfs-api#255
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    d4f80fb View commit details
    Browse the repository at this point in the history
  7. refactor: safeTextListEncoder

    Making it clear what it does and why
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    7afd125 View commit details
    Browse the repository at this point in the history
  8. refactor(pubsub): unify peerids

    This ensures `ipfs pubsub sub` returns the same peerids in the `From`
    field as `ipfs pubsub peers`.
    
    libp2p already uses base encoding, no need to double wrap or use custom
    multibase.
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    31b3541 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5bd282d View commit details
    Browse the repository at this point in the history
  10. refactor(pubsub): make pub command read from a file

    We want to send payload in the body as multipart so users can use
    existing tools like curl for publishing arbitrary bytes to a topic.
    
    StringArg was created for "one message per line" use case, and if data
    has `\n` or `\r\n` byte sequences, it will cause payload to be split. It
    is not possible to undo this, because mentioned sequences are lost, so
    we are not able to tell if it was `\n` or `\r\n`
    
    We already avoid this problem in `block put` and `dht put` by reading
    payload via FileArg which does not mangle binary data and send it as-is.
    It feel like `pubsub pub` should be using it in the first place anyway,
    so this commit replaces StringArg with FileArg.
    
    This also closes ipfs#8454
    and makes rpc in go-ipfs easier to code against.
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    e426088 View commit details
    Browse the repository at this point in the history
  11. test(pubsub): publishing with line breaks

    Making sure we don't see regressions in the future.
    Ref. ipfs#7939
    lidel committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    84e0eb1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    153697d View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2021

  1. test: t0322-pubsub-http-rpc.sh

    - Adds HTTP RPC regression test that ensures topic is encoded as URL-safe
      multibase.
    - Moves pubsub tests to live in unique range ./t032x
    lidel committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    8c77377 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2021

  1. Configuration menu
    Copy the full SHA
    e3118b6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9955071 View commit details
    Browse the repository at this point in the history
  3. fix(ci): js-ipfs with fixed pubsub wire format

    uses js-ipfs from
    ipfs/js-ipfs#3922
    lidel authored Nov 29, 2021
    Configuration menu
    Copy the full SHA
    582eaf1 View commit details
    Browse the repository at this point in the history
  4. docs: grammar fixes

    aschmahmann authored Nov 29, 2021
    Configuration menu
    Copy the full SHA
    1a8d771 View commit details
    Browse the repository at this point in the history