-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
state/remote/swift: Support Openstack request logging #13583
state/remote/swift: Support Openstack request logging #13583
Conversation
@jtopjian Comments welcome. |
Nice! I did a cursory review and it looks good. I'll take a look in more detail either today or tomorrow. |
Cheers... I just had a thought aswell. Should |
@fatmcgav It could. The reason I have it in Thanks for this feature. Printing the headers is definitely useful, especially for Swift, but we should mask some of the sensitive headers printed. For example, when building an instance, this is now printed:
I think masking the token with Other than that, looks great 😄 |
Cool, makes sense on location. Masking sensitive headers makes sense. I'll refactor the printing of the headers and add some redaction logic... Edit: having a look for a sensible list of headers to redact, I found: Looks like a sensible default list to me... |
Refactor `logRequest` and `logResponse` to use `RedactHeaders` func.
Awesome! Nice work :) @stack72 This looks good to me. |
No worries... Happy to squash down the latest commit if cleaner... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
PR #12089 added support for logging request and response bodies to Openstack resource requests.
This PR extends that to the swift remote state backend.
In order to support this, had to modify the
LogRoundTripper
struct to use uppercase field names so that they are exposed externally of the package.Also extended
LogRoundTripper
to log the request/response headers, as they are useful when working with Swift and container archiving/expiration which uses headers to specify, rather than the request body.