wndhydrnt/python-oauth2 — pull request #15 by jswitzer (2014-02-24 23:12:45+00:00)
Title: Add refresh_expiration_multiplier and reissue_refresh_tokens options

These options affect how the refresh token grant operates.
Refresh expiration multiplier will set the expiration
of the refresh token in units of the access_token expiration time.
For example refresh_expiration_multiplier=2 with expires_in=60
will have refresh tokens be valid for two minutes,
with the access_tokens being valid for one minute.

Reissue refresh token will cause a new refresh token to be issued along with
new access_token, and the old refresh token invalidated, when a refresh token
is redeemed.

These are optional behaviours and are disabled by default. To enable them:
oauth_app.add_grant(oauth2.grant.RefreshToken(expires_in=60, \
refresh_expiration_multiplier=2,\
reissue_refresh_tokens=True))

I have tested these changes with the default mongodb storage adapter and they appear to work. Let me know of any additional changes or modifications I need to make before they can be merged upstream.