functional_tests: test HTTP digest auth

Test:
  1. Can't login to RPC server with --rpc-login enabled, but no auth provided
  2. Can access RPC server with correct login
  3. Can use internal HTTP client to access RPC server with correct login

With commit 0ae5c91e50 not reverted, we fail test 3.
This commit is contained in:
jeffro256 2024-03-11 23:39:04 -05:00
parent 1bec71279e
commit 8e80585ef5
No known key found for this signature in database
GPG key ID: 6F79797A6E392442
5 changed files with 135 additions and 17 deletions

View file

@ -33,10 +33,11 @@ from .rpc import JSONRPC
class Wallet(object):
def __init__(self, protocol='http', host='127.0.0.1', port=0, idx=0):
def __init__(self, protocol='http', host='127.0.0.1', port=0, idx=0, username=None, password=None):
self.host = host
self.port = port
self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port if port else 18090+idx))
self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host,
port=port if port else 18090+idx), username, password)
def transfer(self, destinations, account_index = 0, subaddr_indices = [], priority = 0, ring_size = 0, unlock_time = 0, payment_id = '', get_tx_key = True, do_not_relay = False, get_tx_hex = False, get_tx_metadata = False, subtract_fee_from_outputs = []):
transfer = {