Skip to content
This repository was 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
codemonkeyjohn wants to merge 3 commits into
vmware-archive:masterfrom
codemonkeyjohn:scripting-updates
Open

Fixing issue with URI parsing of passwords taken from the command line.#60
codemonkeyjohn wants to merge 3 commits into
vmware-archive:masterfrom
codemonkeyjohn:scripting-updates

Conversation

@codemonkeyjohn

Copy link
Copy Markdown
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
Copy Markdown
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