audit(major): AuditEntry -> Event
This commit is contained in:
@ -8,7 +8,7 @@ from django.utils.translation import ugettext as _
|
||||
from oauth2_provider.views.base import AuthorizationView
|
||||
from structlog import get_logger
|
||||
|
||||
from passbook.audit.models import AuditEntry
|
||||
from passbook.audit.models import Event
|
||||
from passbook.core.models import Application
|
||||
from passbook.core.views.access import AccessMixin
|
||||
from passbook.core.views.utils import LoadingView, PermissionDeniedView
|
||||
@ -77,8 +77,8 @@ class PassbookAuthorizationView(AccessMixin, AuthorizationView):
|
||||
|
||||
def form_valid(self, form):
|
||||
# User has clicked on "Authorize"
|
||||
AuditEntry.create(
|
||||
action=AuditEntry.ACTION_AUTHORIZE_APPLICATION,
|
||||
Event.create(
|
||||
action=Event.ACTION_AUTHORIZE_APPLICATION,
|
||||
request=self.request,
|
||||
app=str(self._application))
|
||||
LOGGER.debug('user %s authorized %s', self.request.user, self._application)
|
||||
|
||||
@ -3,7 +3,7 @@ from django.contrib import messages
|
||||
from django.shortcuts import redirect
|
||||
from structlog import get_logger
|
||||
|
||||
from passbook.audit.models import AuditEntry
|
||||
from passbook.audit.models import Event
|
||||
from passbook.core.models import Application
|
||||
from passbook.policies.engine import PolicyEngine
|
||||
|
||||
@ -28,8 +28,8 @@ def check_permissions(request, user, client):
|
||||
messages.error(request, policy_message)
|
||||
return redirect('passbook_providers_oauth:oauth2-permission-denied')
|
||||
|
||||
AuditEntry.create(
|
||||
action=AuditEntry.ACTION_AUTHORIZE_APPLICATION,
|
||||
Event.create(
|
||||
action=Event.ACTION_AUTHORIZE_APPLICATION,
|
||||
request=request,
|
||||
app=application.name,
|
||||
skipped_authorization=False)
|
||||
|
||||
@ -13,7 +13,7 @@ from django.views.decorators.csrf import csrf_exempt
|
||||
from signxml.util import strip_pem_header
|
||||
from structlog import get_logger
|
||||
|
||||
from passbook.audit.models import AuditEntry
|
||||
from passbook.audit.models import Event
|
||||
from passbook.core.models import Application
|
||||
from passbook.lib.mixins import CSRFExemptMixin
|
||||
from passbook.lib.utils.template import render_to_string
|
||||
@ -123,8 +123,8 @@ class LoginProcessView(AccessRequiredView):
|
||||
if self.provider.application.skip_authorization:
|
||||
ctx = self.provider.processor.generate_response()
|
||||
# Log Application Authorization
|
||||
AuditEntry.create(
|
||||
action=AuditEntry.ACTION_AUTHORIZE_APPLICATION,
|
||||
Event.create(
|
||||
action=Event.ACTION_AUTHORIZE_APPLICATION,
|
||||
request=request,
|
||||
app=self.provider.application.name,
|
||||
skipped_authorization=True)
|
||||
@ -145,8 +145,8 @@ class LoginProcessView(AccessRequiredView):
|
||||
# Check if user has access
|
||||
if request.POST.get('ACSUrl', None):
|
||||
# User accepted request
|
||||
AuditEntry.create(
|
||||
action=AuditEntry.ACTION_AUTHORIZE_APPLICATION,
|
||||
Event.create(
|
||||
action=Event.ACTION_AUTHORIZE_APPLICATION,
|
||||
request=request,
|
||||
app=self.provider.application.name,
|
||||
skipped_authorization=False)
|
||||
|
||||
Reference in New Issue
Block a user