Commit graph

15 commits

Author SHA1 Message Date
DataHoarder b6ca970f30
Change project name 2022-10-05 09:40:23 +02:00
Ciro S. Costa 45b42a1fae source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 17:22:57 -04:00
Ciro S. Costa 87083cf533 remove unecessary status code println
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 17:15:29 -04:00
Ciro S. Costa 564d426f3a source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 16:48:09 -04:00
Ciro S. Costa 2136abc313 fix non-verbose auth-based requests
it turns out that the server implementation relies on the clients doing
the whole auth flow over the same connection, but `go` will only let you
reuse a given tcp connection if you've completely drained the response's
body (which `--verbose` ends up doing, despite copying everythign back
to a new reader).

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 16:46:40 -04:00
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 9536d945b0 pkg/http: remove non-monero auth details
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 08:38:58 -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 e6bc54f872 use cobra for cmds; refactor rpc to support wallet
- using `cobra` for sake of better organization when it comes to command
hierarchy

- splitting `rpc` into `daemon` and `wallet` so we can start thinking of
monero-wallet-rpc support

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-10 20:29:16 -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