Skip to content
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

(#770) Provide ability to see persisted arguments for installed package #908

Conversation

AdmiringWorm
Copy link
Member

Description Of Changes

This pull request updates the code that was added previously for displaying package arguments with code to hide sensitive arguments, only do a log if the arguments file can not be found, display a message about no arguments could not be found if nothing is returned and to hide the button for viewing package arguments when the package is not installed.

Motivation and Context

The sensitive arguments are changed to not be displayed, as we do not want to dispay these arguments to the users in the possibility that they are not the same user as the one that installed the package.

Changing to logging of the file not found was to prevent duplicated dialogs to be shown, but still give the information about no arguments being available.

Additionally, there is no reason to be able to view package arguments for packages that are not installed.

Testing

  1. Install a package using package arguments (must be at least non-sensitive arguments used, sensitive arguments are usually not persisted) (install through choco cli)
  2. Try viewing the package arguments for the package that was installed.
  3. Notice no more duplication of dialogs.

Change Types Made

  • Bug fix (non-breaking change) (This is a bug fix to a feature introduced on this milestone)
  • Feature / Enhancement (non-breaking change)
  • Breaking change (fix or feature that could cause existing functionality to change)
  • PowerShell code changes.

Related Issue

Fixes #770

Change Checklist

  • Requires a change to the documentation
  • Documentation has been updated
  • Tests to cover my changes, have been added
  • All new and existing tests passed.
  • PowerShell v2 compatibility checked (Not relevant).

@AdmiringWorm AdmiringWorm self-assigned this Jan 24, 2022
@AdmiringWorm AdmiringWorm force-pushed the 770-Provide-ability-to-see-persisted-arguments-for-installed-package branch from 73623ed to cc810ef Compare January 27, 2022 12:07
@AdmiringWorm
Copy link
Member Author

@gep13 this PR have been updated with the latest changes, and updated to use the dynamic languages for the resource strings.

This commit replaces the values in sensitive arguments to instead show
the translatable string `[REDACTED ARGUMENT]` to ensure that sensitive
arguments are not displayed to the user.

This relies on the ArgumentUtility helper to detect whether the sensitive
argument should be shown or not.
This commit updates the dialog for showing package arguments
to have a notice that no arguments was found for the package in
the same dialog as normal arguments would show up with.
This commit updates the package view to hide the button for
displaying package arguments when it is not displayed.
@AdmiringWorm AdmiringWorm force-pushed the 770-Provide-ability-to-see-persisted-arguments-for-installed-package branch from cc810ef to 1413254 Compare January 27, 2022 13:42
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit 1a6da50 into chocolatey:develop Jan 27, 2022
@gep13
Copy link
Member

gep13 commented Jan 27, 2022

@AdmiringWorm this all looks good to me, thanks for pulling all this together!

@AdmiringWorm AdmiringWorm deleted the 770-Provide-ability-to-see-persisted-arguments-for-installed-package branch January 29, 2022 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide ability to "see" persisted arguments for installed package
2 participants