about summary refs log tree commit diff
path: root/spec/fabricators/webauthn_credential_fabricator.rb
blob: b578d55f00d738ea7776a2297f19706e32be13ba (plain) (blame)
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

Fabricator(:webauthn_credential) do
  user_id { Fabricate(:user).id }
  external_id { Base64.urlsafe_encode64(SecureRandom.random_bytes(16)) }
  public_key { OpenSSL::PKey::EC.generate('prime256v1').public_key }
  nickname 'USB key'
  sign_count 0
end