Cleaned documentation up somewhat
This commit is contained in:
pare
23e796bab4
commit
0ba01f3da9
S'han modificat 1 arxius amb 12 adicions i 15 eliminacions
|
@ -134,7 +134,6 @@ class Mastodon:
|
|||
|
||||
def auth_request_url(self, client_id = None, redirect_uris = "urn:ietf:wg:oauth:2.0:oob", scopes = ['read', 'write', 'follow']):
|
||||
"""Returns the url that a client needs to request the grant from the server.
|
||||
https://mastodon.social/oauth/authorize?client_id=XXX&response_type=code&redirect_uris=YYY&scope=read+write+follow
|
||||
"""
|
||||
if client_id is None:
|
||||
client_id = self.client_id
|
||||
|
@ -155,22 +154,20 @@ class Mastodon:
|
|||
code = None, redirect_uri = "urn:ietf:wg:oauth:2.0:oob", refresh_token = None,\
|
||||
scopes = ['read', 'write', 'follow'], to_file = None):
|
||||
"""
|
||||
Docs: https://github.com/doorkeeper-gem/doorkeeper/wiki/Interacting-as-an-OAuth-client-with-Doorkeeper
|
||||
Your username is the e-mail you use to log in into mastodon.
|
||||
|
||||
Notes:
|
||||
Your username is the e-mail you use to log in into mastodon.
|
||||
Can persist access token to file, to be used in the constructor.
|
||||
|
||||
Can persist access token to file, to be used in the constructor.
|
||||
Supports refresh_token but Mastodon.social doesn't implement it at the moment.
|
||||
|
||||
Supports refresh_token but Mastodon.social doesn't implement it at the moment.
|
||||
Handles password, authorization_code, and refresh_token authentication.
|
||||
|
||||
Handles password, authorization_code, and refresh_token authentication.
|
||||
Will throw a MastodonIllegalArgumentError if username / password
|
||||
are wrong, scopes are not valid or granted scopes differ from requested.
|
||||
|
||||
Will throw a MastodonIllegalArgumentError if username / password
|
||||
are wrong, scopes are not valid or granted scopes differ from requested.
|
||||
For OAuth2 documentation, compare https://github.com/doorkeeper-gem/doorkeeper/wiki/Interacting-as-an-OAuth-client-with-Doorkeeper
|
||||
|
||||
Returns:
|
||||
str @access_token
|
||||
Returns the access token.
|
||||
"""
|
||||
if username is not None and password is not None:
|
||||
params = self.__generate_params(locals(), ['scopes', 'to_file', 'code', 'refresh_token'])
|
||||
|
|
Loading…
Referencia en una nova incidència