webauthn_credential_fabricator.rb 283 B

123456789
  1. # frozen_string_literal: true
  2. Fabricator(:webauthn_credential) do
  3. user_id { Fabricate(:user).id }
  4. external_id { Base64.urlsafe_encode64(SecureRandom.random_bytes(16)) }
  5. public_key { OpenSSL::PKey::EC.generate('prime256v1').public_key }
  6. nickname 'USB key'
  7. sign_count 0
  8. end