aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-auth.el
Commit message (Collapse)AuthorAgeFilesLines
* revert hdurers alist > plist conv in auth.elmousebot2021-10-201-6/+6
|
* rever auth / client changes toomousebot2021-10-151-9/+9
|
* first test merge of hdurer's WIP: Posting of imagesmousebot2021-10-151-15/+15
|
* flycheck: docstrings, autoloads, etcmousebot2021-10-031-3/+5
|
* package-lint: bump to emacs 26.1, disable stream keybindingsmousebot2021-09-221-1/+1
|
* improve docstrings in mastodon-auth so i know what it does.mousebot2021-08-111-6/+11
|
* foll reqs/faves bindings global, autoloads and declarations, readmemousebot2021-06-011-0/+1
|
* bump masto version, bump emacs version to 25.1, dependency in readmemousebot2021-05-311-2/+2
|
* Rewrite `mastodon-auth--access-token` so it handles errors.Ian Eure2021-05-091-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | Currently, `mastodon-auth--access-token` unconditionally returns the value of the `:access_token` key from the response of `(mastodon-auth--get-token)`. This causes problems when there was an error getting the token, for example, if you enter the wrong password. If a token couldn’t be retrieved, the JSON looks like: (:error "invalid_grant" :error_description "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.") Since there is no `:access_token` key, `mastodon-auth--access-token` returns `nil`, which results in a broken header in the next request: Authorization: Bearer Which causes the whole thing to freeze Emacs until you mash `C-g`. This commit rewrites the function to handle that case; to explicitly signal an error for *any* response that isn’t expected; to use `if-let`, which allows the temporary `token` variable to be eliminated; uses `pcase` to determine what kind of response was received; and adds ERT tests for all these cases.
* Update copyright and bump versionJohnson Denen2019-03-041-2/+2
|
* Explitly require json.el in files where we dynamically bind its vars.Holger Dürer2019-03-041-0/+1
| | | | | | As pointed out in issue #211 the compiler actually warned the user about `json-array-type` etc. being unused lexical vars. Let's hope that this fixes the errors reported with reading json.
* Use the email address of the current user as default (#203)Jürgen Hötzel2019-03-041-1/+1
| | | | * Use the email address of the current user as default
* Bump to version 0.8.0Johnson Denen2018-08-101-1/+1
|
* Optionally use auth-source-search for fetching and saving password. (#181)H Durer2018-08-101-0/+47
| | | | | | | | | * Use auth-source-search for fetching and saving password This gives users the ability to save their password to either the gpg-encrypted ~/.authinfo.gpg or ~/.authinfo so that they don't have to provide username/password each time * Add a new custom var to decide whether to use the auth-source package or not.
* Clean up code to remove compilation warnings.Holger Durer2018-08-101-0/+2
| | | | | We used to be clean but have slipped recently. Let's clean up the code so it's easier to see real code smell warnings in the compilation.
* Retoot add accts closes #155Alexander Griffith2018-03-051-0/+18
| | | | | | | | | | | | | When responding to toots the full acct for both local and federated accounts are now added to the new toot buffer. Changes - Added a function in mastodon.el to return the current user acct - Added mastodon-toot--process-local, which takes an acct and appends the current server if it is local returns an empty string if the acct matches the current user and does only adds a prefix @ if the acct is federated - mastodon-toot--mentions will return a formatted string of mentions or an empty string - adds tests for mastodon-toot--mentions - adds a missing , in mastodon-http--post - `mastodon-toot--reply` now passes `mastodon-toot` a toot-id rather than the whole json - 'mastodon-toot--reply-to-id is now a local var in a new toot
* Bump to 0.7.2 and shorten long code lines (#172)Alexander Griffith2018-03-051-1/+1
| | | | | | * Bump version numbers to 0.7.2 * Adjusted functions to bring line length below 90.
* Keep track of to which instance secrets in plstore belong.Holger Dürer2018-03-021-10/+14
| | | | | | | | | | | While testing out issue 149 (https://github.com/jdenen/mastodon.el/issues/149) I had problems due to stale client information being cached. With this change we store various pieces of information (the client information in the plstore and the auth tokens) in alists keyed by the instance url (and the plstore key contains the instance url as well to allow us to store data per instance).
* Bump version to 0.7.1Johnson Denen2017-06-191-1/+1
|
* Bump to v0.7.0Johnson Denen2017-05-181-1/+1
|
* replaced declare-function with autoloadalexjgriffith2017-05-181-2/+2
|
* Remove most byte-compile warnings.Holger Dürer2017-05-181-1/+4
| | | | | | | We do this by - moving vars into the files where they are (mostly) used - "declaring" vars used elsewhere with the (defvar <var-name>) pattern, - declaring functions defined in others functions rather than loading the file via require.
* Bump to v0.6.3Johnson Denen2017-05-151-1/+1
|
* Use lexical-binding in all files.Holger Dürer2017-05-151-1/+2
| | | | | We only support Emacs 24 and 25 so are free to use sane bindings by default. To keep the linter happy, we need to declare dependency on Emacs 24 in all files.
* Clean up use of progn.Holger Dürer2017-05-051-4/+3
| | | | | - Lambda, defun, let, etc. all have an implicit progn. - A progn with a single form is identical to that single form.
* Bump to v0.6.2Johnson Denen2017-04-291-1/+1
|
* Bump to v0.6.1Johnson Denen2017-04-281-1/+1
|
* Bump to v0.6.0Johnson Denen2017-04-241-1/+1
|
* Bump to v0.5.5Johnson Denen2017-04-241-1/+1
|
* Bump to v0.5.4Johnson Denen2017-04-231-1/+1
|
* Fix some compilation errorsJohnson Denen2017-04-231-1/+1
|
* Make tweaks per package-lint feedbackJohnson Denen2017-04-231-0/+1
|
* Clean up tests and update DOCSTRINGsJohnson Denen2017-04-231-3/+6
|
* Rewrite mastodon-authJohnson Denen2017-04-231-127/+32
| | | | | | - Remove client functions - Use mastodon-http--post - No more callback spaghetti
* Retrieve home timeline with `mastodon' functionJohnson Denen2017-04-141-1/+0
|
* Add `mastodon-auth--client' functionJohnson Denen2017-04-121-1/+5
| | | | Replace direct references to `mastodon--client-app-plist'
* Refactor mastodon--register-and-return-client-appJohnson Denen2017-04-121-3/+10
| | | | Add and use `mastodon-auth--client-app-secret-p'
* Fix return value bugJohnson Denen2017-04-121-1/+3
|
* Use `read-passwd'Johnson Denen2017-04-121-1/+1
|
* Add tests for `mastodon--access-token'Johnson Denen2017-04-121-8/+11
|
* Add mastodon--get-access-token testJohnson Denen2017-04-121-8/+17
| | | | Abstract Email and Password prompts to `mastodon-auth--user-and-passwd' function
* Abstract success lambda to its own function and testJohnson Denen2017-04-121-5/+7
| | | | | | Add `mastodon-auth--get-token-success' Add test for `mastodon-auth--get-token-success' Add test for `mastodon--get-access-token-triage'
* Add store-client-id-and-secret testJohnson Denen2017-04-121-2/+6
| | | | | Add `mastodon-auth--token-file' function Add test for `mastodon-auth--token-file'
* Remove progn and return register-client-app funcallJohnson Denen2017-04-121-3/+1
|
* Add mastodon-auth--registration-success testJohnson Denen2017-04-121-6/+9
|
* Make headers more conventionalJohnson Denen2017-04-101-4/+21
|
* Close #7 with repo URLJohnson Denen2017-04-091-1/+2
|
* Fix #8 flycheck issuesJohnson Denen2017-04-091-7/+22
|
* Fix #1 by adding scope to auth token requestJohnson Denen2017-04-091-1/+2
|
* Update DOCSTRINGsJohnson Denen2017-04-091-3/+19
|