require_relative "base"
module Validators
  module FieldValidator
    class SshKey < Base

      MAX_LEN = 500

      def valid?
        Devops::Db.connector.key @value
        true
      rescue RecordNotFound
        false
      end

      def message
        "Invalid value '#{@value}': ssh key '#{@value}' not found"
      end
    end
  end
end
