Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor documentation fixes #146

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 18 additions & 24 deletions src/identities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ impl OwnUserIdentity {
Ok(serde_json::to_string(self_signing_key)?)
}

/// Get the user-signing key of the identity, this is only present for our
/// own user identity..
/// Get the user-signing key of the identity. This is only present for our
/// own user identity.
#[wasm_bindgen(getter, js_name = "userSigningKey")]
pub fn user_signing_key(&self) -> Result<String, JsError> {
let user_signing_key = self.inner.user_signing_key().as_ref();
Expand All @@ -119,16 +119,15 @@ impl OwnUserIdentity {

/// True if we verified our own identity at some point in the past.
///
/// To reset this latch back to `false`, one must call
/// [`OwnUserIdentity::withdraw_verification()`].
/// To reset this latch back to `false`, call {@link withdrawVerification}.
#[wasm_bindgen(js_name = wasPreviouslyVerified)]
pub fn was_previously_verified(&self) -> bool {
self.inner.was_previously_verified()
}

/// Remove the requirement for this identity to be verified.
///
/// If an identity was previously verified and is not any more it will be
/// If an identity was previously verified and is not any longer, it will be
/// reported to the user. In order to remove this notice users have to
/// verify again or to withdraw the verification requirement.
#[wasm_bindgen(js_name = "withdrawVerification")]
Expand All @@ -146,10 +145,9 @@ impl OwnUserIdentity {
/// Such a violation should be reported to the local user by the
/// application, and resolved by
///
/// - Verifying the new identity with
/// [`OwnUserIdentity::request_verification`]
/// - Or by withdrawing the verification requirement
/// [`OwnUserIdentity::withdraw_verification`].
/// - Verifying the new identity with {@link requestVerification}, or:
/// - Withdrawing the verification requirement with {@link
/// withdrawVerification}.
#[wasm_bindgen(js_name = "hasVerificationViolation")]
pub fn has_verification_violation(&self) -> bool {
self.inner.has_verification_violation()
Expand Down Expand Up @@ -258,20 +256,17 @@ impl UserIdentity {
})
}

/// Did the identity change after an initial observation in a way that
/// requires approval from the user?
/// Has the identity changed in a way that requires approval from the user?
///
/// A user identity needs approval if it changed after the crypto machine
/// has already observed ("pinned") a different identity for that user *and*
/// it is not an explicitly verified identity (using for example interactive
/// verification).
/// has already observed ("pinned") a different identity for that user,
/// unless it is an explicitly verified identity (using for example
/// interactive verification).
///
/// Such a change is to be considered a pinning violation which the
/// application should report to the local user, and can be resolved by:
/// This situation can be resolved by:
///
/// - Verifying the new identity with [`UserIdentity::request_verification`]
/// - Or by updating the pin to the new identity with
/// [`UserIdentity::pin_current_master_key`].
/// - Verifying the new identity with {@link requestVerification}, or:
/// - Updating the pin to the new identity with {@link pinCurrentMasterKey}.
#[wasm_bindgen(js_name = "identityNeedsUserApproval")]
pub fn identity_needs_user_approval(&self) -> bool {
self.inner.identity_needs_user_approval()
Expand All @@ -280,8 +275,7 @@ impl UserIdentity {
/// True if we verified this identity (with any own identity, at any
/// point).
///
/// To pass this latch back to false, one must call
/// [`UserIdentity::withdraw_verification()`].
/// To set this latch back to false, call {@link withdrawVerification}.
#[wasm_bindgen(js_name = "wasPreviouslyVerified")]
pub fn was_previously_verified(&self) -> bool {
self.inner.was_previously_verified()
Expand All @@ -307,9 +301,9 @@ impl UserIdentity {
/// Such a violation should be reported to the local user by the
/// application, and resolved by
///
/// - Verifying the new identity with [`UserIdentity::request_verification`]
/// - Or by withdrawing the verification requirement
/// [`UserIdentity::withdraw_verification`].
/// - Verifying the new identity with {@link requestVerification}, or:
/// - Withdrawing the verification requirement with {@link
/// withdrawVerification}.
#[wasm_bindgen(js_name = "hasVerificationViolation")]
pub fn has_verification_violation(&self) -> bool {
self.inner.has_verification_violation()
Expand Down
10 changes: 0 additions & 10 deletions src/vodozemac/ecies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,6 @@ impl CheckCode {
///
/// The number should be displayed with a leading 0 in case the first digit
/// is a 0.
///
/// # Examples
///
/// ```no_run
/// # use vodozemac::ecies::CheckCode;
/// # let check_code: CheckCode = unimplemented!();
/// let check_code = check_code.to_digit();
///
/// println!("The check code of the IECS channel is: {check_code:02}");
/// ```
pub fn to_digit(&self) -> u8 {
self.inner.to_digit()
}
Expand Down
Loading