|
| 1 | +[](https://travis-ci.com/emacs-grammarly/auth-source-keytar) |
| 2 | +[](https://celpa.conao3.com/#/auth-source-keytar) |
| 3 | +[](https://www.gnu.org/licenses/gpl-3.0) |
| 4 | + |
| 5 | +# auth-source-keytar |
| 6 | + |
| 7 | +Emacs Lisp interface for [node-keytar](https://www.npmjs.com/package/keytar) |
| 8 | +using [@emacs-grammarly/keytar-cli](https://github.com/emacs-grammarly/keytar-cli). |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +You will need [@emacs-grammarly/keytar-cli](https://github.com/emacs-grammarly/keytar-cli) |
| 13 | +before using this library. |
| 14 | + |
| 15 | +```bash |
| 16 | +npm install -g @emacs-grammarly/keytar-cli |
| 17 | +``` |
| 18 | + |
| 19 | +or after you have installed `auth-source-keytar.el` in your `load-path`. Do the following, |
| 20 | + |
| 21 | +```el |
| 22 | +(require 'auth-source-keytar) |
| 23 | +(auth-source-keytar-install) |
| 24 | +``` |
| 25 | + |
| 26 | +## Usage |
| 27 | + |
| 28 | +List of supported API ported from [node-keytar](https://www.npmjs.com/package/keytar). |
| 29 | + |
| 30 | +* `auth-source-keytar-get-password` |
| 31 | +* `auth-source-keytar-set-password` |
| 32 | +* `auth-source-keytar-delete-password` |
| 33 | +* `auth-source-keytar-find-credentials` |
| 34 | +* `auth-source-keytar-find-password` |
| 35 | + |
| 36 | +*P.S. Checkout the [node-keytar#docs](https://github.com/atom/node-keytar#docs) for details* |
| 37 | + |
| 38 | +## Examples |
| 39 | + |
| 40 | +A small example to use this library in Emacs Lisp. |
| 41 | + |
| 42 | +```el |
| 43 | +(auth-source-keytar-set-password "service1" "testuser" "hello") ; t |
| 44 | +(auth-source-keytar-find-credentials "service1") ; [ { account: 'testuser', password: 'hello' } ] |
| 45 | +(auth-source-keytar-find-password "service1") ; hello |
| 46 | +``` |
| 47 | + |
| 48 | +If you attempt to use `auth-source` then, |
| 49 | + |
| 50 | +```el |
| 51 | +(auth-source-keytar-enable) |
| 52 | +(auth-source-keytar-search :service "service1" :account "testuser") |
| 53 | +``` |
| 54 | + |
| 55 | +## Contribution |
| 56 | + |
| 57 | +If you would like to contribute to this project, you may either |
| 58 | +clone and make pull requests to this repository. Or you can |
| 59 | +clone the project and establish your own branch of this tool. |
| 60 | +Any methods are welcome! |
0 commit comments