Skip to content

Log PatronAuthResult details on server-side validation failure#3145

Merged
jonathangreen merged 1 commit intomainfrom
feature/log-patron-auth-result-on-validation-failure
Mar 18, 2026
Merged

Log PatronAuthResult details on server-side validation failure#3145
jonathangreen merged 1 commit intomainfrom
feature/log-patron-auth-result-on-validation-failure

Conversation

@jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Mar 17, 2026

Description

When server_side_validation() fails in BasicAuthenticationProvider.authenticate(), the PatronAuthResult object contains the failure reason but previously None was returned with no logging. This change captures the result and logs the failure details at INFO level.

Motivation and Context

This would have helped while troubleshooting CM authentication errors (see slack thread). The PatronAuthResult.details field contains the specific failure reason (e.g., regex mismatch), but it was being silently discarded, making it difficult to diagnose patron authentication issues in production.

How Has This Been Tested?

  • Ran tests

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

When server_side_validation() fails, the PatronAuthResult contains the
failure reason but was previously discarded. Now capture and log the
result details at INFO level to aid debugging authentication issues.
@jonathangreen jonathangreen added the feature New feature label Mar 17, 2026
@jonathangreen jonathangreen requested a review from a team March 17, 2026 17:54
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.26%. Comparing base (60760e8) to head (b80a5ae).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3145   +/-   ##
=======================================
  Coverage   93.26%   93.26%           
=======================================
  Files         493      493           
  Lines       45579    45581    +2     
  Branches     6252     6252           
=======================================
+ Hits        42511    42513    +2     
  Misses       1982     1982           
  Partials     1086     1086           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

@jonathangreen jonathangreen merged commit f59ec8b into main Mar 18, 2026
20 checks passed
@jonathangreen jonathangreen deleted the feature/log-patron-auth-result-on-validation-failure branch March 18, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants