struct FileAnalyzer::Hook

Overview

Most hooks (http, base64, string) recognise an endpoint by matching a URL they found in the file against the user-supplied -u/--url. With no url their includes?(url) test degenerates to "matches everything", so they must not run at all — that is what #requires_url marks.

A hook that identifies endpoints from file syntax instead (graphql operation documents) is url-independent and has to run either way. Gating the whole FileAnalyzer on -u used to drop those from every default scan, so the requirement is now declared per hook rather than assumed for all of them.

Defined in:

models/analyzer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(func : Proc(String, String, Array(Endpoint)), requires_url : Bool) #

[View source]

Instance Method Detail

def clone #

[View source]
def copy_with(func _func = @func, requires_url _requires_url = @requires_url) #

[View source]
def func : Proc(String, String, Array(Endpoint)) #

def requires_url : Bool #