BE: Add edit page for Security Policies
Why are we doing this work
To solve problems encountered during frontend development (!65553 (comment 621003500)) we need to extend current Scan Policies internal API (Security::PoliciesController
) with additional method: edit
. This should work similar to edit
method in ThreatMonitoringController.
As an outcome of this issue we should be able to query ie. https://gitlab.com/mparuszewski/security-orchestration-policies/-/security/policies/policy-name/edit
and get details of the security policy from the project that is assigned to selected project as Security Policy Project
:
- add_to_breadcrumbs s_("ThreatMonitoring|Threat Monitoring"), project_threat_monitoring_path(@project)
- breadcrumb_title @policy_name
- page_title s_("NetworkPolicies|Policy editor")
- policy_details = policy_details(@project, @policy, @environment)
#js-policy-builder-app{ data: policy_details }
Relevant links
Non-functional requirements
- [-] Documentation:
-
Feature flag: this route should only work if feature flag is enabled for the project - [-] Performance:
-
Testing: - check if user can load page with scan policy that is accessible,
- check if user sees 404 error if scan policy that is not accessible,
Implementation plan
-
backend add new method to ee/app/controllers/projects/security/policies_controller.rb
:edit
that will fetch policy from related project, -
backend add new view for added method to load container with policy_details
as data (see example above), -
backend extend ee/config/routes/project.rb
with new route:security-orchestration-policies/-/security/policies/policy-name/edit
that connect route to added method
Edited by Alan (Maciej) Paruszewski