[bisq-network/bisq] Refactor rpc server implementation (#4199)

Chris Beams notifications at github.com
Mon Apr 27 18:07:18 UTC 2020


This PR implements a number of refactorings and a couple minor substantive changes that I've been meaning to get to since @chimp1984's original PoC in #3888.

The substantive changes include:

 - Removing the `stopServer` method (until a clear use case for it emerges)
 - Adding an `--apiPort` configuration option to avoid hardcoding the 9998 port

Otherwise these are pure refactorings that make the implementation of GrpcServer more idiomatic and hopefully easier to contribute to going forward, e.g. in the PR that will come together to resolve #4198.

Note that this PR builds atop the commits in the as-yet unmerged PR #4189. The commits specific to this PR begin with 01580ae36 ("Remove StopServer rpc method"). In any case, **PR #4189 should be merged before this one.**
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4199

-- Commit Summary --

  * Implement simple cleartext gRPC authentication
  * Inject Config directly into BisqGrpcServer
  * Favor final fields declared one per line
  * Do not declare local variables as final
  * Wrap method parameters according to convention
  * Simplify implementation of authenticate method
  * Polish BisqCallCredentials style
  * Rename AuthenticationInterceptor => TokenAuthInterceptor
  * Use a single auth token vs username:password
  * Simplify implementation to a single main class
  * Update comments and console output
  * Use var declarations where appropriate
  * Refactor auth infrastructure naming
  * Reduce AuthHeaderCallCredentials visibility to package-private
  * Rename/repackage bisq.cli.{app.Bisq=>CliMain}
  * Handle OptionException gracefully
  * Print help text when no command is specified
  * Print nested exception error message on connect failure
  * Improve error handling
  * Use 'method' vs 'command' naming
  * Refine help output
  * Refactor 'auth*' naming to 'password'
  * Reduce PasswordAuthInterceptor visibility to package-private
  * Fix typo in help output
  * Allow double-quoted multiword apiPassword
  * Remove redundant text from console err msg
  * Revert 16c2efc
  * Handle OptionException immediately
  * Shutdown channel using a JVM shutdown hook
  * Declare channel outside try/catch
  * Add expect-based cli test suite
  * Clean up whitespace in cli-test.sh
  * Move cli-test.sh => cli/test.sh
  * Touch up test descriptions and parameter naming
  * Set --password as a required option in JOpt parser
  * Update cli/test.sh instructions
  * Add comment explaining exception message mangling
  * Touch up help output
  * Revert marking password as required in JOpt parser
  * Remove note to self
  * Remove StopServer rpc method
  * Remove section comments from BisqGrpcServer
  * Eliminate static fields in BisqGrpcServer
  * Sort static inner classes at bottom
  * Rename gRPC service classes from *{Impl=>Service}
  * Make gRPC service classes non-static
  * Use var declarations where appropriate
  * Rename BisqGrpcServer => GrpcServer
  * Refine GrpcServer log output
  * Add 'apiPort' configuration option

-- File Changes --

    M build.gradle (2)
    A cli/src/main/java/bisq/cli/CliMain.java (189)
    A cli/src/main/java/bisq/cli/PasswordCallCredentials.java (45)
    D cli/src/main/java/bisq/cli/app/BisqCliMain.java (116)
    D cli/src/main/java/bisq/cli/app/CliCommand.java (66)
    D cli/src/main/java/bisq/cli/app/CommandParser.java (27)
    A cli/test.sh (156)
    M common/src/main/java/bisq/common/config/Config.java (21)
    R core/src/main/java/bisq/core/grpc/GrpcServer.java (144)
    A core/src/main/java/bisq/core/grpc/PasswordAuthInterceptor.java (45)
    M daemon/src/main/java/bisq/daemon/app/BisqDaemonMain.java (4)
    R daemon/src/main/resources/logback.xml (0)
    M proto/src/main/proto/grpc.proto (15)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4199.patch
https://github.com/bisq-network/bisq/pull/4199.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4199
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200427/134b56a8/attachment.html>


More information about the bisq-github mailing list