Commit Graph

10980 Commits

Author SHA1 Message Date
Chris Beams
5fa7939ec4
Set --password as a required option in JOpt parser 2020-04-26 21:05:22 +02:00
Chris Beams
822e6813f8
Touch up test descriptions and parameter naming 2020-04-26 21:04:06 +02:00
Chris Beams
a3f9faf7ab
Move cli-test.sh => cli/test.sh
- Ensure script runs from root directory regardless of where it is
   invoked from

 - Touch up documentation and whitespace
2020-04-26 20:46:52 +02:00
Chris Beams
ceaf20a161
Clean up whitespace in cli-test.sh 2020-04-26 20:35:09 +02:00
Chris Beams
510e84d30a
Add expect-based cli test suite
Co-authored-by: ghubstan <36207203+ghubstan@users.noreply.github.com>
2020-04-26 20:30:58 +02:00
Chris Beams
b7fda8de5e
Declare channel outside try/catch
No StatusRuntimeException can be thrown from this code, so it is not
necessary to include in the try block.
2020-04-26 19:38:06 +02:00
Chris Beams
0a2aac00d3
Shutdown channel using a JVM shutdown hook
Versus needing to manage calling custom shutdown method in all the right
places.
2020-04-26 19:35:48 +02:00
Chris Beams
e10e29a211
Handle OptionException immediately 2020-04-26 19:32:14 +02:00
ghubstan
dee5e4cf7e
Revert 16c2efc
No need to strip quotes from password.  The problem was a bug
in my expect/tcl script's quote escape syntax.
2020-04-26 10:29:01 -03:00
ghubstan
56f2923ade
Remove redundant text from console err msg
The client was displaying
	Error: UNAUTHENTICATED: incorrect 'password' rpc header value
from the StatusRuntimeException message.

Strip "UNAUTHENTICATED: " from the exception message string before
printing it.
2020-04-25 18:16:23 -03:00
ghubstan
16c2efc8e1
Allow double-quoted multiword apiPassword
Strip double quotes from :cli --password arg before it is passed
to server.  Otherwise, a correct "password" will fail authentication.
2020-04-25 17:52:54 -03:00
Chris Beams
d923d07781
Fix typo in help output 2020-04-25 13:34:32 +02:00
Chris Beams
20f563ae17
Reduce PasswordAuthInterceptor visibility to package-private
And remove unused @Slf4j lombok annotation
2020-04-25 13:32:40 +02:00
Chris Beams
653856f79b
Refactor 'auth*' naming to 'password'
To increase simplicity and make the implementation more
intention-revealing.
2020-04-25 13:28:10 +02:00
Chris Beams
42e9bb1433
Refine help output 2020-04-25 11:31:19 +02:00
Chris Beams
c1931d2fb2
Use 'method' vs 'command' naming 2020-04-25 11:27:19 +02:00
Chris Beams
7bf854c86e
Improve error handling
Fail fast if the specified command is unknown
2020-04-25 11:22:01 +02:00
Chris Beams
c6e5670fbd
Print nested exception error message on connect failure 2020-04-25 10:42:53 +02:00
Chris Beams
b67ad6cd74
Print help text when no command is specified 2020-04-25 10:25:54 +02:00
Chris Beams
423b2ad4ae
Handle OptionException gracefully
When e.g. a given option is not recognized, print a clean error message
and exit 1 as opposed to printing a stack trace.
2020-04-25 10:10:27 +02:00
Chris Beams
0b338bbbea
Rename/repackage bisq.cli.{app.Bisq=>CliMain} 2020-04-25 09:59:22 +02:00
Chris Beams
d19581a089
Reduce AuthHeaderCallCredentials visibility to package-private 2020-04-25 09:55:32 +02:00
Chris Beams
e84123c20a
Refactor auth infrastructure naming 2020-04-25 09:52:50 +02:00
Chris Beams
3fe7848c4e
Use var declarations where appropriate 2020-04-25 08:17:22 +02:00
Chris Beams
04defcb66d
Update comments and console output 2020-04-25 08:17:19 +02:00
Chris Beams
31aed4b082
Simplify implementation to a single main class 2020-04-25 08:16:38 +02:00
Chris Beams
1a133f4b67
Use a single auth token vs username:password
There is actually no use case for both username and password forming the
authentication token. This change simplifies the arrangement such that a
single token is passed.

