Class: Rails::Guarddog::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/guarddog/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
9
10
11
# File 'lib/rails/guarddog/configuration.rb', line 6

def initialize
  @root = Rails.root.to_s
  @enabled_checkers = all_checkers
  @excluded_paths = %w[vendor spec test node_modules]
  @output_format = :console
end

Instance Attribute Details

#enabled_checkersObject

Returns the value of attribute enabled_checkers.



4
5
6
# File 'lib/rails/guarddog/configuration.rb', line 4

def enabled_checkers
  @enabled_checkers
end

#excluded_pathsObject

Returns the value of attribute excluded_paths.



4
5
6
# File 'lib/rails/guarddog/configuration.rb', line 4

def excluded_paths
  @excluded_paths
end

#output_formatObject

Returns the value of attribute output_format.



4
5
6
# File 'lib/rails/guarddog/configuration.rb', line 4

def output_format
  @output_format
end

#rootObject

Returns the value of attribute root.



4
5
6
# File 'lib/rails/guarddog/configuration.rb', line 4

def root
  @root
end

Instance Method Details

#all_checkersObject



13
14
15
16
17
18
# File 'lib/rails/guarddog/configuration.rb', line 13

def all_checkers
  %w[
    sql_injection xss csrf mass_assignment open_redirect secrets
    dos idor ai_injection rate_limit dependency graphql
  ]
end