Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Fixing issue with URI parsing of passwords taken from the command line. #60

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

codemonkeyjohn
Copy link
Contributor

The command-line parsing of the uri doesn't allow certain characters (/, ?, @, #, <, or >) to be used:

$ rvc root:tes/ting@vmhost
Failed to parse URI "root:tes/ting@vmhost": bad component(expected user component): test#ng

To get around this, I tried to URI-encode the offending character, but got an InvalidLogin message:

$ rvc root:tes%2fting@vmhost
Failed to connect to vmhost: InvalidLogin: Cannot complete login due to an incorrect user name or password.

This commit decodes the password, so the second command would work.

Added test cases for parsing URIs in the connect method.  It requires
mocha to mock the VIM objects for the unit test.
@codemonkeyjohn
Copy link
Contributor Author

I've added tests and modified the code to allow domains in usernames, too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant