Automatic audit logging using SQLA events

This commit is contained in:
richard-dds
2018-09-19 11:41:27 -04:00
parent b7a33de29d
commit ddc2e2fad7
27 changed files with 346 additions and 26 deletions

View File

@@ -5,6 +5,8 @@ import pendulum
from atst.domain.requests import Requests
from atst.domain.users import Users
from atst.domain.authnid import AuthenticationContext
from atst.domain.audit_log import AuditLog
from atst.domain.auth import logout as _logout
bp = Blueprint("atst", __name__)
@@ -79,7 +81,11 @@ def login_redirect():
@bp.route("/logout")
def logout():
if session.get("user_id"):
del (session["user_id"])
_logout()
return redirect(url_for(".home"))
@bp.route("/activity-history")
def activity_history():
audit_events = AuditLog.get_all_events(g.current_user)
return render_template("audit_log.html", audit_events=audit_events)