diff --git a/crates/robonode-client/src/authenticate.rs b/crates/robonode-client/src/authenticate.rs index b38648d3a..33d9e9446 100644 --- a/crates/robonode-client/src/authenticate.rs +++ b/crates/robonode-client/src/authenticate.rs @@ -268,41 +268,21 @@ mod tests { "AUTHENTICATE_PERSON_NOT_FOUND", AuthenticateError::PersonNotFoundNoBlob, ), - ( - StatusCode::NOT_FOUND, - "AUTHENTICATE_PERSON_NOT_FOUND", - AuthenticateError::PersonNotFound("scan result blob".to_owned()), - ), ( StatusCode::FORBIDDEN, "AUTHENTICATE_FACE_SCAN_REJECTED", AuthenticateError::FaceScanRejectedNoBlob, ), - ( - StatusCode::FORBIDDEN, - "AUTHENTICATE_FACE_SCAN_REJECTED", - AuthenticateError::FaceScanRejected("scan result blob".to_owned()), - ), ( StatusCode::FORBIDDEN, "AUTHENTICATE_SIGNATURE_INVALID", AuthenticateError::SignatureInvalidNoBlob, ), - ( - StatusCode::FORBIDDEN, - "AUTHENTICATE_SIGNATURE_INVALID", - AuthenticateError::SignatureInvalid("scan result blob".to_owned()), - ), ( StatusCode::INTERNAL_SERVER_ERROR, "LOGIC_INTERNAL_ERROR", AuthenticateError::LogicInternalNoBlob, ), - ( - StatusCode::INTERNAL_SERVER_ERROR, - "LOGIC_INTERNAL_ERROR", - AuthenticateError::LogicInternal("scan result blob".to_owned()), - ), ( StatusCode::BAD_REQUEST, "MY_ERR_CODE", @@ -345,41 +325,21 @@ mod tests { "AUTHENTICATE_INVALID_LIVENESS_DATA", AuthenticateError::InvalidLivenessData, ), - ( - StatusCode::NOT_FOUND, - "AUTHENTICATE_PERSON_NOT_FOUND", - AuthenticateError::PersonNotFoundNoBlob, - ), ( StatusCode::NOT_FOUND, "AUTHENTICATE_PERSON_NOT_FOUND", AuthenticateError::PersonNotFound("scan result blob".to_owned()), ), - ( - StatusCode::FORBIDDEN, - "AUTHENTICATE_FACE_SCAN_REJECTED", - AuthenticateError::FaceScanRejectedNoBlob, - ), ( StatusCode::FORBIDDEN, "AUTHENTICATE_FACE_SCAN_REJECTED", AuthenticateError::FaceScanRejected("scan result blob".to_owned()), ), - ( - StatusCode::FORBIDDEN, - "AUTHENTICATE_SIGNATURE_INVALID", - AuthenticateError::SignatureInvalidNoBlob, - ), ( StatusCode::FORBIDDEN, "AUTHENTICATE_SIGNATURE_INVALID", AuthenticateError::SignatureInvalid("scan result blob".to_owned()), ), - ( - StatusCode::INTERNAL_SERVER_ERROR, - "LOGIC_INTERNAL_ERROR", - AuthenticateError::LogicInternalNoBlob, - ), ( StatusCode::INTERNAL_SERVER_ERROR, "LOGIC_INTERNAL_ERROR", @@ -400,8 +360,8 @@ mod tests { liveness_data_signature: b"123", }; - let response = - ResponseTemplate::new(case.0).set_body_json(mkerr_containing_blob(case.1, "blob")); + let response = ResponseTemplate::new(case.0) + .set_body_json(mkerr_containing_blob(case.1, "scan result blob")); Mock::given(matchers::method("POST")) .and(matchers::path("/authenticate")) diff --git a/crates/robonode-client/src/enroll.rs b/crates/robonode-client/src/enroll.rs index c09c43f29..0ecbd7592 100644 --- a/crates/robonode-client/src/enroll.rs +++ b/crates/robonode-client/src/enroll.rs @@ -15,8 +15,8 @@ impl Client { let res = self.reqwest.post(url).json(&req).send().await?; match res.status() { StatusCode::CREATED if res.content_length() == Some(0) => Ok(EnrollResponse { - scan_result_blob: None, - }) + scan_result_blob: None, + }), StatusCode::CREATED => Ok(res.json().await?), status => Err(Error::Call(EnrollError::from_response( status, @@ -222,11 +222,6 @@ mod tests { "ENROLL_FACE_SCAN_REJECTED", EnrollError::FaceScanRejectedNoBlob, ), - ( - StatusCode::FORBIDDEN, - "ENROLL_FACE_SCAN_REJECTED", - EnrollError::FaceScanRejected("scan result blob".to_owned()), - ), ( StatusCode::CONFLICT, "ENROLL_PUBLIC_KEY_ALREADY_USED", @@ -237,21 +232,11 @@ mod tests { "ENROLL_PERSON_ALREADY_ENROLLED", EnrollError::PersonAlreadyEnrolledNoBlob, ), - ( - StatusCode::CONFLICT, - "ENROLL_PERSON_ALREADY_ENROLLED", - EnrollError::PersonAlreadyEnrolled("scan result blob".to_owned()), - ), ( StatusCode::INTERNAL_SERVER_ERROR, "LOGIC_INTERNAL_ERROR", EnrollError::LogicInternalNoBlob, ), - ( - StatusCode::INTERNAL_SERVER_ERROR, - "LOGIC_INTERNAL_ERROR", - EnrollError::LogicInternal("scan result blob".to_owned()), - ), ( StatusCode::BAD_REQUEST, "MY_ERR_CODE", @@ -300,11 +285,6 @@ mod tests { "ENROLL_INVALID_LIVENESS_DATA", EnrollError::InvalidLivenessData, ), - ( - StatusCode::FORBIDDEN, - "ENROLL_FACE_SCAN_REJECTED", - EnrollError::FaceScanRejectedNoBlob, - ), ( StatusCode::FORBIDDEN, "ENROLL_FACE_SCAN_REJECTED", @@ -315,21 +295,11 @@ mod tests { "ENROLL_PUBLIC_KEY_ALREADY_USED", EnrollError::PublicKeyAlreadyUsed, ), - ( - StatusCode::CONFLICT, - "ENROLL_PERSON_ALREADY_ENROLLED", - EnrollError::PersonAlreadyEnrolledNoBlob, - ), ( StatusCode::CONFLICT, "ENROLL_PERSON_ALREADY_ENROLLED", EnrollError::PersonAlreadyEnrolled("scan result blob".to_owned()), ), - ( - StatusCode::INTERNAL_SERVER_ERROR, - "LOGIC_INTERNAL_ERROR", - EnrollError::LogicInternalNoBlob, - ), ( StatusCode::INTERNAL_SERVER_ERROR, "LOGIC_INTERNAL_ERROR", @@ -351,8 +321,8 @@ mod tests { public_key: b"123", }; - let response = - ResponseTemplate::new(case.0).set_body_json(mkerr_containing_blob(case.1, "blob")); + let response = ResponseTemplate::new(case.0) + .set_body_json(mkerr_containing_blob(case.1, "scan result blob")); Mock::given(matchers::method("POST")) .and(matchers::path("/enroll"))