*(minor): remove __name__ param from get_logger
This commit is contained in:
parent
2b8fed8f4e
commit
c0df1f38b8
|
@ -1,7 +1,6 @@
|
|||
[run]
|
||||
source = passbook
|
||||
omit =
|
||||
env/
|
||||
*/wsgi.py
|
||||
manage.py
|
||||
*/migrations/*
|
||||
|
|
|
@ -3,11 +3,9 @@ test-warnings: true
|
|||
doc-warnings: false
|
||||
|
||||
ignore-paths:
|
||||
- env
|
||||
- migrations
|
||||
- docs
|
||||
- node_modules
|
||||
- client-packages
|
||||
|
||||
uses:
|
||||
- django
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
disable=redefined-outer-name,arguments-differ,no-self-use,cyclic-import,fixme,locally-disabled,unpacking-non-sequence,too-many-ancestors,too-many-branches,too-few-public-methods
|
||||
load-plugins=pylint_django,pylint.extensions.bad_builtin
|
||||
#,pylint.extensions.docparams
|
||||
extension-pkg-whitelist=lxml
|
||||
const-rgx=[a-zA-Z0-9_]{1,40}$
|
||||
ignored-modules=django-otp
|
||||
jobs=4
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from structlog import get_logger
|
|||
from passbook.lib.utils.template import render_to_string
|
||||
|
||||
register = template.Library()
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
@register.simple_tag()
|
||||
def get_links(model_instance):
|
||||
|
|
|
@ -10,7 +10,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.lib.models import UUIDModel
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class AuditEntry(UUIDModel):
|
||||
"""An individual audit log entry"""
|
||||
|
|
|
@ -6,7 +6,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.lib.config import CONFIG
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class PassbookCoreConfig(AppConfig):
|
||||
"""passbook core app config"""
|
||||
|
|
|
@ -3,7 +3,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.core.auth.factor import AuthenticationFactor
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class DummyFactor(AuthenticationFactor):
|
||||
|
|
|
@ -19,7 +19,7 @@ from passbook.core.tasks import send_email
|
|||
from passbook.lib.config import CONFIG
|
||||
from passbook.lib.utils.reflection import path_to_class
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def authenticate(request, backends, **credentials):
|
||||
|
|
|
@ -14,7 +14,7 @@ from passbook.lib.utils.reflection import class_to_path, path_to_class
|
|||
from passbook.lib.utils.urls import is_url_absolute
|
||||
from passbook.policy.engine import PolicyEngine
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
def _redirect_with_qs(view, get_query_set=None):
|
||||
"""Wrapper to redirect whilst keeping GET Parameters"""
|
||||
|
|
|
@ -9,7 +9,7 @@ from passbook.core.models import User
|
|||
from passbook.lib.config import CONFIG
|
||||
from passbook.lib.utils.ui import human_list
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class LoginForm(forms.Form):
|
||||
"""Allow users to login"""
|
||||
|
|
|
@ -7,7 +7,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.core.models import User
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Import users from CSV file"""
|
||||
|
|
|
@ -8,7 +8,7 @@ from structlog import get_logger
|
|||
from passbook.lib.config import CONFIG
|
||||
from passbook.root.wsgi import application
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
|
|
@ -6,7 +6,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.root.celery import CELERY_APP
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
|
|
@ -19,7 +19,7 @@ from passbook.lib.models import CreatedUpdatedModel, UUIDModel
|
|||
from passbook.policy.exceptions import PolicyException
|
||||
from passbook.policy.struct import PolicyRequest, PolicyResult
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def default_nonce_duration():
|
||||
|
|
|
@ -7,7 +7,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.core.exceptions import PasswordPolicyInvalid
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
user_signed_up = Signal(providing_args=['request', 'user'])
|
||||
invitation_created = Signal(providing_args=['request', 'invitation'])
|
||||
|
|
|
@ -10,7 +10,7 @@ from passbook.core.models import Nonce
|
|||
from passbook.lib.config import CONFIG
|
||||
from passbook.root.celery import CELERY_APP
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
@CELERY_APP.task()
|
||||
def send_email(to_address, subject, template, context):
|
||||
|
|
|
@ -5,7 +5,7 @@ from structlog import get_logger
|
|||
from passbook.core.auth import view
|
||||
from passbook.core.views import authentication, overview, user
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
urlpatterns = [
|
||||
# Authentication views
|
||||
|
|
|
@ -6,7 +6,7 @@ from structlog import get_logger
|
|||
from passbook.core.models import Application
|
||||
from passbook.policy.engine import PolicyEngine
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class AccessMixin:
|
||||
"""Mixin class for usage in Authorization views.
|
||||
|
|
|
@ -20,7 +20,7 @@ from passbook.core.signals import invitation_used, user_signed_up
|
|||
from passbook.core.tasks import send_email
|
||||
from passbook.lib.config import CONFIG
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class LoginView(UserPassesTestMixin, FormView):
|
||||
|
|
|
@ -8,7 +8,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.core.models import Policy, PolicyResult, User
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class HaveIBeenPwendPolicy(Policy):
|
||||
"""Check if password is on HaveIBeenPwned's list by upload the first
|
||||
|
|
|
@ -5,7 +5,7 @@ from structlog import get_logger
|
|||
from passbook.ldap.ldap_connector import LDAPConnector
|
||||
from passbook.ldap.models import LDAPSource
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class LDAPBackend(ModelBackend):
|
||||
|
|
|
@ -9,7 +9,7 @@ from passbook.core.models import User
|
|||
from passbook.ldap.models import LDAPSource
|
||||
from passbook.lib.config import CONFIG
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
USERNAME_FIELD = CONFIG.y('ldap.username_field', 'sAMAccountName')
|
||||
LOGIN_FIELD = CONFIG.y('ldap.login_field', 'userPrincipalName')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"""passbook sentry integration"""
|
||||
from structlog import get_logger
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def before_send(event, hint):
|
||||
|
|
|
@ -5,7 +5,7 @@ from structlog import get_logger
|
|||
|
||||
register = template.Library()
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
|
|
|
@ -3,7 +3,7 @@ from django import template
|
|||
from structlog import get_logger
|
||||
|
||||
register = template.Library()
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def get_key_unique(context):
|
||||
|
|
|
@ -6,7 +6,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.lib.config import CONFIG
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class PassbookOAuthClientConfig(AppConfig):
|
||||
"""passbook oauth_client config"""
|
||||
|
|
|
@ -11,7 +11,7 @@ from requests.exceptions import RequestException
|
|||
from requests_oauthlib import OAuth1
|
||||
from structlog import get_logger
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class BaseOAuthClient:
|
||||
|
|
|
@ -10,7 +10,7 @@ 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
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class AzureADOAuth2Client(OAuth2Client):
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
@MANAGER.source(kind=RequestKind.redirect, name='Discord')
|
||||
|
|
|
@ -5,7 +5,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class RequestKind(Enum):
|
||||
"""Enum of OAuth Request types"""
|
||||
|
|
|
@ -10,7 +10,7 @@ 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 = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
@MANAGER.source(kind=RequestKind.redirect, name='reddit')
|
||||
|
|
|
@ -10,7 +10,7 @@ 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
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class SupervisrOAuth2Client(OAuth2Client):
|
||||
|
|
|
@ -8,7 +8,7 @@ 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
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class TwitterOAuthClient(OAuthClient):
|
||||
|
|
|
@ -16,7 +16,7 @@ from passbook.lib.utils.reflection import app
|
|||
from passbook.oauth_client.clients import get_client
|
||||
from passbook.oauth_client.models import OAuthSource, UserOAuthSourceConnection
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
|
|
@ -14,7 +14,7 @@ from passbook.core.views.access import AccessMixin
|
|||
from passbook.core.views.utils import LoadingView, PermissionDeniedView
|
||||
from passbook.oauth_provider.models import OAuth2Provider
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class PassbookAuthorizationLoadingView(LoginRequiredMixin, LoadingView):
|
||||
|
|
|
@ -4,7 +4,7 @@ from django.db.utils import InternalError, OperationalError, ProgrammingError
|
|||
from django.urls import include, path
|
||||
from structlog import get_logger
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class PassbookOIDCProviderConfig(AppConfig):
|
||||
"""passbook auth oidc provider app config"""
|
||||
|
|
|
@ -6,7 +6,7 @@ from structlog import get_logger
|
|||
from passbook.core.models import Application
|
||||
from passbook.policy.engine import PolicyEngine
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
def check_permissions(request, user, client):
|
||||
"""Check permissions, used for
|
||||
|
|
|
@ -9,7 +9,7 @@ from passbook.core.auth.factor import AuthenticationFactor
|
|||
from passbook.otp.forms import OTPVerifyForm
|
||||
from passbook.otp.views import OTP_SETTING_UP_KEY, EnableView
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class OTPFactor(FormView, AuthenticationFactor):
|
||||
"""OTP Factor View"""
|
||||
|
|
|
@ -23,7 +23,7 @@ from passbook.otp.utils import otpauth_url
|
|||
|
||||
OTP_SESSION_KEY = 'passbook_otp_key'
|
||||
OTP_SETTING_UP_KEY = 'passbook_otp_setup'
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class UserSettingsView(LoginRequiredMixin, TemplateView):
|
||||
"""View for user settings to control OTP"""
|
||||
|
|
|
@ -9,7 +9,7 @@ from structlog import get_logger
|
|||
from passbook.core.models import Policy
|
||||
from passbook.policy.struct import PolicyRequest, PolicyResult
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class PasswordExpiryPolicy(Policy):
|
||||
|
|
|
@ -9,7 +9,7 @@ from structlog import get_logger
|
|||
# set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "passbook.root.settings")
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
CELERY_APP = Celery('passbook')
|
||||
|
|
|
@ -8,7 +8,7 @@ from structlog import get_logger
|
|||
from passbook.core.views import error
|
||||
from passbook.lib.utils.reflection import get_apps
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
admin.autodiscover()
|
||||
admin.site.login = RedirectView.as_view(pattern_name='passbook_core:auth-login')
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.lib.config import CONFIG
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
class PassbookSAMLIDPConfig(AppConfig):
|
||||
"""passbook saml_idp app config"""
|
||||
|
|
|
@ -65,7 +65,7 @@ class Processor:
|
|||
def __init__(self, remote):
|
||||
self.name = remote.name
|
||||
self._remote = remote
|
||||
self._logger = get_logger(__name__)
|
||||
self._logger = get_logger()
|
||||
self._system_params['ISSUER'] = self._remote.issuer
|
||||
self._logger.debug('processor configured')
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from passbook.core.models import PropertyMapping, Provider
|
|||
from passbook.lib.utils.reflection import class_to_path, path_to_class
|
||||
from passbook.saml_idp.base import Processor
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
class SAMLProvider(Provider):
|
||||
|
|
|
@ -21,7 +21,7 @@ from passbook.policy.engine import PolicyEngine
|
|||
from passbook.saml_idp import exceptions
|
||||
from passbook.saml_idp.models import SAMLProvider
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
URL_VALIDATOR = URLValidator(schemes=('http', 'https'))
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from structlog import get_logger
|
|||
from passbook.lib.utils.template import render_to_string
|
||||
from passbook.saml_idp.xml_signing import get_signature_xml, sign_with_signxml
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def _get_attribute_statement(params):
|
||||
|
|
|
@ -7,7 +7,7 @@ from structlog import get_logger
|
|||
|
||||
from passbook.lib.utils.template import render_to_string
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def sign_with_signxml(private_key, data, cert, reference_uri=None):
|
||||
|
|
|
@ -7,7 +7,7 @@ from structlog import get_logger
|
|||
from passbook.core.models import User
|
||||
from passbook.suspicious_policy.models import IPScore, UserScore
|
||||
|
||||
LOGGER = get_logger(__name__)
|
||||
LOGGER = get_logger()
|
||||
|
||||
|
||||
def get_remote_ip(request):
|
||||
|
|
Reference in New Issue