Store Telesign risk score as an abuse trust score
What does this MR do and why?
Describe in detail what your merge request does and why.
This MR saves the Telesign risk score received for a user's phone number in the abuse trust scores table that was created in this MR as part of an effort to store abuse scores from various systems and track these over time.
Related issue - https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/285
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
In the Rails console, configure Telesign by setting the
CUSTOMER_ID
andAPI_KEY
variables to the values in 1Password:::Gitlab::CurrentSettings.update(telesign_customer_xid: CUSTOMER_ID, telesign_api_key: API_KEY)
-
Set variable
INTERNATIONAL_PHONE_NUMBER
- should be your country code and phone number e.g.447585886933
for UK. -
Check the telesign score for a user, it should be
0.0
:u = User.find(1) u.telesign_score => 0.0
-
Send the verification code for the user and their phone number:
params = { country: 'UK', international_dial_code: 44, phone_number: '7585886933' } result = PhoneVerification::Users::SendVerificationCodeService.new(u, params).execute
-
Check the
telesign_score
for the user, it should be equal to therisk_score
value returned from Telesign:u.telesign_score => 12.0
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.