-
Notifications
You must be signed in to change notification settings - Fork 903
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
(#1310) List remembered arguments #2619
Conversation
5b291be
to
9d0a555
Compare
184829f
to
0383498
Compare
5c93ebf
to
061bf63
Compare
bca15cd
to
1c34d84
Compare
1c34d84
to
18c3bd4
Compare
039142a
to
b496b9a
Compare
2b57f32
to
5cafc54
Compare
It's not in limbo. We're not at a stage where we want to bring it into a release. |
Similar to comment elsewhere, as long as this doesn't include sensitive arguments, then we are all good. |
62b1e4a
to
13207e5
Compare
To my understanding, the sensitive arguments are not stored in the |
13207e5
to
9959bed
Compare
This adds the listing of remembered arguments to the list/info commands It only grabs the arguments when --local-only is specified, then decrypts and outputs them. Requires --verbose to be listed on the command line.
This commit makes sure that no potentially sensitive arguments are displayed to the end user. This makes use of the same code that is currently being used in Chocolatey GUI, for providing the same function. Now that this code exists in Chocolatey CLI, at some point in the future, Chocolatey GUI can be updated to use it, rather than maintaining the code in two places. This new code makes use of the existing SensitiveArgumentsProvided method to establish whether the argument is deemed as sensitive, and if it is, "[REDACTED ARGUMENT]" is output, rather than the value itself. This new function has been created as a static method, so that it can be used easily in the Chocolatey GUI codebase.
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!
@TheCakeIsNaOH thanks again for raising this PR! I have taken the liberty of making another commit into the PR, which adds in the ability to redact arguments that contain sensitive information. This is essentially a carbon copy of the code that already exists in Chocolatey GUI for doing the same thing. Now that the code is going to exist in Chocolatey CLI, the Chocolatey GUI code can be updated to make use of it at some point, that way, we don't have to maintain the code in the same place. This new code was reviewed in a pairing session with @AdmiringWorm so going to move forward with the merge once the CI builds are complete. Example output, showing redacted arguments: |
That failing Docker build here is as a result of a NuGet Restore problem, and nothing to do with the changes in this PR, as such, moving forward with the merge. |
Description Of Changes
This adds the listing of remembered arguments to the list/info commands
It only grabs the arguments when --local-only is specified, then
decrypts and outputs them. Requires --verbose to be listed on the
command line.
Motivation and Context
If
useRememberedArgumentsForUpgrades
is enabled, it is useful to know what argument are remembered.Testing
.\choco install iperf2 --pre --ia="argument" --params="/param"
and.\choco install wget --params="/param"
.\choco.exe list --verbose
and check that the remembered arguments are listed..\choco.exe info iperf2 --local-only
and check that the remembered arguments are listed..\choco.exe info iperf2
and check that the remembered argument are NOT listed.Change Types Made
Related Issue
Fixes #1310
Change Checklist