Smartling / smartling-cli

Smartling-cli is a library and CLI tool for managing Smartling projects. See the project's Wiki for user documentation.
https://github.com/Smartling/smartling-cli/wiki
MIT License
16 stars 9 forks source link

User ID isn't unescaped when authorizing #35

Closed dkBrazz closed 7 years ago

dkBrazz commented 7 years ago

When User Id is entered it might be escaped before saving into config, but when authenticating it isn't unescaped. There are also redundant method of escaping is used for User Id - symbol + doesn't require escaping for YAML strings

$> smartling-cli.exe init
Generating smartling.yml...
Enter User ID: test+marketo@smartling.com
Enter Token Secret: secret
Enter Account ID (optional):
Enter Project ID:

smartling.yml:

user_id:
    "test+marketo@smartling.com"

secret:
    "secret"

With escaped + authentication fails, but when I manually replace + with + in config it works

If you do several re-inits (with existing config) leaving default values, you get this result in config:

user_id:
    "test+marketo@smartling.com"

& symbol is also escaped, and then escaped again and again

seletskiy commented 7 years ago

@dimitrystd: To fix it replace html/template to text/template on https://github.com/Smartling/smartling-cli/blob/master/config_template.go#L4

dimitrystd commented 7 years ago

Verified