-
Notifications
You must be signed in to change notification settings - Fork 148
Audit: auth.py exception cascade -- 15 clauses need security-aware review #935
Copy link
Copy link
Open
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).priority/lowAccepted but not time-sensitiveAccepted but not time-sensitivequalitysecurityDeprecated: use theme/security. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use theme/security. Kept for issue history; will be removed in milestone 0.10.0.status/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/refactorInternal restructure, no behavior change.Internal restructure, no behavior change.
Milestone
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).priority/lowAccepted but not time-sensitiveAccepted but not time-sensitivequalitysecurityDeprecated: use theme/security. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use theme/security. Kept for issue history; will be removed in milestone 0.10.0.status/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/refactorInternal restructure, no behavior change.Internal restructure, no behavior change.
Type
Projects
Status
Todo
Summary
src/apm_cli/core/auth.pycontains 15 exception handler clauses in a security-critical authentication cascade. Several handlers silently swallow exceptions, which can mask credential resolution failures and make debugging authentication issues extremely difficult.Context
Identified during Round 2 of the APM codebase quality audit (PR #918 discussion). The Python Architect and APM CEO agreed this requires a dedicated Auth Expert review due to the security sensitivity of the code.
What needs review
except Exception: passhandlers hide credential resolution failures from users and logsExceptionwhere more specific types (e.g.,FileNotFoundError,subprocess.CalledProcessError) would be appropriatelogger.debug()trace to help users diagnose auth failuresRecommended approach
logger.debug()to every exception handler so--verbosereveals the credential resolution pathexcept Exceptionto the specific exception types each block can actually raiseLabels
This is an internal quality improvement with no user-facing behaviour change (except better
--verboseoutput).Related