Internationa1 / write-as.vim

A simple VIM plugin that allows one to upload blogposts to write.as directly from the buffer.
Other
14 stars 3 forks source link

Authenticate with an access token #2

Closed thebaer closed 6 years ago

thebaer commented 6 years ago

This supports authentication via access token (instead of username and password), so users don't need to store their password in plaintext in their .vimrc if they don't want. It maintains backwards-compatibility with any current config, but adds a new :WriteAsAuth command that fetches a Write.as access token users can store in their .vimrc. This keeps their password more secure, and has the benefit of speeding up publishing, as authentication is a time-consuming operation.

These changes also let users avoid storing any authentication information in .vimrc and just enter their username and password on the fly when publishing.

I'm not experienced with Vim plugins or Python, but I used vim's input and inputsecret functions for getting user input. Not sure if there's a better way to do that -- but feel free to improve in any way!