fix(no-link regression): fix attempt to change no-link that made it worse
Dependencies
- [2]
4KJ45IJLImplement new identity management - [3]
FOCBVLOUImplement testing for identity management - [4]
4OJWMSOWFully replace crate::Identity - [5]
6FRPUHWKFix identity tests - [6]
DOEG3V7UOnly re-write identity data when changed - [7]
44RUBHREOnly re-prove identity when credentials change - [8]
5Z2Y7VGVMigrate `pijul::identity::Complete::prove` to `pijul::remote::prove` - [9]
HJVWPKWVMigrate crates to edition 2024 - [10]
N26HD5PFReplace `chrono` with `jiff` - [11]
PPP22VRJRemove `exitcode` dependency - [12]
MBIKZPCCAdd flags to disable the use of the system keyring, asking to prompt the key password directly instead - [13]
YW6NICQVMigrate codebase to refactored `pijul_config` crate - [14]
HGJETVANCreate `pijul_config::global_config_directory()` - [15]
7JTKP74VFixing a conflict - [16]
VQCREHLRResolve conflicts in identity creation - [17]
Y6TBQN7MAutomatically format `pijul` crate - [18]
32G3GOK7Migrate from `dialoguer` to `pijul-interaction` - [19]
HKHMES6TSolving conflicts - [20]
FVQYZQFLCreate dialoguer themes based on global config - [21]
UMCUSKIVFixing conflicts - [22]
LZOGKBJXnew command `pijul client` for authenticating to a HTTP server - [23]
Z4PPQZUGRefactor `pijul-config` to support layered configuration - [24]
ZPLT3HRLFix error in identity new by skipping any prompting when no-prompt is set - [25]
WTPFQPO5Add global `no_prompt` flag - [26]
BWR2D2HJResolve conflict-order hunks - [27]
WQ2GJPJWMake tests compile - [28]
EJTDPXGXMove `pijul_config::shell_cmd` to `pijul_remote` - [29]
H4AU6QRPNew config for HTTP remotes - [30]
VL7ZYKHBRunning hooks through shell on Windows and Unix - [31]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [32]
4RV7T4SRMigrate from `pijul::config` to `pijul-config` - [33]
QWIYNMI5Formatting + big-endian Sanakirja
Change contents
- replacement in pijul-identity/src/create.rs at line 7
use anyhow::{Context, bail};use anyhow::{Context, anyhow, bail}; - edit in pijul-identity/src/create.rs at line 20
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 infonew_identity.config.key_path = None;new_identity.config.author.username = String::new();new_identity.config.author.origin = String::new();}if !link_remote {// The user wants an 'offline' identity, so make sure not to store login infonew_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 infonew_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
let expiry_date: Timestamp = input.parse().map_err(|error| format!("Unable to parse date: {error:#?}"))?;let expiry_date =parse_expiry_date(input).map_err(|_| "Invalid date".to_string())?; - replacement in pijul-identity/src/create.rs at line 237
Some(expiry_date.parse()?)Some(parse_expiry_date(&expiry_date)?) - edit in pijul-identity/src/create.rs at line 281
/// * `params.link_remote` - Override if the identity should be exchanged with the remote. - replacement in pijul-identity/src/create.rs at line 326
if self.config != new_identity.config {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
.map(|directory| directory.join(CONFIG_FILE)) - edit in pijul/tests/common/identity.rs at line 6
time::Duration, - replacement in pijul/tests/common/identity.rs at line 10
use expectrl::{Session, WaitStatus};use expectrl::{Eof, Session, WaitStatus}; - edit in pijul/tests/common/identity.rs at line 72
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
generate_command(&config_path, &SubCommand::New),generate_command(&config_path, &SubCommand::New, existing_id.uses_no_link()), - edit in pijul/tests/common/identity.rs at line 379
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
let cli_status =self.run_cli_edit(generate_command(&self.config_path, subcmd), false, subcmd)?;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
let cli_status =self.run_cli_edit(generate_command(&self.config_path, subcmd), true, subcmd)?;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
let interactive_status =self.run_interactive_edit(generate_command(&self.config_path, subcmd))?;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
let pijul_cmd = generate_command(&self.config_path, subcmd);let pijul_cmd = generate_command(&self.config_path, subcmd, false); - replacement in pijul/tests/common/identity.rs at line 516
fn generate_command(config_path: &PathBuf, subcmd: &SubCommand) -> Command {fn generate_command(config_path: &PathBuf, subcmd: &SubCommand, no_link: bool) -> Command { - replacement in pijul/tests/common/identity.rs at line 524
if subcommand == "edit" || subcommand == "new" {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);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);}