Skip to content

[feat] Add support for dynamically setting the authorization header in the http logging handler#3624

Open
JimPaine wants to merge 6 commits intoreframe-hpc:developfrom
JimPaine:develop
Open

[feat] Add support for dynamically setting the authorization header in the http logging handler#3624
JimPaine wants to merge 6 commits intoreframe-hpc:developfrom
JimPaine:develop

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.

@vkarak vkarak added this to the ReFrame 4.10 milestone Feb 25, 2026
@vkarak vkarak moved this from Todo to In Progress in ReFrame Backlog Mar 2, 2026
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

Lgtm, I have just minor style comments.

)

if authorization_header is not None and not callable(authorization_header):
raise ConfigError("httpjson: 'authorization_header' is not a callable")
Copy link
Contributor

Choose a reason for hiding this comment

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

You could update the error message here along the lines of the json_formatter above.

Copy link
Author

Choose a reason for hiding this comment

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

@vkarak thank you for the feedback. I have made the formatting changes you suggested and have updated the error handling to to use is_trivially_callable with new error message.

I have used slightly different wording and if you approve, I am happy to (or raise an additional PR to) update the error message for json_formatter and remove the if not callable condition on json_formatter as looking at the utility function is_trivially_callable it handles this condition as well.

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Auth token in extra_headers expires on long running tests

3 participants