psi-im/plugins

New yandex disk plugin

Opened this issue · 3 comments

Ri0n commented

Some ideas...

so we use webdav to work with the disk.
also we have an API http://api.yandex.ru/disk/
we prefer oauth since we don't want to store user credentials

workflow on plugin enable or on first access to files

  1. request access token from yandex http://api.yandex.ru/oauth/doc/dg/reference/obtain-access-token.xml
    • if failed to request token (ex: when client_id is unknown), try to register app
      • say to user we are going to register his Psi(+) on yandex.disk and probaby he has to authorize yourself
      • open webkit window with https://oauth.yandex.ru/client/new
      • check proper page was loading by querying some html elements.
      • if login page or anything else was loaded lets user does what needed.
      • if app registration page was loaded (after authorization probably), autofill all fields and let user to check and agree.
      • get client_id from redirect after submitting form and cache it in settings
    • if failed to request token because client_id is invalid follow steps above to register app
  2. as soon as token received we have to store in plugin's settings forever.
  3. from this moment the plugin is fully working and may access to webdav files using app token.
  4. if yandex.disk starts reporting invalid token go to step 1.

in the user interface we need a field for access token (notice: not client_id) with button receive which executes steps above

zet commented

а чего здесь задачу создал? у нас же есть нормальный багтрекер

Ri0n commented

по инерции. сам себе в кутеноты на житхаб баги пощу. удобно в плане интеграции с репозиторием. да и маркдаун тоже не плох

Мне тоже гитхабовский багтрекер нравится. Можно на коммиты ссылаться в тексте, на пользователей (им, вроде уведомления придут) задачи создавать, объединять задачи/баги. Чую если доку прочту узнаю еще больше.