[feat] Add support for dynamically setting the authorization header in the http logging handler#3624
[feat] Add support for dynamically setting the authorization header in the http logging handler#3624JimPaine wants to merge 6 commits intoreframe-hpc:developfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
vkarak
left a comment
There was a problem hiding this comment.
Lgtm, I have just minor style comments.
reframe/core/logging.py
Outdated
| ) | ||
|
|
||
| if authorization_header is not None and not callable(authorization_header): | ||
| raise ConfigError("httpjson: 'authorization_header' is not a callable") |
There was a problem hiding this comment.
You could update the error message here along the lines of the json_formatter above.
There was a problem hiding this comment.
@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.
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Enables the use of short lived tokens where http services use flows such as
client credentialsby allowing the authorization header to be set dynamically via a callable which is evaluated at the point the http request is made.Closes #3622