Skip to content

Conversation

@imheresamir
Copy link

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

aggrolite and others added 16 commits January 7, 2016 23:06
"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.
@aggrolite
Copy link
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.

@aggrolite aggrolite force-pushed the master branch 2 times, most recently from 819f08e to 579cca6 Compare March 5, 2017 19:08
@aggrolite
Copy link
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.

@aggrolite
Copy link
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. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants