-
Notifications
You must be signed in to change notification settings - Fork 97
feat(clients): allow custom http headers #1906
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
base: main
Are you sure you want to change the base?
Conversation
7f0de93
to
6f18853
Compare
c8217bb
to
874a4a3
Compare
64514cf
to
712fd67
Compare
b8cd2cb
to
7c00e10
Compare
The environment variable `MONACO_ADDITIONAL_HTTP_HEADERS` is defined and the logic for parsing a http header map from the env var content is defined and tested.
This commit adds a dependency to the specific core lib commit which contains the feature of settings additional custom http headers. # Conflicts: # go.mod # go.sum
The additional http headers set via `MONACO_ADDITIONAL_HTTP_HEADERS` are parsed and used in all places where a client factory is used to create REST clients. Additionally, it is parsed once in the runner in order to log the keys of the additional HTTP headers right at the start of Monaco.
7c00e10
to
29b8637
Compare
|
E2E Test Results 3 files - 1 152 suites - 128 25m 31s ⏱️ - 27m 1s Results for commit 29b8637. ± Comparison against base commit d6638c7. This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Why this PR?
Allowing users to set additional HTTP headers for requests.
What has changed?
The multiline environment variable
MONACO_ADDITIONAL_HTTP_HEADERS
is introduced. Its content is parsed. Each line represents an HTTP header. The key- and value part of the header are separated via:
. These HTTP headers are appended to all requests sent via Monaco.How does it do it?
The variable is retrieved and parsed at all places where the client factory is used to create REST clients. It is also parsed once at the start of Monaco to log the header keys, if any are present.
How is it tested?
To be done.
Currently, only parsing the environment variable contents is tested. Passing it to the clients is not tested yet.
How does it affect users?
Allowing users to set additional HTTP headers for requests via the environment variable
MONACO_ADDITIONAL_HTTP_HEADERS
.