Skip to content

Conversation

@JimPaine
Copy link

@JimPaine JimPaine commented Feb 4, 2026

Enables the use of short lived tokens where http services use flows such as client credentials by allowing the authorization header to be set dynamically via a callable which is evaluated at the point the http request is made.

Closes #3622

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.64%. Comparing base (a6b2619) to head (6bc89d6).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3624      +/-   ##
===========================================
+ Coverage    91.39%   91.64%   +0.24%     
===========================================
  Files           62       62              
  Lines        13520    13526       +6     
===========================================
+ Hits         12357    12396      +39     
+ Misses        1163     1130      -33     

☔ 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.

"it must be 'json_formatter(record, extras, ignore_keys)'"
)

if authorization_header is not None and not callable(authorization_header):
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this idea of having a dedicated authorization_header and I have the impression one needs it because one cannot pass a callable to the extra_headers. Have you considered passing a callable to extra_headers instead of having the dedicated authorization_header?

Copy link
Author

@JimPaine JimPaine Feb 12, 2026

Choose a reason for hiding this comment

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

I did think about this and happy to take a second look.

My initial thoughts were:

  • extra_headers are expected to be strings and mapped as such in the init method.
  • We could move this logic to the emit method with a condition to check the type of each item in extra_headers
  • This would make it more flexible, allowing any header to be dynamically set just before making the HTTP request
  • I prefer things to be implicit
  • Handling of types within extra_headers potentially adds complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Auth token in extra_headers expires on long running tests

3 participants