summaryrefslogtreecommitdiff
path: root/spec/factories/u2f_registrations.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-06-06 10:08:42 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-06-06 12:50:31 +0530
commit791cc9138be6ea1783e3c3853370cf0290f4d41e (patch)
tree827023466659a45d83edc93e8410e1251f69ade6 /spec/factories/u2f_registrations.rb
parentfc809d689a03e69c581c1bb8ed0cf246953a7c08 (diff)
downloadgitlab-ce-791cc9138be6ea1783e3c3853370cf0290f4d41e.tar.gz
Add a `U2fRegistrations` table/model.
- To hold registrations from U2F devices, and to authenticate them. - Previously, `User#two_factor_enabled` was aliased to the `otp_required_for_login` column on `users`. - This commit changes things a bit: - `User#two_factor_enabled` is not a method anymore - `User#two_factor_enabled?` checks both the `otp_required_for_login` column, as well as `U2fRegistration`s - Change all instances of `User#two_factor_enabled` to `User#two_factor_enabled?` - Add the `u2f` gem, and implement registration/authentication at the model level.
Diffstat (limited to 'spec/factories/u2f_registrations.rb')
-rw-r--r--spec/factories/u2f_registrations.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/factories/u2f_registrations.rb b/spec/factories/u2f_registrations.rb
new file mode 100644
index 00000000000..df92b079581
--- /dev/null
+++ b/spec/factories/u2f_registrations.rb
@@ -0,0 +1,8 @@
+FactoryGirl.define do
+ factory :u2f_registration do
+ certificate { FFaker::BaconIpsum.characters(728) }
+ key_handle { FFaker::BaconIpsum.characters(86) }
+ public_key { FFaker::BaconIpsum.characters(88) }
+ counter 0
+ end
+end