-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(config): implement custom header field inside HostRules #26225
feat(config): implement custom header field inside HostRules #26225
Conversation
ffc40b4
to
9e9d5ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs discussion about validation and security
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a new globalOnly config option allowedHeaders
in lib/config/options
3c476e9
to
23e79b9
Compare
@rarkins, I've made the changes. Can you confirm if it's okay with you? Sorry for the accidental close/open; it was a misclick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make use of the anyMatchRegexOrMinimatch() function and do not convert into RegExp internally
5c46d9f
to
fe3faf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check that Renovate validates (enforces) that the config (header values must be a string)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think it's essential that we validate repo config for allowed headers and raise a config error if any don't match (instead of waiting until runtime to log a warning)
I added tests to resolve code coverage issues. Could you please rerun the pipeline ? |
@rarkins Could you please rerun the pipeline ? |
bc1a14d
to
dd9a775
Compare
627e221
to
8815f1c
Compare
@hersentino I think you need to merge from main branch again before this can be successfully merged |
🎉 This PR is included in version 37.139.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes
Adding a 'headers' field to the 'HostRules' configuration, which will be automatically included in the HTTP request header.
Context
I'm making this change because the URL (matchHost) from which I want to retrieve the package version has an authentication system using "X-Auth-Token." Currently, there is no way to pass the token. I came across this discussion that also reports the problem. However, the proposed solution in the discussion cannot work according to the source code. This solution enables genericity
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: