Documentation
¶
Overview ¶
Package web2 executes web2 (HTTP) read requests: it fetches the declared endpoint, extracts the declared JSON fields, and canonically encodes them so read results are byte-identical across validators.
Index ¶
Constants ¶
const (
// DestinationPrefix identifies web2 read destinations, e.g. "web2:https".
DestinationPrefix = "web2:"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor implements common.ReadRequestHandler for web2 destinations.
func NewExecutor ¶
NewExecutor creates a web2 read executor. Its HTTP client dials through an SSRF guard that blocks private/internal addresses on the initial request and on every redirect hop, and only connects to the exact IP it vetted (so DNS rebinding cannot swap in an internal address between check and dial).
func (*Executor) ExecuteRead ¶
func (e *Executor) ExecuteRead(ctx context.Context, req *ucallbacktypes.ReadRequest) (*ucallbacktypes.ReadResult, error)
ExecuteRead fetches the endpoint declared in the envelope, extracts the declared fields, and abi-encodes them in extract order. Deterministic failures (bad envelope, non-JSON response, missing path, 4xx) are votable ERROR observations; transport failures and 5xx are transient errors.