Many broken things

This commit is contained in:
Jens Langhammer
2018-11-16 09:10:35 +01:00
parent 79490984d1
commit fbaab4efaf
104 changed files with 3056 additions and 63 deletions

View File

@ -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):

View File

@ -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."

View File

@ -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):

View File

@ -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)

View File

@ -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__)

View File

@ -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')

View File

@ -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')

View File

@ -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')

View File

@ -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__)

View File

@ -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"""

View File

@ -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__)

View File

@ -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__)