Skip to content

Add timestamp to Arkose custom attributes

Marcos Rocha requested to merge mc_rocha-add-timestamp-arkose-attributes into master

What does this MR do and why?

Add timestamp to Arkose custom attributes

How to set up and validate locally

  1. Go to rails console
rails c
  1. Update the failed_attempts to ensure the Arkose integration will be triggered
= User.last
  User Load (1.3ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1 /*application:console,db_config_name:main,line:(pry):30:in `__pry__'*/
=> #<User id:104 @new_user2>
[31] pry(main)> user.failed_attempts = 4
=> 4
[32] pry(main)> user.save!
  1. Go to the login page and sign-in

  2. Go back to the Rails console and check the custom attributes created_at and updated_at

[16] pry(main)> user.reload
[17] pry(main)> user.custom_attributes
  UserCustomAttribute Load (0.4ms)  SELECT "user_custom_attributes".* FROM "user_custom_attributes" WHERE "user_custom_attributes"."user_id" = 104 /*application:console,db_config_name:main,line:bin/rails:4:in `<main>'*/
=> [#<UserCustomAttribute:0x00007fad8b12e450 id: 12, created_at: Thu, 07 Apr 2022 22:42:33.120819000 UTC +00:00, updated_at: Thu, 07 Apr 2022 22:42:33.121197000 UTC +00:00, user_id: 104, key: "[FILTERED]", value: "0">,
 #<UserCustomAttribute:0x00007fad8b12e2e8 id: 11, created_at: Thu, 07 Apr 2022 22:42:33.120819000 UTC +00:00, updated_at: Thu, 07 Apr 2022 22:42:33.121197000 UTC +00:00, user_id: 104, key: "[FILTERED]", value: "0">,
 #<UserCustomAttribute:0x00007fad8b12e180
  id: 10,
  created_at: Thu, 07 Apr 2022 22:42:33.120819000 UTC +00:00,
  updated_at: Thu, 07 Apr 2022 22:42:33.121197000 UTC +00:00,
  user_id: 104,
  key: "[FILTERED]",
  value: "Low">,
 #<UserCustomAttribute:0x00007fad8b12e018
  id: 9,
  created_at: Thu, 07 Apr 2022 22:42:33.120819000 UTC +00:00,
  updated_at: Thu, 07 Apr 2022 22:42:33.121197000 UTC +00:00,
  user_id: 104,
  key: "[FILTERED]",
  value: "142624f68d342e362.4315735001">]

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports