-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from josuebrunel/dev
- Loading branch information
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
BaseOAuth | ||
========== | ||
|
||
### **Definition** | ||
|
||
#### *BaseOAuth(oauth_version, consumer_key, consumer_secret, \*\*kwargs)* | ||
|
||
* ***consumer_key*** : Your consumer key | ||
* ***consumer_secret*** : Your consumer secret | ||
* ***kwargs*** : | ||
- *base_url* : API Base url | ||
- *callback* : Callback url, by default **'oob'** | ||
- *from_file*: JSON File containing credentials | ||
- *acess_token, access_secret, session_handle, token_time* for OAuth1 | ||
- *acess_token, token_type, refresh_token, token_time* for OAuth2 | ||
|
||
When **from_file** is not provided, **credentials** are saved in ***./secrets.json*** | ||
|
||
***OAuth1*** and ***OAuth2*** subclass ***BaseOAuth*** | ||
|
||
### **Methods** | ||
|
||
#### *token_is_valid()* | ||
Check if token is still valid | ||
|
||
#### *refresh_access_token()* | ||
Refresh access token | ||
|
||
#### *handle()* | ||
Get ***request token*** (OAuth1), redirect user to ***authorization url*** and get ***access token*** | ||
|
||
#### *generate_oauth2_headers* | ||
Generates headers for ***OAuth2*** | ||
|
||
#### *oauth2_access_parser(raw_access)* | ||
Decode ***raw_access*** response for ***OAuth2*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
__author__ = 'Josue Kouka' | ||
__email__ = '[email protected]' | ||
__version__ = "0.1.3" | ||
__version__ = "0.1.4" | ||
|
||
#requirements.txt | ||
with open('requirements.txt') as f: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters