Many broken things
This commit is contained in:
@ -1,8 +1,11 @@
|
||||
"""passbook oauth_client config"""
|
||||
from logging import getLogger
|
||||
from django.apps import AppConfig
|
||||
from passbook.lib.config import CONFIG
|
||||
from importlib import import_module
|
||||
from logging import getLogger
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
from passbook.lib.config import CONFIG
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
||||
class PassbookOAuthClientConfig(AppConfig):
|
||||
|
@ -5,6 +5,7 @@ from django.db.models import Q
|
||||
|
||||
from passbook.oauth_client.models import OAuthSource, UserOAuthSourceConnection
|
||||
|
||||
|
||||
class AuthorizedServiceBackend(ModelBackend):
|
||||
"Authentication backend for users registered with remote OAuth provider."
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Generated by Django 2.1.3 on 2018-11-11 08:22
|
||||
# Generated by Django 2.1.3 on 2018-11-11 14:06
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
@ -9,8 +9,6 @@ from passbook.oauth_client.clients import get_client
|
||||
class OAuthSource(Source):
|
||||
"""Configuration for OAuth provider."""
|
||||
|
||||
# FIXME: Dynamically load available source_types
|
||||
|
||||
provider_type = models.CharField(max_length=255)
|
||||
request_token_url = models.CharField(blank=True, max_length=255)
|
||||
authorization_url = models.CharField(max_length=255)
|
||||
|
@ -6,9 +6,9 @@ from django.contrib.auth import get_user_model
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from passbook.oauth_client.clients import OAuth2Client
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from passbook.oauth_client.errors import OAuthClientEmailMissingError
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
|
||||
|
||||
@MANAGER.source(kind=RequestKind.redirect, name='facebook')
|
||||
|
@ -3,9 +3,9 @@
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from passbook.oauth_client.errors import OAuthClientEmailMissingError
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
|
||||
|
||||
@MANAGER.source(kind=RequestKind.callback, name='github')
|
||||
|
@ -1,9 +1,9 @@
|
||||
"""Google OAuth Views"""
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
|
||||
|
||||
@MANAGER.source(kind=RequestKind.redirect, name='google')
|
||||
|
@ -1,6 +1,7 @@
|
||||
"""Source type manager"""
|
||||
from logging import getLogger
|
||||
from enum import Enum
|
||||
from logging import getLogger
|
||||
|
||||
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
@ -1,4 +1,3 @@
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
"""Reddit OAuth Views"""
|
||||
import json
|
||||
from logging import getLogger
|
||||
@ -8,13 +7,13 @@ from requests.auth import HTTPBasicAuth
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from passbook.oauth_client.clients import OAuth2Client
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
||||
|
||||
|
||||
@MANAGER.source(kind=RequestKind.redirect, name='reddit')
|
||||
class RedditOAuthRedirect(OAuthRedirect):
|
||||
"""Reddit OAuth2 Redirect"""
|
||||
|
@ -7,9 +7,9 @@ from django.contrib.auth import get_user_model
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from passbook.oauth_client.clients import OAuth2Client
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
||||
|
@ -7,9 +7,9 @@ from requests.exceptions import RequestException
|
||||
|
||||
from passbook.oauth_client.clients import OAuthClient
|
||||
from passbook.oauth_client.errors import OAuthClientEmailMissingError
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
from passbook.oauth_client.utils import user_get_or_create
|
||||
from passbook.oauth_client.views.core import OAuthCallback
|
||||
from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
||||
|
Reference in New Issue
Block a user