class Deliver
- Deliver
- Reference
- Object
Direct Known Subclasses
Defined in:
models/deliver.crConstant Summary
-
EXPORT_CONNECT_TIMEOUT =
10.seconds -
Export ships one request carrying the entire catalog, so it gets more room: the body can be megabytes and the receiver may index it inline.
-
EXPORT_READ_TIMEOUT =
60.seconds -
NUMERIC_PATH_PARAM_RE =
/\A(?:.*_)?(?:id|ids|pk|no|num|number|count|page|size|limit|offset|index|idx|version|seq|year|month|day|port)\z/i -
Path-param names that name a number. A framework route constrained to an integer (
/users/{id:int}, Django's<int:pk>) rejects a word, so these get1; anything else gets a harmless string. -
PROBE_CONNECT_TIMEOUT =
5.seconds -
Crest defaults both
connect_timeoutandread_timeoutto nil, i.e. no timeout at all, and every delivery class relied on that default. A host that accepted the connection and then went quiet blocked forever:- probe / proxy: the stalled request keeps holding its --concurrency slot, so enough blackholed hosts starve every remaining endpoint.
- export:
deliverruns at the end ofanalyze, which is BEFOREreportis called, so a hung Elasticsearch or webhook host hangs noir before any output is written and the user loses the whole scan.
Values are deliberately generous rather than snappy. A probe's purpose is to deliver the request (so an intercepting proxy or the app's own logs see it); a slow-but-working target answering in 12s should not start being reported as undeliverable. These bound the pathological case without second-guessing a live one.
-
PROBE_PATH_FILL_METHODS =
Set {"GET", "HEAD", "OPTIONS"} -
Verbs whose path templates get filled in before probing. Restricted to the read-only ones on purpose.
register_path_paramin the optimizer only substitutes a placeholder when--set-pvalue-pathsupplied a value, so on a default scan/users/{id}is probed literally and 404s. Filling it makes the probe actually reach the route — but it also makes destructive verbs real:DELETE /users/{id}is a harmless 404 today and would becomeDELETE /users/1against a live record. Read-only verbs get the benefit without that risk; for the rest the literal template still reaches an intercepting proxy, where the user can edit and replay it deliberately. -
PROBE_READ_TIMEOUT =
15.seconds
Constructors
Instance Method Summary
- #apply_all(endpoints : Array(Endpoint))
- #apply_filters(endpoints : Array(Endpoint))
- #apply_matchers(endpoints : Array(Endpoint))
- #filters : Array(String)
- #headers : Hash(String, String)
- #matchers : Array(String)
- #proxy : String
- #run
-
#undeliverable_count : Int32
Requests that never completed during the last
#run— connection refused, TLS handshake rejected, DNS failure, timeout.
Constructor Detail
Instance Method Detail
Requests that never completed during the last #run — connection
refused, TLS handshake rejected, DNS failure, timeout. Deliberately
not incremented for an HTTP error response: a 404 or 500 means the
probe was delivered and answered. Exposed so the distinction is
assertable, since the count is otherwise only visible as a log line.