pub struct MockCupv2Handler { /* private fields */ }
Implementations§
Source§impl MockCupv2Handler
impl MockCupv2Handler
pub fn new() -> MockCupv2Handler
pub fn set_decoration_error( self, e: fn() -> Option<CupDecorationError>, ) -> MockCupv2Handler
pub fn set_verification_error( self, e: fn() -> Option<CupVerificationError>, ) -> MockCupv2Handler
Trait Implementations§
Source§impl Cupv2RequestHandler for MockCupv2Handler
impl Cupv2RequestHandler for MockCupv2Handler
Source§fn 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.Source§fn 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.
Source§impl Cupv2Verifier for MockCupv2Handler
impl Cupv2Verifier for MockCupv2Handler
Source§fn verify_response_with_signature(
&self,
_ecdsa_signature: &DerSignature,
_request_body: &[u8],
_response_body: &[u8],
_public_key_id: PublicKeyId,
_nonce: &Nonce,
) -> Result<(), CupVerificationError>
fn verify_response_with_signature( &self, _ecdsa_signature: &DerSignature, _request_body: &[u8], _response_body: &[u8], _public_key_id: PublicKeyId, _nonce: &Nonce, ) -> Result<(), CupVerificationError>
The same behavior as verify_response, but designed for verifying stored
signatures which are not hyper-aware.
Auto Trait Implementations§
impl Freeze for MockCupv2Handler
impl RefUnwindSafe for MockCupv2Handler
impl Send for MockCupv2Handler
impl Sync for MockCupv2Handler
impl Unpin for MockCupv2Handler
impl UnwindSafe for MockCupv2Handler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more