fix(no-link regression): fix attempt to change no-link that made it worse

Chasesomero
Mar 14, 2026, 9:38 PM
XK25E73FDP7K7BN636MKHFSC3NAD6F3P4NNYQNCHC7GNDE7VGPXQC

Dependencies

  • [2] 4KJ45IJL Implement new identity management
  • [3] FOCBVLOU Implement testing for identity management
  • [4] 4OJWMSOW Fully replace crate::Identity
  • [5] 6FRPUHWK Fix identity tests
  • [6] DOEG3V7U Only re-write identity data when changed
  • [7] 44RUBHRE Only re-prove identity when credentials change
  • [8] 5Z2Y7VGV Migrate `pijul::identity::Complete::prove` to `pijul::remote::prove`
  • [9] HJVWPKWV Migrate crates to edition 2024
  • [10] N26HD5PF Replace `chrono` with `jiff`
  • [11] PPP22VRJ Remove `exitcode` dependency
  • [12] MBIKZPCC Add flags to disable the use of the system keyring, asking to prompt the key password directly instead
  • [13] YW6NICQV Migrate codebase to refactored `pijul_config` crate
  • [14] HGJETVAN Create `pijul_config::global_config_directory()`
  • [15] 7JTKP74V Fixing a conflict
  • [16] VQCREHLR Resolve conflicts in identity creation
  • [17] Y6TBQN7M Automatically format `pijul` crate
  • [18] 32G3GOK7 Migrate from `dialoguer` to `pijul-interaction`
  • [19] HKHMES6T Solving conflicts
  • [20] FVQYZQFL Create dialoguer themes based on global config
  • [21] UMCUSKIV Fixing conflicts
  • [22] LZOGKBJX new command `pijul client` for authenticating to a HTTP server
  • [23] Z4PPQZUG Refactor `pijul-config` to support layered configuration
  • [24] ZPLT3HRL Fix error in identity new by skipping any prompting when no-prompt is set
  • [25] WTPFQPO5 Add global `no_prompt` flag
  • [26] BWR2D2HJ Resolve conflict-order hunks
  • [27] WQ2GJPJW Make tests compile
  • [28] EJTDPXGX Move `pijul_config::shell_cmd` to `pijul_remote`
  • [29] H4AU6QRP New config for HTTP remotes
  • [30] VL7ZYKHB Running hooks through shell on Windows and Unix
  • [31] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [32] 4RV7T4SR Migrate from `pijul::config` to `pijul-config`
  • [33] QWIYNMI5 Formatting + big-endian Sanakirja