--rpcUser and --rpcPassword are no longer used and are replaced by
--apiToken on both cli and daemon sides.
2020-04-23 11:32:19 +02:00
Chris Beams
ca0658229b
Rename AuthenticationInterceptor => TokenAuthInterceptor 2020-04-23 11:21:52 +02:00
Chris Beams
24c245c2ea
Polish BisqCallCredentials style
See https://github.com/bisq-network/style/issues/12
2020-04-23 11:21:52 +02:00
Chris Beams
bc88080df1
Simplify implementation of authenticate method 2020-04-23 10:20:28 +02:00
Chris Beams
864bd9a21a
Wrap method parameters according to convention 2020-04-23 10:09:06 +02:00
Chris Beams
6490e97df2
Do not declare local variables as final
Per https://github.com/bisq-network/style/issues/11
2020-04-23 10:03:36 +02:00
Chris Beams
3fba97cefc
Favor final fields declared one per line
Final fields should be favored wherever possible to advertise and
enforce immutability. Also as a matter of style, favor declaring fields
one per line instead of multiple on the same line. This style guideline
is not consistent throughout the codebase, but is favored because it
makes diffs / patches cleaner and is the more widely accepted style
througout most modern Java codebases.
2020-04-23 10:01:23 +02:00
Chris Beams
506e12da46
Inject Config directly into BisqGrpcServer
There is no need or benefit to injecting Config into CoreApi for the
purpose of accessing it indirectly through BisqGrpcServer.
2020-04-23 09:50:08 +02:00
ghubstan
fe9e57babb
Implement simple cleartext gRPC authentication
* Renamed CliCommand to RpcCommand, differentiating it from cmd
   string token(s)

 * Added new CliConfig, based on :common Config

 * Injected Config into CoreApi to make bisq.properties and cmd line
   args available to server

 * Added cleartext username:password BisqCallCredentials to :cli, and
   an AuthenticationInterceptor to :core (server)

 * Moved :daemon resources folder to expected location under src/main

 * Duplicated CompositeOptionSet, ConfigException and BisqException
   in :cli because they are not visible from :common.  (TODO refactor?)
   CompositeOptionSet will be used to let command line parameters
   override params set in config file.

 * Removed outdated references to :cli in a couple of comments in
   :common Config

 * gRPC parameters & command names are lowercase to mimic bitcoind/rpc

TBD

 * Decide what rpc auth param names to use, to differentiate them from
   bitcoind rpc user/passord param names
2020-04-22 18:16:01 -03:00
Christoph Atteneder
590f16d945
Merge pull request #4174 from devinbileck/update-btc-node
Update hostname and IP address of BTC node lva54pnbq2nsmjyr.onion
2020-04-20 11:34:50 +02:00
Christoph Atteneder
4fd8be6b68
Merge pull request #4177 from jmacxx/fix_issue_3709
Display the BSQ amount correctly in issuance log message
2020-04-17 16:45:48 +02:00
jmacxx
f49445ef56
Display the BSQ amount correctly in issuance log message
Fixes #3709.  The issuance log message displayed the issued BSQ
with 2 extra zeros (i.e. sats value).  This was because BSQ is
represented internally within the application as sats, so it has to
be converted by `MathUtils.scaleDownByPowerOf10(amount, 2)`
whenever displayed to the user.
2020-04-16 21:04:21 -05:00
sqrrm
2db90cf132
Merge pull request #4175 from bisq-network/release/v1.3.2
Release/v1.3.2
2020-04-16 16:41:37 +02:00
Christoph Atteneder
1105a78d51
Revert to SNAPSHOT version 2020-04-16 14:25:59 +02:00
Devin Bileck
0d6f7c3d2e
Update hostname and IP address of BTC node lva54pnbq2nsmjyr.onion
I deployed a new instance and as a result have a new IP address. Also,
while I was at it I added it to my bisq.services domain.
2020-04-15 15:47:05 -07:00
Christoph Atteneder
dc692f5749
Merge pull request #4173 from sqrrm/add-donation-address
Add second donation address as valid
2020-04-15 22:01:03 +02:00
sqrrm
26f30b6ec4
Add second donation address as valid 2020-04-15 21:30:50 +02:00
Christoph Atteneder
cfc4705058
Update translations for v1.3.2 2020-04-14 18:08:27 +02:00
Christoph Atteneder
9ce26e6dd4
Update data stores for v1.3.2 2020-04-14 18:06:30 +02:00
sqrrm
0a8b74bec8
Merge pull request #4169 from ripcurlx/update-data-stores-v1.3.2
Update data stores for v1.3.2
2020-04-14 18:01:46 +02:00
Christoph Atteneder
8b75637aed
Update data stores for v1.3.2 2020-04-14 17:38:03 +02:00
ghubstan
be09682435
Replace mock arg with SEPA PaymentMethod instance
Test AccountAgeWitnessServiceTest > testArbitratorSignWitness failed
in full gradle build, but passed when run as a single test:

	./gradlew :core:cleanTest :core:test \
		--tests "bisq.core.account.witness.AccountAgeWitnessServiceTest"

This test also passed when run in the IDE.

Solved by not passing a mocked PaymentMethod.SEPA argument into the
test's service.getTraderPaymentAccounts() method, where mock paymentId
field was null when running full build's test suites.

Fix for #4158
2020-04-13 11:46:35 +02:00
Christoph Atteneder
e4ae28e052
Merge pull request #4161 from ghubstan/fix-4158
Replace mock arg with SEPA PaymentMethod instance
2020-04-13 11:46:01 +02:00
sqrrm
1a1f71a0a7
Change command line argument default 2020-04-13 11:38:30 +02:00