Rename audit log feature flag config variable
This commit is contained in:
parent
c27e0e618e
commit
9de90d796d
@ -150,9 +150,7 @@ def set_default_headers(app): # pragma: no cover
|
|||||||
def map_config(config):
|
def map_config(config):
|
||||||
return {
|
return {
|
||||||
**config["default"],
|
**config["default"],
|
||||||
"AUDIT_LOG_FEATURE_TOGGLE": config["default"].getboolean(
|
"USE_AUDIT_LOG": config["default"].getboolean("USE_AUDIT_LOG"),
|
||||||
"AUDIT_LOG_FEATURE_TOGGLE"
|
|
||||||
),
|
|
||||||
"ENV": config["default"]["ENVIRONMENT"],
|
"ENV": config["default"]["ENVIRONMENT"],
|
||||||
"BROKER_URL": config["default"]["REDIS_URI"],
|
"BROKER_URL": config["default"]["REDIS_URI"],
|
||||||
"DEBUG": config["default"].getboolean("DEBUG"),
|
"DEBUG": config["default"].getboolean("DEBUG"),
|
||||||
|
@ -37,7 +37,7 @@ class AuditableMixin(object):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if app.config.get("AUDIT_LOG_FEATURE_TOGGLE", False):
|
if app.config.get("USE_AUDIT_LOG", False):
|
||||||
audit_event = AuditEvent(**log_data)
|
audit_event = AuditEvent(**log_data)
|
||||||
audit_event.save(connection)
|
audit_event.save(connection)
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ bp.context_processor(atat_context_processor)
|
|||||||
@bp.route("/activity-history")
|
@bp.route("/activity-history")
|
||||||
@user_can(Permissions.VIEW_AUDIT_LOG, message="view activity log")
|
@user_can(Permissions.VIEW_AUDIT_LOG, message="view activity log")
|
||||||
def activity_history():
|
def activity_history():
|
||||||
if app.config.get("AUDIT_LOG_FEATURE_TOGGLE", False):
|
if app.config.get("USE_AUDIT_LOG", False):
|
||||||
pagination_opts = Paginator.get_pagination_opts(request)
|
pagination_opts = Paginator.get_pagination_opts(request)
|
||||||
audit_events = AuditLog.get_all_events(pagination_opts)
|
audit_events = AuditLog.get_all_events(pagination_opts)
|
||||||
return render_template("audit_log/audit_log.html", audit_events=audit_events)
|
return render_template("audit_log/audit_log.html", audit_events=audit_events)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[default]
|
[default]
|
||||||
AUDIT_LOG_FEATURE_TOGGLE = false
|
USE_AUDIT_LOG = false
|
||||||
CAC_URL = http://localhost:8000/login-redirect
|
CAC_URL = http://localhost:8000/login-redirect
|
||||||
CA_CHAIN = ssl/server-certs/ca-chain.pem
|
CA_CHAIN = ssl/server-certs/ca-chain.pem
|
||||||
CLASSIFIED = false
|
CLASSIFIED = false
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
{% if user_can(permissions.VIEW_APPLICATION_ACTIVITY_LOG) and config.get("AUDIT_LOG_FEATURE_TOGGLE", False) %}
|
{% if user_can(permissions.VIEW_APPLICATION_ACTIVITY_LOG) and config.get("USE_AUDIT_LOG", False) %}
|
||||||
{% include "fragments/audit_events_log.html" %}
|
{% include "fragments/audit_events_log.html" %}
|
||||||
{{ Pagination(audit_events, url=url_for('applications.settings', application_id=application.id)) }}
|
{{ Pagination(audit_events, url=url_for('applications.settings', application_id=application.id)) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
{% include "portfolios/fragments/portfolio_members.html" %}
|
{% include "portfolios/fragments/portfolio_members.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if user_can(permissions.VIEW_PORTFOLIO_ACTIVITY_LOG) and config.get("AUDIT_LOG_FEATURE_TOGGLE", False) %}
|
{% if user_can(permissions.VIEW_PORTFOLIO_ACTIVITY_LOG) and config.get("USE_AUDIT_LOG", False) %}
|
||||||
{% include "fragments/audit_events_log.html" %}
|
{% include "fragments/audit_events_log.html" %}
|
||||||
{{ Pagination(audit_events, url_for('portfolios.admin', portfolio_id=portfolio.id)) }}
|
{{ Pagination(audit_events, url_for('portfolios.admin', portfolio_id=portfolio.id)) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -42,11 +42,11 @@ def app(request):
|
|||||||
def skip_audit_log(request):
|
def skip_audit_log(request):
|
||||||
"""
|
"""
|
||||||
Conditionally skip tests marked with 'audit_log' based on the
|
Conditionally skip tests marked with 'audit_log' based on the
|
||||||
AUDIT_LOG_FEATURE_TOGGLE config value.
|
USE_AUDIT_LOG config value.
|
||||||
"""
|
"""
|
||||||
config = make_config()
|
config = make_config()
|
||||||
if request.node.get_closest_marker("audit_log"):
|
if request.node.get_closest_marker("audit_log"):
|
||||||
use_audit_log = config.get("AUDIT_LOG_FEATURE_TOGGLE", False)
|
use_audit_log = config.get("USE_AUDIT_LOG", False)
|
||||||
if not use_audit_log:
|
if not use_audit_log:
|
||||||
pytest.skip("audit log feature flag disabled")
|
pytest.skip("audit log feature flag disabled")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user