From e8c4f5e8798ca9336532395371305b39fa451b07 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Tue, 23 Sep 2025 08:43:09 -0400 Subject: [PATCH] Add base URL to Digest auth password manager Small fix to help urllib match credentials correctly by adding both the full RPC URL and base URL to the password manager. This may resolve Digest authentication issues with Monero wallet RPC. --- make_post_sell/lib/crypto_clients.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/make_post_sell/lib/crypto_clients.py b/make_post_sell/lib/crypto_clients.py index 0978f77..6fe9f14 100644 --- a/make_post_sell/lib/crypto_clients.py +++ b/make_post_sell/lib/crypto_clients.py @@ -45,7 +45,12 @@ class MoneroClient: if self.rpc_user and self.rpc_pass: # Create a password manager for Digest auth password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() + # Add password for both the full URL and just the base URL password_mgr.add_password(None, self.rpc_url, self.rpc_user, self.rpc_pass) + from urllib.parse import urlparse + parsed = urlparse(self.rpc_url) + base_url = f"{parsed.scheme}://{parsed.netloc}" + password_mgr.add_password(None, base_url, self.rpc_user, self.rpc_pass) # Create the Digest auth handler auth_handler = urllib.request.HTTPDigestAuthHandler(password_mgr)