-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
global: new configurable OAuthRemoteApp factory #46
Conversation
from .utils import load_or_import_from_config, obj_or_import_string | ||
|
||
|
||
def _default_remote_app_factory(oauth): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _default_remote_app_factory(oauth):
"""Default remote OAuth application factory."""
return oauth.remote_app
?
48ed0f4
to
ec04c44
Compare
ec04c44
to
0ca9774
Compare
@@ -26,6 +26,8 @@ | |||
an access token. **Default:** ``oauth_token``. | |||
`OAUTHCLIENT_STATE_EXPIRES` Number of seconds after which the state token | |||
expires. Defaults to 300 seconds. | |||
`OAUTHCLIENT_REMOTE_APP_FACTORY` Replaces the default remote application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OAUTHCLIENT_REMOTE_APP
0ca9774
to
845225d
Compare
@@ -52,14 +53,26 @@ def __init__(self, app): | |||
# Add remote applications | |||
self.oauth.init_app(app) | |||
|
|||
remote_app_class = load_or_import_from_config( | |||
'OAUTHCLIENT_REMOTE_APP', app, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for better consistency:
- 'OAUTHCLIENT_REMOTE_APP', app,
- OAuthRemoteApp)
+ 'OAUTHCLIENT_REMOTE_APP', app, default=OAuthRemoteApp
+ )
Apart of some styling it looks good. |
845225d
to
e51454d
Compare
e51454d
to
d033b02
Compare
* NEW Enables to create custom OAuthRemoteApp instances by replacing the default remote application factory. (closes inveniosoftware#45) Signed-off-by: Nicolas Harraudeau <nicolas.harraudeau@cern.ch>
the default remote application factory. (closes global: configurable OAuthRemoteApp factory #45)
Signed-off-by: Nicolas Harraudeau nicolas.harraudeau@cern.ch