Module ipernity.auth¶
- class ipernity.auth.AuthHandler(api: IpernityAPI)[source]¶
Bases:
ABCGeneric authentication handler
- Parameters:
api – The API object to which the handler belongs.
- property api: IpernityAPI¶
The corresponding
IpernityAPIobject
- getToken(frob: str, store_token: bool = True, **kwargs: api_arg) dict[source]¶
Runs the [auth.getToken] API method.
By default, also stores the token and user info in the API object.
- checkToken(auth_token: str, **kwargs: api_arg) dict[source]¶
Runs the [auth.checkToken] API method
- abstract auth_url(perms: Mapping, **kwargs: str) str[source]¶
URL to pass to a web browser for authorization.
- Parameters:
perms – Dictionary used to generate the
perm_XXXparameters to the authorization URL. The keys can bedoc,blogetc.
- do_request(url: str, method_name: str, method_args: Mapping[str, api_arg]) requests.Response[source]¶
Signs and runs a request.
This is part of
AuthHandlerto make an OAuth handler possible, as OAuth uses a different format for signing and authentication info.- Parameters:
url – Request URL.
method_name – The method to be called (needed for signing).
method_args – Arguments of the method call.
- class ipernity.auth.DesktopAuthHandler(api: IpernityAPI)[source]¶
Bases:
AuthHandlerDesktop authentication handler.
- Parameters:
api – The API object to which the handler belongs.
See also
Desktop Authentication at Ipernity
- auth_url(perms: Mapping, frob: str) str[source]¶
Authorization URL.
See Ipernity Permissions for a description.
- Parameters:
perms – Dictionary used to generate the
perm_XXXparameters to the authorization URL. The keys can bedoc,blogetc.frob – Data retrieved from
getFrob()
- class ipernity.auth.WebAuthHandler(api: IpernityAPI)[source]¶
Bases:
AuthHandlerAuthentication for web applications
- Parameters:
api – The
IpernityAPIobject to which the handler belongs.
Added in version 0.1.3.
See also
Web Authentication at Ipernity
- auth_url(perms: Mapping[str, str]) str[source]¶
Authorization URL.
See Ipernity Permissions for a description.
- Parameters:
perms – Dictionary used to generate the
perm_XXXparameters to the authorization URL. The keys can bedoc,blogetc.