diff options
Diffstat (limited to 'mastodon/authentication.py')
-rw-r--r-- | mastodon/authentication.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/mastodon/authentication.py b/mastodon/authentication.py index b7f15c9..d4cb283 100644 --- a/mastodon/authentication.py +++ b/mastodon/authentication.py | |||
@@ -1,3 +1,5 @@ | |||
1 | # authentication.py - app and user creation, login, oauth, getting app info, and the constructor | ||
2 | |||
1 | import requests | 3 | import requests |
2 | from requests.models import urlencode | 4 | from requests.models import urlencode |
3 | import datetime | 5 | import datetime |
@@ -5,9 +7,11 @@ import os | |||
5 | import time | 7 | import time |
6 | import collections | 8 | import collections |
7 | 9 | ||
8 | from .error import MastodonIllegalArgumentError, MastodonNetworkError, MastodonVersionError, MastodonAPIError | 10 | from .errors import MastodonIllegalArgumentError, MastodonNetworkError, MastodonVersionError, MastodonAPIError |
11 | from .versions import _DICT_VERSION_APPLICATION | ||
9 | from .defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT | 12 | from .defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT |
10 | from .utility import parse_version_string | 13 | from .utility import parse_version_string, api_version |
14 | |||
11 | from .internals import Mastodon as Internals | 15 | from .internals import Mastodon as Internals |
12 | 16 | ||
13 | class Mastodon(Internals): | 17 | class Mastodon(Internals): |
@@ -367,4 +371,16 @@ class Mastodon(Internals): | |||
367 | 371 | ||
368 | # We are now logged out, clear token and logged in id | 372 | # We are now logged out, clear token and logged in id |
369 | self.access_token = None | 373 | self.access_token = None |
370 | self.__logged_in_id = None \ No newline at end of file | 374 | self.__logged_in_id = None |
375 | |||
376 | ### | ||
377 | # Reading data: Apps | ||
378 | ### | ||
379 | @api_version("2.0.0", "2.7.2", _DICT_VERSION_APPLICATION) | ||
380 | def app_verify_credentials(self): | ||
381 | """ | ||
382 | Fetch information about the current application. | ||
383 | |||
384 | Returns an :ref:`application dict <application dict>`. | ||
385 | """ | ||
386 | return self.__api_request('GET', '/api/v1/apps/verify_credentials') | ||