-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(env): support for uppercase reference to get ENV and SECRET #11172
Conversation
@LinkinStars please add test cases as well |
also, please fix the code lint problem |
@LinkinStars, okay. Please rebase with master for the fix for CI failures. |
ab149bf
to
5acff9f
Compare
@LinkinStars I think using lowercase " Hardcoding for secret reference: Hardcoding for env reference: If you were to write test cases covering the above situation it would fail. What could be a good solution for this? |
First, we discuss the issue of After my testing, both the uppercase and lowercase should be supported after changes. There are two reasons for this
After reading the code I found out why. For env, both checking and parsing converted the target to uppercase preferentially.
Because when characters are cut, the character length is used. Both uppercase and lowercase lengths are the same, so there's no problem.
Secondly, let's discuss the Unfortunately, as you said, using the uppercase 'SECRET' is problematic. I tried adding unit tests and found that they could not pass. The reason is quite simple: 'secret' is not converted to uppercase like 'env' before comparison and parsing. Dig more. I find the git history. The 'secret' was previously modified by KMS, and there was uppercase conversion before. However, So, in my opinion, I would not recommend supporting uppercase SECRET. I think the author who wrote the code at that time must have also considered that. Of course, these are just my personal thoughts, if there is anything incorrect, please point it out. All in all, there are two options.
|
let's only support uppercase for ENV and leave secret as it is. Really appreciate the detailed explanation 🙏🏼 |
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.
LGTM!
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions. |
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.
@LinkinStars please resolve the conflicts.
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions. |
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Description
Fixes #11141
Only lowercase is matched in the 'cert' and 'key' parameters. To maintain consistency, match the uppercase as well.
Checklist