Change contents

  • replacement in pijul-identity/src/create.rs at line 7
    [2.28402][9.1589:1618]()
    use anyhow::{Context, bail};
    [2.28402]
    [10.292]
    use anyhow::{Context, anyhow, bail};
  • edit in pijul-identity/src/create.rs at line 20
    [16.807]
    [2.28954]
    pub fn parse_expiry_date(input: &str) -> Result<Timestamp, anyhow::Error> {
    input
    .parse()
    .or_else(|_| format!("{input}T00:00:00Z").parse())
    .map_err(|_| anyhow!("Invalid date"))
    }
  • replacement in pijul-identity/src/create.rs at line 112
    [7.306][8.1368:1393](),[8.1393][13.6923:6960](),[13.6960][8.1424:1568](),[8.1424][8.1424:1568](),[8.1568][7.841:855](),[7.841][7.841:855](),[7.855][13.6961:7020](),[13.7020][8.1622:1926](),[8.1622][8.1622:1926](),[8.1926][7.1505:1519](),[7.1505][7.1505:1519]()
    if link_remote {
    if Confirm::new(config)?
    .with_prompt("Do you want to link this identity to a remote?")
    .with_default(true)
    .interact()?
    {
    new_identity.prompt_remote(config).await?;
    } else {
    // The user wants an 'offline' identity, so make sure not to store login info
    new_identity.config.key_path = None;
    new_identity.config.author.username = String::new();
    new_identity.config.author.origin = String::new();
    }
    [7.306]
    [4.10782]
    if !link_remote {
    // The user wants an 'offline' identity, so make sure not to store login info
    new_identity.config.key_path = None;
    new_identity.config.author.username = String::new();
    new_identity.config.author.origin = String::new();
    } else if Confirm::new(config)?
    .with_prompt("Do you want to link this identity to a remote?")
    .with_default(true)
    .interact()?
    {
    new_identity.prompt_remote(config).await?;
    } else {
    // The user wants an 'offline' identity, so make sure not to store login info
    new_identity.config.key_path = None;
    new_identity.config.author.username = String::new();
    new_identity.config.author.origin = String::new();
  • replacement in pijul-identity/src/create.rs at line 226
    [10.631][10.631:807]()
    let expiry_date: Timestamp = input
    .parse()
    .map_err(|error| format!("Unable to parse date: {error:#?}"))?;
    [10.631]
    [2.32308]
    let expiry_date =
    parse_expiry_date(input).map_err(|_| "Invalid date".to_string())?;
  • replacement in pijul-identity/src/create.rs at line 237
    [2.32647][10.929:968]()
    Some(expiry_date.parse()?)
    [2.32647]
    [2.32780]
    Some(parse_expiry_date(&expiry_date)?)
  • edit in pijul-identity/src/create.rs at line 281
    [13.7759][16.808:903]()
    /// * `params.link_remote` - Override if the identity should be exchanged with the remote.
  • replacement in pijul-identity/src/create.rs at line 326
    [6.1857][6.1857:1909]()
    if self.config != new_identity.config {
    [6.1857]
    [6.1909]
    if self.config != new_identity.config
    || self.public_key != new_identity.public_key
    || self.last_modified != new_identity.last_modified
    {
  • edit in pijul-config/src/lib.rs at line 242
    [14.1340][14.1340:1394]()
    .map(|directory| directory.join(CONFIG_FILE))
  • edit in pijul/tests/common/identity.rs at line 6
    [3.17928]
    [3.17928]
    time::Duration,
  • replacement in pijul/tests/common/identity.rs at line 10
    [3.17951][3.17951:17988]()
    use expectrl::{Session, WaitStatus};
    [3.17951]
    [10.992]
    use expectrl::{Eof, Session, WaitStatus};
  • edit in pijul/tests/common/identity.rs at line 72
    [3.19586]
    [3.19586]
    fn uses_no_link(&self) -> bool {
    self.login.is_none() && self.origin.is_none() && self.key_path.is_none()
    }
  • replacement in pijul/tests/common/identity.rs at line 128
    [3.21151][3.21151:21217]()
    generate_command(&config_path, &SubCommand::New),
    [3.21151]
    [3.21217]
    generate_command(&config_path, &SubCommand::New, existing_id.uses_no_link()),
  • edit in pijul/tests/common/identity.rs at line 379
    [3.28152]
    [5.2896]
    if self.uses_no_link() {
    session.set_expect_timeout(Some(Duration::from_secs(1)));
    session.expect(Eof)?;
    return Ok(session.get_process().wait()?);
    }
  • replacement in pijul/tests/common/identity.rs at line 436
    [3.30117][3.30117:30242]()
    let cli_status =
    self.run_cli_edit(generate_command(&self.config_path, subcmd), false, subcmd)?;
    [3.30117]
    [11.31]
    let cli_status = self.run_cli_edit(
    generate_command(&self.config_path, subcmd, self.uses_no_link()),
    false,
    subcmd,
    )?;
  • replacement in pijul/tests/common/identity.rs at line 446
    [3.30432][3.30432:30548]()
    let cli_status =
    self.run_cli_edit(generate_command(&self.config_path, subcmd), true, subcmd)?;
    [3.30432]
    [11.113]
    let cli_status = self.run_cli_edit(
    generate_command(&self.config_path, subcmd, self.uses_no_link()),
    true,
    subcmd,
    )?;
  • replacement in pijul/tests/common/identity.rs at line 456
    [3.30751][3.30751:30869]()
    let interactive_status =
    self.run_interactive_edit(generate_command(&self.config_path, subcmd))?;
    [3.30751]
    [3.30869]
    let interactive_status = self.run_interactive_edit(generate_command(
    &self.config_path,
    subcmd,
    self.uses_no_link(),
    ))?;
  • replacement in pijul/tests/common/identity.rs at line 479
    [3.31440][3.31440:31517]()
    let pijul_cmd = generate_command(&self.config_path, subcmd);
    [3.31440]
    [3.31517]
    let pijul_cmd = generate_command(&self.config_path, subcmd, false);
  • replacement in pijul/tests/common/identity.rs at line 516
    [3.32589][3.32589:32666]()
    fn generate_command(config_path: &PathBuf, subcmd: &SubCommand) -> Command {
    [3.32589]
    [3.32666]
    fn generate_command(config_path: &PathBuf, subcmd: &SubCommand, no_link: bool) -> Command {
  • replacement in pijul/tests/common/identity.rs at line 524
    [3.32897][3.32897:32950]()
    if subcommand == "edit" || subcommand == "new" {
    [3.32897]
    [3.32950]
    if no_link && (subcommand == "edit" || subcommand == "new") {
  • replacement in pijul/src/commands/identity.rs at line 339
    [8.1972][15.2644:2898](),[15.2898][12.3326:3344](),[12.3326][12.3326:3344](),[12.3344][15.2899:2899](),[15.2899][9.4055:4473](),[12.3344][9.4055:4473](),[13.13915][9.4055:4473](),[8.2063][9.4055:4473](),[9.4473][8.2411:2515](),[8.2411][8.2411:2515]()
    if let Err(_) = remote::prove(
    config,
    &identity,
    None,
    self.no_cert_check,
    !options.no_keyring,
    )
    .await
    {
    warn!(
    "Could not prove identity `{}`. Please check your credentials & network connection. If you are on an enterprise network, perhaps try running with `--no-cert-check`. Your data is safe but will not be connected to {} without runnning `pijul identity prove {}`",
    identity.name, identity.config.author.origin, identity.name
    );
    } else {
    info!("Identity `{}` was proved to the server", identity);
    [8.1972]
    [8.2515]
    if !options.no_link {
    if let Err(_) = remote::prove(
    config,
    &identity,
    None,
    self.no_cert_check,
    !options.no_keyring,
    )
    .await
    {
    warn!(
    "Could not prove identity `{}`. Please check your credentials & network connection. If you are on an enterprise network, perhaps try running with `--no-cert-check`. Your data is safe but will not be connected to {} without runnning `pijul identity prove {}`",
    identity.name, identity.config.author.origin, identity.name
    );
    } else {
    info!("Identity `{}` was proved to the server", identity);
    }