debian-mirror-gitlab/app/models/webauthn_registration.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
523 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
# Registration information for WebAuthn credentials
class WebauthnRegistration < ApplicationRecord
2023-07-09 08:55:56 +05:30
include IgnorableColumns
ignore_column :u2f_registration_id, remove_with: '16.2', remove_after: '2023-06-22'
2020-07-28 23:09:34 +05:30
belongs_to :user
2021-12-11 22:18:48 +05:30
validates :credential_xid, :public_key, :counter, presence: true
validates :name, length: { minimum: 0, allow_nil: false }
2020-07-28 23:09:34 +05:30
validates :counter,
2023-07-09 08:55:56 +05:30
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 2**32 - 1 }
2020-07-28 23:09:34 +05:30
end