Sha256: 65e5ec39d4a512fe2de10441f269276fea5ee4e2d2596ada0264d6551c21e36b
Contents?: true
Size: 523 Bytes
Versions: 10
Compression:
Stored size: 523 Bytes
Contents
module Security class CSRFTokenValidation < RuboCop::Cop::Base MSG = 'Do not disable authenticity token validation' def_node_matcher :skip_before_action, '(send _ :skip_before_action _)' def on_send(node) return unless skip_before_action(node) _, _, parts = *node method = parts.node_parts add_offense(node.loc.selector) if found_match(method[0]) end def found_match(method) [:verify_authenticity_token, 'verify_authenticity_token'].include?(method) end end end
Version data entries
10 entries across 10 versions & 1 rubygems