-
Notifications
You must be signed in to change notification settings - Fork 3
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
PRO-16923: ProvarDX runtests fails to handle special characters in Scratch Org Passwords properly #25
Conversation
…ratch Org Passwords properly
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.
There a few points with this commit. Which I'll comment on individually below but in general it is not good practice to do unrelated changes in the same commit.
src/utilities/ProvarDXUtility.ts
Outdated
password = password.split('&').join('"&"'); | ||
password = password.split('|').join('"|"'); | ||
password = password.split('^').join('"^"'); | ||
password = password.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'); |
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.
This doesn't look like the right fix to me. The example in the Jira is an invalid JSON string where the final character in the password is \ which is escaping the closing quote. That's just an error in the JSON not a bug in our code.
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.
I debugged it on my local and faced a similar issue where the commands were failing due to special characters in the password
2X#$[3P8mj
&2Cp9%Wt4M
So, that's why added a regex to escape special characters correctly.
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.
Now we have encoded the password value before sending it to Provar.
* PRO-16810: ProvarDX Incorrect Help messages (#23) - Updated help messages for runtests, validate commands displayed on running `sfdx provar --help` - Updated company name in LICENSE.md * PRO-16923: ProvarDX runtests fails to handle special characters in Scratch Org Passwords properly (#25) * PRO-16923: ProvarDX runtests fails to handle special characters in Scratch Org Passwords properly * PRO-16923: Special characters were causing issues on different OS so encoded the password * PRO-16897: ProvarDX: Runtests secrets flag override incorrectly documented * PRO-16897: ProvarDX: Runtests secrets flag override incorrectly documented * PRO-16890 : Enforce required flags for provar:metadatacache (#26) * PRO-16890 : Enforce required flags for provar:metadatacache The command started executing even when required flags were not given. Changed that to give error in typescript itself. Also made changes to make sure that the flags work correctly in tandem. * PRO-16890 : Implement review comments and add change log * PRO-16890 : Implement review comments Corrected conditional checks to use "===" & '!==' for comparison and renamed variables with self explanatory names * PRO-16890 : Implement review comments Co-authored-by: mayank.nehru <mayank.nehru@HP-Mayanknehru> * PRO-17213: ProvarDX 0.3.0 release (#27) Bumped version to 0.3.0 Co-authored-by: Mayank Nehru <mayank.nehru@provartesting.com> Co-authored-by: mayank.nehru <mayank.nehru@HP-Mayanknehru> Co-authored-by: ProvarTesting <6640365+ProvarTesting@users.noreply.github.com>
Issue: Scratch org password had special characters. Earlier we had only escaped &, |, ^ special characters.
Fix: Encoded password value.
Also contains changes for:
ProvarDX trademark changes.
Added .vscode folder in git containing debug configuration and copyright snippet.