aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon/authentication.py')
-rw-r--r--mastodon/authentication.py22
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
1import requests 3import requests
2from requests.models import urlencode 4from requests.models import urlencode
3import datetime 5import datetime
@@ -5,9 +7,11 @@ import os
5import time 7import time
6import collections 8import collections
7 9
8from .error import MastodonIllegalArgumentError, MastodonNetworkError, MastodonVersionError, MastodonAPIError 10from .errors import MastodonIllegalArgumentError, MastodonNetworkError, MastodonVersionError, MastodonAPIError
11from .versions import _DICT_VERSION_APPLICATION
9from .defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT 12from .defaults import _DEFAULT_SCOPES, _SCOPE_SETS, _DEFAULT_TIMEOUT
10from .utility import parse_version_string 13from .utility import parse_version_string, api_version
14
11from .internals import Mastodon as Internals 15from .internals import Mastodon as Internals
12 16
13class Mastodon(Internals): 17class 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')
Powered by cgit v1.2.3 (git 2.41.0)