Commit graph

8 commits

Author SHA1 Message Date
Ciro S. Costa 7012486a16 source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 15:56:51 -04:00
Ciro S. Costa e78b200d02 add support for rpc auth
example:

	monerod --rpc-login foo:foo  (...)
	monero daemon -u foo -p foo get-version

new flags
	  -p, --password string    password to supply for rpc auth
	  -u, --username string    name of the user to use during rpc auth

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 08:27:44 -04:00
Ciro S. Costa 096ad758c2 source formatting
no behavior changes

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 06:51:24 -04:00
Ciro S. Costa e94f6ae0dd address lint cases
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 20:54:50 -04:00
Ciro S. Costa 2f4faf8d0e cmd: add support for tls
well, `pkg/rpc` in theory already supported tls given that it relies on
an `http.Client` which could already be making use of such proxy, but at
least now we make it configurable to the CLI in a nice way

very command under `monero daemon|wallet` now takes:

	Flags:
	  -a, --address string             full address of the monero node to reach out to (default "http://localhost:18081")
	  -h, --help                       help for daemon
	      --request-timeout duration   how long to wait until considering the request a failure (default 1m0s)
	      --tls-ca-cert string         certificate authority to load
	      --tls-client-cert string     tls client certificate to use when connecting
	      --tls-client-key string      tls client key to use when connecting
	  -k, --tls-skip-verify            skip verification of certificate chain and host name
	  -v, --verbose                    dump http requests and responses to stderr

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 19:59:47 -04:00
Ciro S. Costa 98e24e202d pkg/http: document client constructor
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 11:59:07 -04:00
Ciro S. Costa ce6332cc39 pkg: source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 11:42:51 -04:00
Ciro S. Costa 42d84b912b pkg: unexport methods; cmd: common factory
- there's no reason why we should be exporting those method names, so
  let's unexport them

- with a common factory for creating a deadlined context and client, we
  have to care less about those details inside the commands themselves

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 10:04:11 -04:00