Handle absence of keyring for password creation

finchie
Nov 26, 2022, 7:15 AM
KWD6K4F73WZGP7GZLKZHXF7364QNCVNFWEYCCLFPQINMLPZBTWAQC

Dependencies

  • [2] V6IKXSCF Forgot to record a `use`
  • [3] 4OJWMSOW Fully replace crate::Identity
  • [4] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [5] L2VH4BYK Downloading changelists from channels without an id (Nest discussions)
  • [6] 4KJ45IJL Implement new identity management
  • [7] DWSAYGVE Update codebase to use new identity management
  • [8] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [9] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [10] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 14
    [4.38][2.0:38]()
    use log::{debug, error, info, trace};
    [4.38]
    [4.276]
    use log::{debug, error, info, trace, warn};
  • replacement in pijul/src/remote/ssh.rs at line 251
    [4.3514][4.3514:3848]()
    match keyring::Entry::new("pijul", &username).set_password(&password) {
    Err(e) => writeln!(
    std::io::stderr(),
    "Warning: could not write new password to keychain: {e}"
    )
    .unwrap(),
    _ => (),
    [4.3514]
    [4.32203]
    if let Err(e) = keyring::Entry::new("pijul", &username).set_password(&password) {
    warn!("Unable to set password: {e:?}");
  • edit in pijul/src/identity/mod.rs at line 43
    [3.1969]
    [4.17069]
    use log::warn;
  • replacement in pijul/src/identity/mod.rs at line 148
    [3.4743][3.4743:4824]()
    keyring::Entry::new("pijul", name).set_password(&password_attempt)?;
    [3.4743]
    [3.4824]
    if let Err(e) = keyring::Entry::new("pijul", name).set_password(&password_attempt) {
    warn!("Unable to set password: {e:?}");
    }
  • replacement in pijul/src/identity/mod.rs at line 269
    [3.7658][3.7658:7742]()
    keyring::Entry::new("pijul", &self.name).set_password(&user_password)?;
    [3.7658]
    [3.7742]
    if let Err(e) = keyring::Entry::new("pijul", &self.name).set_password(&user_password) {
    warn!("Unable to set password: {e:?}");
    }
  • replacement in pijul/src/identity/create.rs at line 366
    [3.14270][4.40520:40598](),[4.40520][4.40520:40598]()
    Entry::new("pijul", &new_identity.name).set_password(&password)?;
    [3.14270]
    [4.40598]
    if let Err(e) = Entry::new("pijul", &new_identity.name).set_password(&password) {
    warn!("Unable to set password: {e:?}");
    }