pub trait Cupv2RequestHandler {
// Required methods
fn decorate_request(
&self,
request: &mut impl CupRequest,
) -> Result<RequestMetadata, CupDecorationError>;
fn verify_response(
&self,
request_metadata: &RequestMetadata,
resp: &Response<Vec<u8>>,
public_key_id: PublicKeyId,
) -> Result<DerSignature, CupVerificationError>;
}
Required Methods§
Sourcefn decorate_request(
&self,
request: &mut impl CupRequest,
) -> Result<RequestMetadata, CupDecorationError>
fn decorate_request( &self, request: &mut impl CupRequest, ) -> Result<RequestMetadata, CupDecorationError>
Decorate an outgoing client request with query parameters cup2key
.
Returns a struct of request metadata, the hash of which can be stored and
used later.
Sourcefn verify_response(
&self,
request_metadata: &RequestMetadata,
resp: &Response<Vec<u8>>,
public_key_id: PublicKeyId,
) -> Result<DerSignature, CupVerificationError>
fn verify_response( &self, request_metadata: &RequestMetadata, resp: &Response<Vec<u8>>, public_key_id: PublicKeyId, ) -> Result<DerSignature, CupVerificationError>
Examines an incoming client request with an ETag HTTP Header. Returns an error if the response is not authentic.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.