Skip to content

Commit

Permalink
orb-qr-link: Support informing the app for self-serve status (#225)
Browse files Browse the repository at this point in the history
Support informing the app for self-serve status
  • Loading branch information
andronat authored Sep 18, 2024
1 parent 05a5fc1 commit cdf1774
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion orb-qr-link/src/user_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ pub struct UserData {
/// Personal Custody Package version.
#[serde(default = "pcp_version_default")]
pub pcp_version: u16,
/// Whether the app should perform a app-centric signup.
/// Whether the orb should perform a app-centric signup.
#[serde(default = "default_false")]
pub user_centric_signup: bool,
/// Whether the orb should inform the app about if self-serve signup flow is enabled or not.
#[serde(default = "default_false")]
pub inform_app_of_self_serve_status: bool,
}

/// User's biometric data policy. Part of [`UserData`].
Expand Down Expand Up @@ -61,6 +64,7 @@ impl UserData {
data_policy,
pcp_version,
user_centric_signup,
inform_app_of_self_serve_status,
} = self;
hasher.update(identity_commitment.as_bytes());
hasher.update(self_custody_public_key.as_bytes());
Expand All @@ -71,6 +75,9 @@ impl UserData {
if *user_centric_signup {
hasher.update(&[true as u8]);
}
if *inform_app_of_self_serve_status {
hasher.update(&[true as u8]);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions orb-qr-link/tests/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MCowBQYDK2VuAyEA2boNBmJX4lGkA9kjthS5crXOBxu2BPycKRMakpzgLG4=
data_policy: DataPolicy::OptOut,
pcp_version: 3,
user_centric_signup: true,
inform_app_of_self_serve_status: true,
};
let qr = encode_qr(&session_id, user_data.hash(16));
let (parsed_session_id, parsed_user_data_hash) = decode_qr(&qr).unwrap();
Expand Down

0 comments on commit cdf1774

Please sign in to comment.