Class: Police::Labels::UnsafeString

Inherits:
DataFlow::Label
  • Object
show all
Defined in:
lib/police/labels/unsafe_string.rb

Overview

Marks strings that are read from the outside environment with no sanitization.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.autoflow?Boolean

Returns:

  • (Boolean)

See Also:

  • DataFlow::Label#autoflow?


8
9
10
# File 'lib/police/labels/unsafe_string.rb', line 8

def self.autoflow?
  true
end

.return_hook(method_name) ⇒ Object

See Also:

  • DataFlow::Label#return_hook


18
19
20
# File 'lib/police/labels/unsafe_string.rb', line 18

def self.return_hook(method_name)
  nil
end

.yield_args_hook(method_name) ⇒ Object

See Also:

  • DataFlow::Label#yield_args_hook


23
24
25
# File 'lib/police/labels/unsafe_string.rb', line 23

def self.yield_args_hook(method_name)
  nil
end

Instance Method Details

#accept?(data) ⇒ Boolean

Returns:

  • (Boolean)

See Also:

  • DataFlow::Label#accept?


13
14
15
# File 'lib/police/labels/unsafe_string.rb', line 13

def accept?(data)
  data.kind_of? String
end