Added support for Application Only OAuth flow and duration parameter#2
Open
imheresamir wants to merge 16 commits intoaggrolite:masterfrom
Open
Added support for Application Only OAuth flow and duration parameter#2imheresamir wants to merge 16 commits intoaggrolite:masterfrom
imheresamir wants to merge 16 commits intoaggrolite:masterfrom
Conversation
"Me" Endpoints:
Me() GET api/v1/me
MyKarama() GET api/v1/me/karma
MyPreferences() GET api/v1/me/prefs
MyTrophies() GET api/v1/me/trophies
MyFriends() GET api/v1/me/friends
User Endpoints:
AboutRedditor() GET user/<user>/about
UserTrophies() GET api/v1/user/<user>/trophies
Subreddit Endpoints:
AboutSubreddit() GET r/<subreddit>/about
Comments() GET comments/<subreddit>
Submit() POST api/submit
Delete() POST api/del
SubredditSubmissions() GET r/<subreddit>
FrontPage() GET
After a new OAuthSession type is created with NewOAuthSession(), the caller is given the choice of how the auth token should be created. The auth token is required to define the HTTP client used for API requests. Currently, LoginAuth() is the only method of token exchange. Other methods should be implemented in the future, which is why LoginAuth() does not happen by default within the constructor of OAuthSession.
Disabled by default. Accepts a time.Duration and each HTTP request must wait on interval to elapse. User can disable any existing throttling by passing 0.
When creating a new OAuthSession type, the caller can now choose between authenticating for personal use or on behalf of a user.
Personal script authentication (password credential exchange) is not issued a refresh token by Reddit's API. The caller must request a new access token after each one expires. The TokenExpiry field indicates the lifetime of a token and will help the user determine when a new access token must be created.
Add Reply
…tion parameter. For easier merging
Owner
|
Hi, thanks for the patch. I will take some time soon to go through the changes, and should probably have questions for you then. |
819f08e to
579cca6
Compare
Owner
|
@imheresamir I haven't completely forgotten about this change. 😅 Looks like it needs rebasing as there were changes upstream I've made. Let me know if you want to take a stab at that, or if I should just manually pick out the relevant bits. |
Owner
|
@imheresamir An additional thought: Maybe it's better to reopen this PR to the upstream repo now that my fork has been completely merged. Regardless I'll be looking at mixing this change into one of my personal projects, so we'll get it in one way or another. 😄 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Application Only OAuth flow will auto refresh token before api requests, if necessary.
Please let me know what you think of the additions. I am keeping an eye on jzelinskie#12 as well.
Thanks for your contributions.
Samir