Expand description
The shared HTTP client.
Every outbound request is checked against an explicit URL allowlist before
it is sent. Service crates register the read-only URLs they need. The
order-submission URL is deliberately not registered unless ordering is
enabled in config, so an accidental or injected call to it fails closed with
ErrorKind::UrlNotAllowed instead of reaching Grab.
Cookies are sent as a manually built Cookie: header (reqwest’s cookie
store is off), filtered per request host and path the way a browser does.
Structs§
- Allowlist
- A set of allowed URLs. Service crates build one and register their URLs.
- Client
- Shared state for building requests, minus the hydra token (which the higher-level client refreshes).
- RawCookie
- A cookie parsed from a
Set-Cookieresponse header. - Request
- A prepared request the client will send if its URL is allowlisted.
Enums§
- Hydra
- Whether a call needs the hydra device JWT header.
- Rule
- How a URL may be matched by the allowlist.
Constants§
Functions§
- parse_
http_ date - Parse an HTTP date (
Sun, 06 Nov 1994 08:49:37 GMT, also the06-Nov-1994cookie variant) into Unix seconds. - parse_
set_ cookie - Parse one
Set-Cookieheader received fromhostinto aRawCookie.
Type Aliases§
- Shared
Client - A shareable handle so service code can hold the client cheaply.