/usr/lib/ruby/vendor_ruby/diaspora_federation/validators/h_card_validator.rb is in ruby-diaspora-federation 0.1.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | module DiasporaFederation
module Validators
# This validates a {Discovery::HCard}.
#
# @todo activate guid and public key validation after all pod have it in
# the hcard.
#
# @note
class HCardValidator < Validation::Validator
include Validation
# rule :guid, :guid
# The name must not contain a semicolon because of mentions.
# @{<full_name> ; <diaspora_id>}
rule :full_name, regular_expression: {regex: /\A[^;]{,70}\z/}
rule :first_name, regular_expression: {regex: /\A[^;]{,32}\z/}
rule :last_name, regular_expression: {regex: /\A[^;]{,32}\z/}
# this urls can be relative
rule :photo_large_url, [:not_nil, URI: [:path]]
rule :photo_medium_url, [:not_nil, URI: [:path]]
rule :photo_small_url, [:not_nil, URI: [:path]]
# rule :exported_key, :public_key
rule :searchable, :boolean
end
end
end
|