Merge pull request #10816 from accumulator/qml_auth_log_improvement
What changed, and why it matters
This commit is a minor logging cleanup in the mobile/QML authentication helper. It changes the wording and placement of debug/error log messages so they reveal the function name only after safely retrieving it, and avoids logging a raw tuple that could contain sensitive arguments. There is no security fix, behavior change, or vulnerability patch here.
No action required. Treat as routine code-quality/logging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In electrum/gui/qml/auth.py, authProceed() and authCancel() were refactored to move logging statements after unpacking auth_fcall, use func.__name instead of str(tuple), and add a reject= log line. The functional flow (call func, call reject handler, delete __auth_fcall, re-raise exceptions) is unchanged. No input validation, authorization logic, or cryptographic code was modified.
Changed components
electrum/gui/qml/auth.pyInspect captured patch +4 / −4
### electrum/gui/qml/auth.py
@@ -39,14 +39,13 @@ class AuthMixin:
@pyqtSlot()
def authProceed(self):
- self._auth_logger.debug('Proceeding with authed fn()')
try:
- self._auth_logger.debug(str(getattr(self, '__auth_fcall')))
(func, args, kwargs, reject) = getattr(self, '__auth_fcall')
+ self._auth_logger.debug(f'Proceeding with authed func={func.__name__}')
r = func(self, *args, **kwargs)
return r
except Exception as e:
- self._auth_logger.error(f'Error executing wrapped fn(): {repr(e)}')
+ self._auth_logger.error(f'Error executing wrapped function: {repr(e)}')
raise e
finally:
delattr(self, '__auth_fcall')
@@ -61,11 +60,12 @@ def authCancel(self):
(func, args, kwargs, reject) = getattr(self, '__auth_fcall')
if reject is not None:
if hasattr(self, reject):
+ self._auth_logger.debug(f'reject={reject}')
getattr(self, reject)()
else:
self._auth_logger.error(f'Reject method "{reject}" not defined')
except Exception as e:
- self._auth_logger.error(f'Error executing reject function "{reject}": {repr(e)}')
+ self._auth_logger.error(f'Error executing reject function: {repr(e)}')
raise e
finally:
delattr(self, '__auth_fcall')Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.