Skip to content

Commit

Permalink
fix(cli): remove test only relevant to v1 branch, adjust migration te…
Browse files Browse the repository at this point in the history
…st (#8451)
  • Loading branch information
lucasfernog authored Dec 20, 2023
1 parent 41990cd commit 7e4580a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
16 changes: 0 additions & 16 deletions tooling/cli/src/helpers/updater_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,3 @@ where
.map_err(|e| minisign::PError::new(minisign::ErrorKind::Io, e))?;
Ok(BufReader::new(file))
}

#[cfg(test)]
mod tests {
const PRIVATE_KEY: &str = "dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5dkpDN09RZm5GeVAzc2RuYlNzWVVJelJRQnNIV2JUcGVXZUplWXZXYXpqUUFBQkFBQUFBQUFBQUFBQUlBQUFBQTZrN2RnWGh5dURxSzZiL1ZQSDdNcktiaHRxczQwMXdQelRHbjRNcGVlY1BLMTBxR2dpa3I3dDE1UTVDRDE4MXR4WlQwa1BQaXdxKy9UU2J2QmVSNXhOQWFDeG1GSVllbUNpTGJQRkhhTnROR3I5RmdUZi90OGtvaGhJS1ZTcjdZU0NyYzhQWlQ5cGM9Cg==";

// we use minisign=0.7.3 to prevent a breaking change
#[test]
fn empty_password_is_valid() {
let path = std::env::temp_dir().join("minisign-password-text.txt");
std::fs::write(&path, b"TAURI").expect("failed to write test file");

let secret_key =
super::secret_key(PRIVATE_KEY.into(), Some("".into())).expect("failed to resolve secret key");
super::sign_file(&secret_key, &path).expect("failed to sign file");
}
}
16 changes: 12 additions & 4 deletions tooling/cli/src/migrate/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,12 @@ mod test {

// fs scope
assert_eq!(
migrated["plugins"]["fs"]["scope"],
original["tauri"]["allowlist"]["fs"]["scope"]
migrated["plugins"]["fs"]["scope"]["allow"],
original["tauri"]["allowlist"]["fs"]["scope"]["allow"]
);
assert_eq!(
migrated["plugins"]["fs"]["scope"]["deny"],
original["tauri"]["allowlist"]["fs"]["scope"]["deny"]
);

// shell scope
Expand All @@ -323,8 +327,12 @@ mod test {
original["tauri"]["allowlist"]["protocol"]["asset"]
);
assert_eq!(
migrated["tauri"]["security"]["assetProtocol"]["scope"],
original["tauri"]["allowlist"]["protocol"]["assetScope"]
migrated["tauri"]["security"]["assetProtocol"]["scope"]["allow"],
original["tauri"]["allowlist"]["protocol"]["assetScope"]["allow"]
);
assert_eq!(
migrated["tauri"]["security"]["assetProtocol"]["scope"]["deny"],
original["tauri"]["allowlist"]["protocol"]["assetScope"]["deny"]
);

// security CSP
Expand Down

0 comments on commit 7e4580a

Please sign in to comment.