Loading
Expose Observability provisioner settings in the settings API
What does this MR do and why?
Lets administrators set the GitLab Observability provisioner URL and API key with PUT /application/settings. Both settings are for GitLab.com only.
o11y_provisioner_urlis readable and writable.o11y_provisioner_api_keyis write-only.GET /application/settingsnever returns it.- If the admin settings form submits the key blank, the form keeps the existing value, the same as
eks_secret_access_key.
This is the second of three MRs, stacked on the columns MR:
- Columns and model: !262321 (merged)
- Settings API (this MR)
- Client reads the settings: !262323 (merged)
Implementation notes
- Both attributes are in
visible_attributes, and have typed, length-limited params inlib/api/settings.rb. - The key is removed from
API::Entities::ApplicationSetting.exposed_attributes, likeasset_proxy_secret_keyandeks_secret_access_key. A request spec fails if the key shows up in the response. - Logs: the param name ends in
key, soconfig.filter_parametersalready filters it. - Audit events:
encryptsattributes are insensitive_attributes, whichAuditEvents::Changesredacts. scripts/cells/application-settings-analysis.rbrejectedstringas the documented type for ajsonbcolumn. Anencryptsattribute stored injsonbholds a string, so the script now acceptsstringfor encryptedjsonbcolumns. Without this,ensure-application-settings-have-definition-filefails.- OpenAPI v3 docs regenerated.
References
- Related issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/633458
Screenshots or screen recordings
Not applicable, API only.
How to set up and validate locally
-
Set both values as an administrator:
curl --request PUT --header "PRIVATE-TOKEN: <admin_token>" \ --url "http://gdk.test:3000/api/v4/application/settings" \ --data "o11y_provisioner_url=https://provisioner.example.com/api/v1/provision_requests" \ --data "o11y_provisioner_api_key=example" -
Confirm the response includes
o11y_provisioner_urlbut noto11y_provisioner_api_key. -
Run
GET /application/settingsand confirm the same.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
A maintainer other than the author merges this MR, after the columns MR.
Edited by Dakota Dux