Skip to content

Add configuration settings for Arkose client API

Ian Anderson requested to merge akose-client-api-settings into master

What does this MR do and why?

Add the credentials needed for the Arkose Truth Data API to configuration settings.

Related to: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/548

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

▶ rake db:migrate:up:main VERSION=20240212223930
WARNING: This version of GitLab depends on gitlab-shell 14.33.0, but you're running 14.32.0. Please update gitlab-shell.
main: == [advisory_lock_connection] object_id: 117720, pg_backend_pid: 1623992
main: == 20240212223930 AddArkoseClientApiSettings: migrating =======================
main: -- add_column(:application_settings, :encrypted_arkose_labs_client_xid, :binary)
main:    -> 0.0013s
main: -- add_column(:application_settings, :encrypted_arkose_labs_client_xid_iv, :binary)
main:    -> 0.0005s
main: -- add_column(:application_settings, :encrypted_arkose_labs_client_secret, :binary)
main:    -> 0.0005s
main: -- add_column(:application_settings, :encrypted_arkose_labs_client_secret_iv, :binary)
main:    -> 0.0005s
main: == 20240212223930 AddArkoseClientApiSettings: migrated (0.0072s) ==============

main: == [advisory_lock_connection] object_id: 117720, pg_backend_pid: 1623992



▶ rake db:migrate:down:main VERSION=20240212223930
WARNING: This version of GitLab depends on gitlab-shell 14.33.0, but you're running 14.32.0. Please update gitlab-shell.
main: == [advisory_lock_connection] object_id: 117720, pg_backend_pid: 1624821
main: == 20240212223930 AddArkoseClientApiSettings: reverting =======================
main: -- remove_column(:application_settings, :encrypted_arkose_labs_client_xid, :binary)
main:    -> 0.0012s
main: -- remove_column(:application_settings, :encrypted_arkose_labs_client_xid_iv, :binary)
main:    -> 0.0005s
main: -- remove_column(:application_settings, :encrypted_arkose_labs_client_secret, :binary)
main:    -> 0.0004s
main: -- remove_column(:application_settings, :encrypted_arkose_labs_client_secret_iv, :binary)
main:    -> 0.0004s
main: == 20240212223930 AddArkoseClientApiSettings: reverted (0.0061s) ==============

main: == [advisory_lock_connection] object_id: 117720, pg_backend_pid: 1624821

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Run migration
▶ rake db:migrate:up:main VERSION=20240212223930
  1. Test that new settings can be created and retrieved.
[1] pry(main)> ::Gitlab::CurrentSettings.update(arkose_labs_client_xid: 'client-id')
[2] pry(main)> ::Gitlab::CurrentSettings.update(arkose_labs_client_secret: 'client-secret')
[3] pry(main)> ::Gitlab::CurrentSettings.arkose_labs_client_xid
=> "client-id"
[4] pry(main)> ::Gitlab::CurrentSettings.arkose_labs_client_secret
=> "client-secret"
[5] pry(main)>
Edited by Ian Anderson

Merge request reports