2020-07-13 11:09:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Registration information for WebAuthn credentials
|
|
|
|
|
|
|
|
class WebauthnRegistration < ApplicationRecord
|
|
|
|
belongs_to :user
|
|
|
|
|
2021-11-16 07:10:23 -05:00
|
|
|
validates :credential_xid, :public_key, :counter, presence: true
|
|
|
|
validates :name, length: { minimum: 0, allow_nil: false }
|
2020-07-13 11:09:08 -04:00
|
|
|
validates :counter,
|
|
|
|
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 2**32 - 1 }
|
|
|
|
end
|