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

added key normalizing #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

added key normalizing #6

wants to merge 1 commit into from

Conversation

azweb76
Copy link

@azweb76 azweb76 commented Jun 27, 2018

Most applications use client certificates to encrypt/decrypt configuration, however sometimes the certificate contains crlf line endings and in other cases has just lf line endings. This change enables the user to strip whitespace from the key before encrypting/decrypting. This change maintains backward compatibility to not normalize the key. To update the configuration, run convert {key} true true to convert the encrypted data using normalized keys and backup the original values.

Copy link
Contributor

@asilvas asilvas left a comment

Choose a reason for hiding this comment

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

Great changes!

Asks:

  • Default to normalize the key during convert
  • Default to normalize the key when saving a new config (where there were no keys at time of load)

This should squash the issues for good.

getPrivateKeyPath(privateKeyPath, function (privateKeyPath) {
getBackup(backup, function (backup) {
rl.write(': converting...');
instance.convert({ privateKeyPath: privateKeyPath, backup: backup === 'true' });
instance.convert({ privateKeyPath: privateKeyPath, backup: backup === 'true', normalizeKey: (normalizeKey === 'true' || instance.config._.normalizeKey) });
Copy link
Contributor

Choose a reason for hiding this comment

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

To keep things simple I'd suggest making this default to enabled, and we can bump major version.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

3 participants