Class: Ronin::App::Validations::ImportParams

Inherits:
Dry::Validation::Contract
  • Object
show all
Defined in:
lib/ronin/app/validations/import_params.rb

Overview

Validations for the form params submitted to POST /import.

Constant Summary collapse

VALID_FILE_EXTS =

Mapping of type values to their set of valid file extension names.

{
  'nmap'    => Set['.xml'],
  'masscan' => Masscan::OutputFile::FILE_FORMATS.keys.to_set
}

Class Method Summary collapse

Class Method Details

.call(params) ⇒ Dry::Validation::Result

Initializes and calls the validation contract.

Parameters:

  • params (Hash{String => Object})

    The HTTP params to validate.

Returns:

  • (Dry::Validation::Result)

    The validation result.



64
65
66
# File 'lib/ronin/app/validations/import_params.rb', line 64

def self.call(params)
  new.call(params)
end