[BE] Add API to allow updates of CSP

Why are we doing this work

In order to designate a group as CSP, we need to build API to change the csp_namespace_id attribute of a Security::PolicySetting instance.

Relevant links

Implementation plan

  • Add the attribute csp_namespace_id to ee/app/controllers/ee/admin/application_settings_controller.rb
  • Add the attribute to ee/app/helpers/ee/application_settings_helper.rb
  • Delegate the attribute to Security::PolicySetting.instance similar to Ai::Setting.instance here.

Verification steps

  1. Verify the API following the documentation (locally, CSP is not available on GitLab.com): https://docs.gitlab.com/api/compliance_policy_settings/
  2. Enable feature flag security_policies_csp
  3. Verify that the attribute is returned in GET response
  4. Verify that the attribute can be set using a PUT request
Edited by 🤖 GitLab Bot 🤖