-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/cargo/anyhow-1.0.88
- Loading branch information
Showing
18 changed files
with
247 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//! The RPC request and response data, excluding errors. | ||
|
||
/// The parameters necessary to initialize the FaceTec Device SDK. | ||
pub type FacetecDeviceSdkParams = serde_json::Map<String, serde_json::Value>; | ||
|
||
/// The bioauth status as used in the RPC. | ||
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] | ||
pub enum BioauthStatus<Timestamp> { | ||
/// When the status can't be determined, but there was no error. | ||
/// Can happen if the validator key is absent. | ||
Unknown, | ||
/// There is no active authentication for the currently used validator key. | ||
Inactive, | ||
/// There is an active authentication for the currently used validator key. | ||
Active { | ||
/// The timestamp when the authentication will expire. | ||
expires_at: Timestamp, | ||
}, | ||
} | ||
|
||
impl<T> From<bioauth_flow_api::BioauthStatus<T>> for BioauthStatus<T> { | ||
fn from(status: bioauth_flow_api::BioauthStatus<T>) -> Self { | ||
match status { | ||
bioauth_flow_api::BioauthStatus::Inactive => Self::Inactive, | ||
bioauth_flow_api::BioauthStatus::Active { expires_at } => Self::Active { expires_at }, | ||
} | ||
} | ||
} | ||
|
||
/// `enroll_v2` flow result. | ||
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct EnrollV2Result { | ||
/// Scan result blob. | ||
pub scan_result_blob: Option<String>, | ||
} | ||
|
||
/// `authenticate_v2` related flow result. | ||
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct AuthenticateV2Result { | ||
/// An opaque auth ticket generated for this authentication attempt. | ||
pub auth_ticket: Box<[u8]>, | ||
/// The robonode signature for this opaque auth ticket. | ||
pub auth_ticket_signature: Box<[u8]>, | ||
/// Scan result blob. | ||
pub scan_result_blob: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! Custom rpc error codes. | ||
|
||
/// Signer has failed. | ||
pub const SIGN: i32 = 100; | ||
|
||
/// Request to robonode has failed. | ||
pub const ROBONODE: i32 = 200; | ||
|
||
/// Call to runtime api has failed. | ||
pub const RUNTIME_API: i32 = 300; | ||
|
||
/// Authenticate transaction has failed. | ||
pub const TRANSACTION: i32 = 400; | ||
|
||
/// Validator key is not available. | ||
pub const MISSING_VALIDATOR_KEY: i32 = | ||
rpc_validator_key_logic::api_error_code::MISSING_VALIDATOR_KEY; | ||
|
||
/// Validator key extraction has failed. | ||
pub const VALIDATOR_KEY_EXTRACTION: i32 = | ||
rpc_validator_key_logic::api_error_code::VALIDATOR_KEY_EXTRACTION; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//! All bioauth flow error kinds that we expose in the RPC. | ||
|
||
pub mod code; | ||
pub mod data; | ||
pub mod shared; | ||
mod sign; | ||
|
||
pub use self::sign::Error as Sign; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.