Crate reth_rpc_layer

Source
Expand description

Layer implementations used in RPC

Structs§

AuthClientLayer
A layer that adds a new JWT token to every request using AuthClientService.
AuthClientService
Automatically authenticates every client request with the given secret.
AuthLayer
This is an Http middleware layer that acts as an interceptor for Authorization headers. Incoming requests are dispatched to an inner AuthValidator. Invalid requests are blocked and the validator’s error response is returned. Valid requests are instead dispatched to the next layer along the chain.
AuthService
This type is the actual implementation of the middleware. It follows the [Service] specification to correctly proxy Http requests to its inner service after headers validation.
Claims
Claims in JWT are used to represent a set of information about an entity.
CompressionLayer
This layer is a wrapper around [tower_http::compression::CompressionLayer] that integrates with jsonrpsee’s HTTP types. It automatically compresses responses based on the client’s Accept-Encoding header.
JwtAuthValidator
Implements JWT validation logics and integrates to an Http AuthLayer by implementing the AuthValidator trait.
JwtSecret
Value-object holding a reference to a hex-encoded 256-bit secret key.
ResponseFuture
A future representing the response of an RPC request

Enums§

JwtError
Errors returned by the JwtSecret

Traits§

AuthValidator
General purpose trait to validate Http Authorization headers. It’s supposed to be integrated as a validator trait into an AuthLayer.

Functions§

secret_to_bearer_header
Helper function to convert a secret into a Bearer auth header value with claims according to https://github.com/ethereum/execution-apis/blob/main/src/engine/authentication.md#jwt-claims. The token is valid for 60 seconds.