diff --git a/.gitignore b/.gitignore index 5806118..d1be4a4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,6 @@ *.db *.db-* .env -dizey.key -dizey.toml +izlek.key +izlek.toml CLAUDE.md diff --git a/Cargo.lock b/Cargo.lock index bcd1294..c14b287 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,52 +964,6 @@ dependencies = [ "syn 3.0.4", ] -[[package]] -name = "dizey-core" -version = "0.1.0" -dependencies = [ - "argon2", - "async-trait", - "base64 0.22.1", - "chacha20poly1305", - "rand 0.10.2", - "serde", - "serde_json", - "sha2 0.11.0", - "subtle", - "thiserror", - "time", - "tokio", - "toml", - "turso", - "uuid", -] - -[[package]] -name = "dizey-web" -version = "0.1.0" -dependencies = [ - "async-trait", - "axum", - "console_error_panic_hook", - "dizey-core", - "leptos", - "leptos_axum", - "leptos_meta", - "leptos_router", - "lettre", - "serde", - "serde_json", - "thiserror", - "time", - "tokio", - "tower", - "tower-http 0.7.0", - "turso", - "uuid", - "wasm-bindgen", -] - [[package]] name = "downcast-rs" version = "2.0.2" @@ -1893,6 +1847,52 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "izlek-core" +version = "0.1.0" +dependencies = [ + "argon2", + "async-trait", + "base64 0.22.1", + "chacha20poly1305", + "rand 0.10.2", + "serde", + "serde_json", + "sha2 0.11.0", + "subtle", + "thiserror", + "time", + "tokio", + "toml", + "turso", + "uuid", +] + +[[package]] +name = "izlek-web" +version = "0.1.0" +dependencies = [ + "async-trait", + "axum", + "console_error_panic_hook", + "izlek-core", + "leptos", + "leptos_axum", + "leptos_meta", + "leptos_router", + "lettre", + "serde", + "serde_json", + "thiserror", + "time", + "tokio", + "tower", + "tower-http 0.7.0", + "turso", + "uuid", + "wasm-bindgen", +] + [[package]] name = "jobserver" version = "0.1.35" diff --git a/Cargo.toml b/Cargo.toml index d4beef4..ac070a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,15 @@ [workspace] resolver = "3" -members = ["crates/dizey-core", "crates/dizey-web"] +members = ["crates/izlek-core", "crates/izlek-web"] [workspace.package] version = "0.1.0" edition = "2024" license = "AGPL-3.0-or-later" -repository = "https://github.com/DizeyLab/izlek" +repository = "https://github.com/IzlekLab/izlek" [workspace.dependencies] -dizey-core = { path = "crates/dizey-core", default-features = false } +izlek-core = { path = "crates/izlek-core", default-features = false } serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.145" thiserror = "2.0.20" @@ -31,10 +31,10 @@ lto = true # cargo-leptos drives the two-target (server bin + wasm lib) build. [[workspace.metadata.leptos]] -name = "dizey" -bin-package = "dizey-web" -lib-package = "dizey-web" -output-name = "dizey" +name = "izlek" +bin-package = "izlek-web" +lib-package = "izlek-web" +output-name = "izlek" site-root = "target/site" site-pkg-dir = "pkg" style-file = "style/main.scss" diff --git a/crates/dizey-core/Cargo.toml b/crates/izlek-core/Cargo.toml similarity index 94% rename from crates/dizey-core/Cargo.toml rename to crates/izlek-core/Cargo.toml index e1bd903..ce28bd3 100644 --- a/crates/dizey-core/Cargo.toml +++ b/crates/izlek-core/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "dizey-core" +name = "izlek-core" version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true -description = "Domain model and storage for Dizey" +description = "Domain model and storage for Izlek" [features] # The domain vocabulary (roles, record shapes) compiles anywhere, including the diff --git a/crates/dizey-core/migrations/0001_init.sql b/crates/izlek-core/migrations/0001_init.sql similarity index 98% rename from crates/dizey-core/migrations/0001_init.sql rename to crates/izlek-core/migrations/0001_init.sql index db31924..e23bfcb 100644 --- a/crates/dizey-core/migrations/0001_init.sql +++ b/crates/izlek-core/migrations/0001_init.sql @@ -1,4 +1,4 @@ --- Dizey initial schema. +-- Izlek initial schema. -- -- Plain versioned SQL applied at boot: Turso has no migration runner of its -- own, and keeping the schema as SQL is what makes the store trait swappable. @@ -171,7 +171,7 @@ CREATE TABLE mail_send ( ); CREATE UNIQUE INDEX mail_send_once ON mail_send(rule_id, task_id, transition); --- Read-only links: dizey.sh/v/. Only the hash of the token is stored, so a +-- Read-only links: izlek.sh/v/. Only the hash of the token is stored, so a -- database copy does not hand out working links; revoking is server-side and -- immediate. CREATE TABLE view_link ( diff --git a/crates/dizey-core/migrations/0002_auth.sql b/crates/izlek-core/migrations/0002_auth.sql similarity index 100% rename from crates/dizey-core/migrations/0002_auth.sql rename to crates/izlek-core/migrations/0002_auth.sql diff --git a/crates/dizey-core/migrations/0003_transition.sql b/crates/izlek-core/migrations/0003_transition.sql similarity index 100% rename from crates/dizey-core/migrations/0003_transition.sql rename to crates/izlek-core/migrations/0003_transition.sql diff --git a/crates/dizey-core/migrations/0004_mail.sql b/crates/izlek-core/migrations/0004_mail.sql similarity index 100% rename from crates/dizey-core/migrations/0004_mail.sql rename to crates/izlek-core/migrations/0004_mail.sql diff --git a/crates/dizey-core/migrations/0005_freeing.sql b/crates/izlek-core/migrations/0005_freeing.sql similarity index 100% rename from crates/dizey-core/migrations/0005_freeing.sql rename to crates/izlek-core/migrations/0005_freeing.sql diff --git a/crates/dizey-core/migrations/0006_sender_is_config.sql b/crates/izlek-core/migrations/0006_sender_is_config.sql similarity index 93% rename from crates/dizey-core/migrations/0006_sender_is_config.sql rename to crates/izlek-core/migrations/0006_sender_is_config.sql index 77efdee..fcad583 100644 --- a/crates/dizey-core/migrations/0006_sender_is_config.sql +++ b/crates/izlek-core/migrations/0006_sender_is_config.sql @@ -6,8 +6,8 @@ -- database file that is copied for a backup carries it along. The sender is -- infrastructure, not workspace content — it is the same for everyone in the -- workspace, it changes when the deployment changes, and it is already read --- from `DIZEY_SMTP_HOST`, `DIZEY_SMTP_PORT`, `DIZEY_SMTP_USERNAME`, --- `DIZEY_SMTP_PASSWORD` and `DIZEY_MAIL_FROM` at boot. +-- from `IZLEK_SMTP_HOST`, `IZLEK_SMTP_PORT`, `IZLEK_SMTP_USERNAME`, +-- `IZLEK_SMTP_PASSWORD` and `IZLEK_MAIL_FROM` at boot. -- -- So the columns go. Settings shows what the process is configured with and -- says the password lives in the server's configuration; changing it means diff --git a/crates/dizey-core/migrations/0007_who_invited.sql b/crates/izlek-core/migrations/0007_who_invited.sql similarity index 100% rename from crates/dizey-core/migrations/0007_who_invited.sql rename to crates/izlek-core/migrations/0007_who_invited.sql diff --git a/crates/dizey-core/migrations/0008_sender_is_settings.sql b/crates/izlek-core/migrations/0008_sender_is_settings.sql similarity index 100% rename from crates/dizey-core/migrations/0008_sender_is_settings.sql rename to crates/izlek-core/migrations/0008_sender_is_settings.sql diff --git a/crates/dizey-core/migrations/0009_sender_test.sql b/crates/izlek-core/migrations/0009_sender_test.sql similarity index 100% rename from crates/dizey-core/migrations/0009_sender_test.sql rename to crates/izlek-core/migrations/0009_sender_test.sql diff --git a/crates/dizey-core/migrations/0010_attachments_live_in_the_file.sql b/crates/izlek-core/migrations/0010_attachments_live_in_the_file.sql similarity index 95% rename from crates/dizey-core/migrations/0010_attachments_live_in_the_file.sql rename to crates/izlek-core/migrations/0010_attachments_live_in_the_file.sql index b841562..bab7a84 100644 --- a/crates/dizey-core/migrations/0010_attachments_live_in_the_file.sql +++ b/crates/izlek-core/migrations/0010_attachments_live_in_the_file.sql @@ -1,7 +1,7 @@ -- Attachments, moved off the filesystem and into the database file. -- -- The table 0001 wrote kept a `stored_path`, and nothing ever filled it in. --- A path is the wrong shape for two reasons. Dizey is one process over one +-- A path is the wrong shape for two reasons. Izlek is one process over one -- database file, and a second place to keep state is a second thing to back -- up, to lock, and to get out of step with the rows that name it. And a path -- is exactly where an uploaded file name must never end up: `../../etc` is a diff --git a/crates/dizey-core/src/accounts.rs b/crates/izlek-core/src/accounts.rs similarity index 100% rename from crates/dizey-core/src/accounts.rs rename to crates/izlek-core/src/accounts.rs diff --git a/crates/dizey-core/src/auth.rs b/crates/izlek-core/src/auth.rs similarity index 96% rename from crates/dizey-core/src/auth.rs rename to crates/izlek-core/src/auth.rs index 85a21d6..1a486d9 100644 --- a/crates/dizey-core/src/auth.rs +++ b/crates/izlek-core/src/auth.rs @@ -231,11 +231,11 @@ mod tests { #[test] fn known_answer_for_the_token_digest() { - // SHA-256("dizey"), so a refactor cannot quietly change the algorithm + // SHA-256("izlek"), so a refactor cannot quietly change the algorithm // under stored hashes. assert_eq!( - hash_token("dizey"), - "ecef066ddcba712d09eca07be6a8625343e795c97b73a7f2f03417cce1fa58d7" + hash_token("izlek"), + "d81eac046551d3591888f0c7012b8faece2cc3501f63398bc040118bfd835d8e" ); } @@ -249,7 +249,7 @@ mod tests { #[test] fn password_rules_are_the_ones_on_the_screen() { - let email = "grace@dizey.sh"; + let email = "grace@izlek.sh"; let name = "Grace Hopper"; assert_eq!( check_password("short", email, name), @@ -265,7 +265,7 @@ mod tests { "case must not be an escape hatch" ); assert_eq!( - check_password("grace@dizey.sh!!", email, name), + check_password("grace@izlek.sh!!", email, name), Err(PasswordProblem::LooksLikeYou) ); assert!(check_password("tide-tables-1892", email, name).is_ok()); @@ -280,7 +280,7 @@ mod tests { #[cfg(test)] mod dummy_hash_generator { - //! Run with `cargo test -p dizey-core --lib print_a_dummy_hash -- --ignored + //! Run with `cargo test -p izlek-core --lib print_a_dummy_hash -- --ignored //! --nocapture` to mint a replacement for [`super::dummy_password_hash`]. #[test] #[ignore = "generator, not a check"] diff --git a/crates/dizey-core/src/board.rs b/crates/izlek-core/src/board.rs similarity index 100% rename from crates/dizey-core/src/board.rs rename to crates/izlek-core/src/board.rs diff --git a/crates/dizey-core/src/config.rs b/crates/izlek-core/src/config.rs similarity index 87% rename from crates/dizey-core/src/config.rs rename to crates/izlek-core/src/config.rs index 808c9b3..ce6a600 100644 --- a/crates/dizey-core/src/config.rs +++ b/crates/izlek-core/src/config.rs @@ -1,16 +1,16 @@ -//! Everything Dizey reads from `dizey.toml`, in one place. +//! Everything Izlek reads from `izlek.toml`, in one place. //! //! Nothing here has a silent default once the file exists. A key that is //! missing, empty or unusable stops the boot and says which key and which //! file, because the alternative is worse than not starting: a wrong -//! `database` does not mean "no data", it means a second Dizey quietly +//! `database` does not mean "no data", it means a second Izlek quietly //! writing a different file while everyone believes they are looking at the //! same board — and Turso is single-writer, so the two are not even //! reconcilable afterwards. A wrong `base_url` mails people a sign-in link //! pointing at a host that is not us. //! //! Development still needs to be one command, so the *absence* of -//! `dizey.toml` is the opt-in that takes the development defaults: the app +//! `izlek.toml` is the opt-in that takes the development defaults: the app //! writes the file itself, with those defaults in it and comments saying //! what each key does, and starts. That is opt-in on purpose too — it only //! ever happens once, because the second boot finds the file it wrote the @@ -32,17 +32,17 @@ use std::fmt; use std::path::{Path, PathBuf}; /// The name of the file `Config::load` reads and, failing that, writes. -const FILE_NAME: &str = "dizey.toml"; +const FILE_NAME: &str = "izlek.toml"; -/// What a freshly written `dizey.toml` says, comments included. Development -/// defaults, so that a plain `dizey` in an empty directory is one command. +/// What a freshly written `izlek.toml` says, comments included. Development +/// defaults, so that a plain `izlek` in an empty directory is one command. const DEVELOPMENT_DEFAULTS: &str = r#"# Where the one database file lives. One process holds it. -database = "dizey.db" +database = "izlek.db" # The origin sign-in links in mail point at. base_url = "http://127.0.0.1:3000" "#; -/// The shape of `dizey.toml`, before the values are checked. +/// The shape of `izlek.toml`, before the values are checked. #[derive(Deserialize)] struct Toml { database: Option, @@ -56,7 +56,7 @@ pub struct Config { pub database: PathBuf, /// The origin links in mail point at, with no trailing slash. pub base_url: String, - /// Whether `dizey.toml` did not exist and was just written with the + /// Whether `izlek.toml` did not exist and was just written with the /// development defaults this boot. pub defaulted: bool, } @@ -101,7 +101,7 @@ impl fmt::Display for ConfigError { impl std::error::Error for ConfigError {} impl Config { - /// Reads `dizey.toml` from the current directory, writing it with the + /// Reads `izlek.toml` from the current directory, writing it with the /// development defaults first if it is not there. pub fn load() -> Result { Config::load_from(Path::new(".")) @@ -109,7 +109,7 @@ impl Config { /// The same reading, against any directory — which is how it is tested /// without a test being able to disturb another test's working - /// directory, or another test's `dizey.toml`. + /// directory, or another test's `izlek.toml`. pub fn load_from(dir: &Path) -> Result { let path = dir.join(FILE_NAME); match std::fs::read_to_string(&path) { @@ -119,7 +119,7 @@ impl Config { ConfigError::Io(format!("could not write {}: {err}", path.display())) })?; println!( - "dizey wrote {FILE_NAME} with development defaults — edit it for a real deployment" + "izlek wrote {FILE_NAME} with development defaults — edit it for a real deployment" ); Config::parse(DEVELOPMENT_DEFAULTS, dir, true) } @@ -173,7 +173,7 @@ impl Config { } /// An absolute path for a file that may not exist yet: the directory is -/// resolved against `base` (the directory `dizey.toml` was read from), the +/// resolved against `base` (the directory `izlek.toml` was read from), the /// file name is kept as written. fn absolute(base: &Path, path: &Path) -> PathBuf { if path.is_absolute() { @@ -199,7 +199,7 @@ mod tests { /// A scratch directory, cleaned up when the test ends, so `load_from` can /// be exercised without touching the process's own working directory. fn scratch() -> PathBuf { - let dir = std::env::temp_dir().join(format!("dizey-config-test-{}", uuid_like())); + let dir = std::env::temp_dir().join(format!("izlek-config-test-{}", uuid_like())); std::fs::create_dir_all(&dir).unwrap(); dir } @@ -220,7 +220,7 @@ mod tests { let config = Config::load_from(&dir).unwrap(); assert!(config.defaulted); assert!(config.database.is_absolute(), "{:?}", config.database); - assert!(config.database.ends_with("dizey.db")); + assert!(config.database.ends_with("izlek.db")); assert_eq!(config.base_url, "http://127.0.0.1:3000"); let written = std::fs::read_to_string(dir.join(FILE_NAME)).unwrap(); @@ -235,7 +235,7 @@ mod tests { #[test] fn an_empty_string_is_not_a_value() { let problem = Config::parse( - "database = \" \"\nbase_url = \"https://dizey.sh\"\n", + "database = \" \"\nbase_url = \"https://izlek.sh\"\n", Path::new("."), false, ) @@ -245,12 +245,12 @@ mod tests { #[test] fn a_missing_key_names_itself_rather_than_guessing() { - let problem = Config::parse("base_url = \"https://dizey.sh\"\n", Path::new("."), false) + let problem = Config::parse("base_url = \"https://izlek.sh\"\n", Path::new("."), false) .unwrap_err(); assert_eq!(problem, ConfigError::Missing("database")); let said = problem.to_string(); assert!(said.contains("database"), "{said}"); - assert!(said.contains("dizey.toml"), "{said}"); + assert!(said.contains("izlek.toml"), "{said}"); } #[test] @@ -261,20 +261,20 @@ mod tests { matches!(problem, ConfigError::Unparseable { .. }), "{problem:?}" ); - assert!(problem.to_string().contains("dizey.toml")); + assert!(problem.to_string().contains("izlek.toml")); } #[test] fn a_relative_database_is_reported_absolute() { let dir = scratch(); let config = Config::parse( - "database = \"state/dizey.db\"\nbase_url = \"https://dizey.sh\"\n", + "database = \"state/izlek.db\"\nbase_url = \"https://izlek.sh\"\n", &dir, false, ) .unwrap(); assert!(config.database.is_absolute(), "{:?}", config.database); - assert!(config.database.ends_with("dizey.db")); + assert!(config.database.ends_with("izlek.db")); let report = config.report().join("\n"); assert!( report.contains(&config.database.display().to_string()), @@ -285,7 +285,7 @@ mod tests { #[test] fn a_base_url_that_is_not_an_origin_stops_the_boot() { let problem = Config::parse( - "database = \"/srv/dizey.db\"\nbase_url = \"dizey.sh\"\n", + "database = \"/srv/izlek.db\"\nbase_url = \"izlek.sh\"\n", Path::new("."), false, ) @@ -305,12 +305,12 @@ mod tests { #[test] fn the_base_url_keeps_no_trailing_slash_so_links_are_built_once() { let config = Config::parse( - "database = \"/srv/dizey.db\"\nbase_url = \"https://dizey.sh/\"\n", + "database = \"/srv/izlek.db\"\nbase_url = \"https://izlek.sh/\"\n", Path::new("."), false, ) .unwrap(); - assert_eq!(config.base_url, "https://dizey.sh"); + assert_eq!(config.base_url, "https://izlek.sh"); } /// The sender used to be environment variables read directly. It is @@ -321,7 +321,7 @@ mod tests { #[test] fn unrelated_keys_are_ignored_entirely() { let config = Config::parse( - "database = \"/srv/dizey.db\"\nbase_url = \"https://dizey.sh\"\nsmtp_password = \"hunter2-and-then-some\"\n", + "database = \"/srv/izlek.db\"\nbase_url = \"https://izlek.sh\"\nsmtp_password = \"hunter2-and-then-some\"\n", Path::new("."), false, ) diff --git a/crates/dizey-core/src/detail.rs b/crates/izlek-core/src/detail.rs similarity index 100% rename from crates/dizey-core/src/detail.rs rename to crates/izlek-core/src/detail.rs diff --git a/crates/dizey-core/src/lib.rs b/crates/izlek-core/src/lib.rs similarity index 96% rename from crates/dizey-core/src/lib.rs rename to crates/izlek-core/src/lib.rs index 2dfd6e8..e84ee78 100644 --- a/crates/dizey-core/src/lib.rs +++ b/crates/izlek-core/src/lib.rs @@ -1,4 +1,4 @@ -//! Domain model and storage for Dizey. +//! Domain model and storage for Izlek. //! //! The vocabulary — roles and record shapes — compiles everywhere, so the UI //! and the server speak the same types. The `server` feature adds the halves diff --git a/crates/dizey-core/src/mail.rs b/crates/izlek-core/src/mail.rs similarity index 98% rename from crates/dizey-core/src/mail.rs rename to crates/izlek-core/src/mail.rs index 46f3fa9..3c1a6ed 100644 --- a/crates/dizey-core/src/mail.rs +++ b/crates/izlek-core/src/mail.rs @@ -9,7 +9,7 @@ //! //! Nobody is ever mailed about their own action. A rule's audience is resolved //! and the person who did the thing is taken off it, on every audience, always: -//! three people on one board do not need Dizey telling each of them what they +//! three people on one board do not need Izlek telling each of them what they //! themselves just did. A rule whose audience is only the actor sends nothing //! and owes nothing — that is not a failure and does not appear as one. //! @@ -147,8 +147,8 @@ impl Engine { pub async fn send_test(&self, to: &str) -> std::result::Result { let mail = Outgoing { to: to.to_string(), - subject: "Dizey test mail".to_string(), - body: "Somebody pressed the test button in Dizey's settings, and this \ + subject: "Izlek test mail".to_string(), + body: "Somebody pressed the test button in Izlek's settings, and this \ is what came out. Nothing else was sent, and nobody else was \ written to.\n" .to_string(), diff --git a/crates/dizey-core/src/role.rs b/crates/izlek-core/src/role.rs similarity index 100% rename from crates/dizey-core/src/role.rs rename to crates/izlek-core/src/role.rs diff --git a/crates/dizey-core/src/store/mod.rs b/crates/izlek-core/src/store/mod.rs similarity index 99% rename from crates/dizey-core/src/store/mod.rs rename to crates/izlek-core/src/store/mod.rs index 692b656..d950552 100644 --- a/crates/dizey-core/src/store/mod.rs +++ b/crates/izlek-core/src/store/mod.rs @@ -528,7 +528,7 @@ pub trait Store: BoardReads + DetailReads + 'static { ) -> Result; /// Hangs a file off a task. The bytes go into the database file with the - /// row: there is no second place for a Dizey deployment to keep, and no + /// row: there is no second place for a Izlek deployment to keep, and no /// path for an uploaded name to become. /// /// Nothing here decides whether the file was allowed — its size, its type diff --git a/crates/dizey-core/src/store/secret.rs b/crates/izlek-core/src/store/secret.rs similarity index 97% rename from crates/dizey-core/src/store/secret.rs rename to crates/izlek-core/src/store/secret.rs index 1005bda..a0f3778 100644 --- a/crates/dizey-core/src/store/secret.rs +++ b/crates/izlek-core/src/store/secret.rs @@ -5,7 +5,7 @@ //! file — a backup, a snapshot, an `scp` by someone who should not have had //! it — carries the plaintext right along with it. This module is the fix: //! the column holds ciphertext, and the key that opens it lives in a second -//! file (`dizey.key`, beside the database) that a database backup does not +//! file (`izlek.key`, beside the database) that a database backup does not //! automatically include. //! //! The envelope is `v1:` followed by base64 of a 24-byte XChaCha20-Poly1305 @@ -172,9 +172,9 @@ mod tests { #[test] fn load_or_create_key_persists_and_restricts() { - let dir = std::env::temp_dir().join(format!("dizey-key-test-{}", uuid_lite())); + let dir = std::env::temp_dir().join(format!("izlek-key-test-{}", uuid_lite())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("dizey.key"); + let path = dir.join("izlek.key"); let first = load_or_create_key(&path).unwrap(); let second = load_or_create_key(&path).unwrap(); assert_eq!(first, second, "a second open reuses the same key"); diff --git a/crates/dizey-core/src/store/turso_store.rs b/crates/izlek-core/src/store/turso_store.rs similarity index 99% rename from crates/dizey-core/src/store/turso_store.rs rename to crates/izlek-core/src/store/turso_store.rs index 687bafd..e53237e 100644 --- a/crates/dizey-core/src/store/turso_store.rs +++ b/crates/izlek-core/src/store/turso_store.rs @@ -3,7 +3,7 @@ //! Turso is in-process and SQLite-compatible, so the schema is plain SQL and //! there is no server to run alongside the binary. It ships no migration runner //! of its own; [`TursoStore::open`] applies the numbered files in -//! `crates/dizey-core/migrations` at boot and records the version. +//! `crates/izlek-core/migrations` at boot and records the version. use async_trait::async_trait; use rand::Rng; @@ -328,7 +328,7 @@ async fn recipients_from(rows: &mut turso::Rows) -> Result> { } /// `path` with its file name suffixed, for the WAL/SHM files Turso may leave -/// beside the main one (`dizey.db-wal`, `dizey.db-shm`). +/// beside the main one (`izlek.db-wal`, `izlek.db-shm`). fn sibling(path: &str, suffix: &str) -> std::path::PathBuf { let mut name = std::path::Path::new(path) .file_name() @@ -363,7 +363,7 @@ fn load_key(path: &str) -> Result { .parent() .filter(|d| !d.as_os_str().is_empty()) .unwrap_or_else(|| std::path::Path::new(".")); - secret::load_or_create_key(&dir.join("dizey.key")).map_err(backend) + secret::load_or_create_key(&dir.join("izlek.key")).map_err(backend) } fn backend(e: E) -> StoreError { @@ -722,7 +722,7 @@ impl Store for TursoStore { None => return Err(StoreError::NotFound), }; // A decrypt failure — wrong key, damaged ciphertext, a restored - // backup missing its `dizey.key` — comes back as `None` rather than + // backup missing its `izlek.key` — comes back as `None` rather than // an error. To every caller that is indistinguishable from a // workspace that never had a sender, which is the intended // degradation: mail send falls back to the no-sender path instead of @@ -2663,7 +2663,7 @@ mod probe { #[tokio::test] async fn durability_defaults_are_recorded() { - let dir = std::env::temp_dir().join(format!("dizey-probe-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let db = Builder::new_local(path.to_str().unwrap()) @@ -2681,7 +2681,7 @@ mod probe { #[tokio::test] async fn concurrent_writers_on_one_database() { - let dir = std::env::temp_dir().join(format!("dizey-probe-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let db = Builder::new_local(path.to_str().unwrap()) @@ -2724,7 +2724,7 @@ mod probe { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn two_database_handles_on_one_file() { // Two handles on the same file is the shape a second process takes. - let dir = std::env::temp_dir().join(format!("dizey-probe-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-probe-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("probe.db"); let p = path.to_str().unwrap().to_string(); @@ -2797,15 +2797,15 @@ mod probe { /// is asserted against the real query rather than against a comment. #[tokio::test] async fn the_workspace_read_path_cannot_carry_the_password() { - let dir = std::env::temp_dir().join(format!("dizey-sender-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-sender-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let store = TursoStore::open(dir.join("dizey.db").to_str().unwrap()) + let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await .unwrap(); use crate::store::Store as _; let (ws, _admin) = store - .claim_workspace("Dizey", "ada@dizey.sh", "Ada", "hash") + .claim_workspace("Izlek", "ada@izlek.sh", "Ada", "hash") .await .unwrap(); store @@ -2814,10 +2814,10 @@ mod probe { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("hunter2-and-then-some".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }, ) .await @@ -2853,9 +2853,9 @@ mod migration { /// only half-apply is a migration that can lose the mail ledger. #[tokio::test] async fn a_migration_that_fails_partway_leaves_nothing_behind() { - let dir = std::env::temp_dir().join(format!("dizey-migration-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-migration-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let store = TursoStore::open(dir.join("dizey.db").to_str().unwrap()) + let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await .unwrap(); let before = store.schema_version().await.unwrap(); diff --git a/crates/dizey-core/tests/store.rs b/crates/izlek-core/tests/store.rs similarity index 92% rename from crates/dizey-core/tests/store.rs rename to crates/izlek-core/tests/store.rs index 7eb04c2..2e1eca5 100644 --- a/crates/dizey-core/tests/store.rs +++ b/crates/izlek-core/tests/store.rs @@ -1,4 +1,4 @@ -//! Integration tests for dizey-core: the storage boundary driven through the +//! Integration tests for izlek-core: the storage boundary driven through the //! Turso implementation, and the account flows on top of it. //! //! New integration tests belong in this file rather than a new `tests/*.rs`: @@ -6,9 +6,9 @@ use std::path::PathBuf; -use dizey_core::Role; -use dizey_core::auth::{Token, hash_password}; -use dizey_core::store::{ +use izlek_core::Role; +use izlek_core::auth::{Token, hash_password}; +use izlek_core::store::{ Audience, MailRule, NewAttachment, NewSender, NewUser, SendState, Store, StoreError, Trigger, TursoStore, User, }; @@ -24,9 +24,9 @@ struct Scratch { impl Scratch { async fn open() -> Self { - let dir = std::env::temp_dir().join(format!("dizey-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let store = TursoStore::open(dir.join("dizey.db").to_str().unwrap()) + let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await .unwrap(); Self { dir, store } @@ -37,7 +37,7 @@ impl Scratch { /// need to see a column the way it actually sits on disk rather than through /// [`Store`]'s API. async fn raw_conn(scratch: &Scratch) -> turso::Connection { - let db = turso::Builder::new_local(scratch.dir.join("dizey.db").to_str().unwrap()) + let db = turso::Builder::new_local(scratch.dir.join("izlek.db").to_str().unwrap()) .build() .await .unwrap(); @@ -55,8 +55,8 @@ async fn workspace_with_admin() -> (Scratch, String, String) { let (ws, admin) = scratch .store .claim_workspace( - "Dizey", - "ada@dizey.sh", + "Izlek", + "ada@izlek.sh", "Ada", &hash_password("tide-tables-1892").unwrap(), ) @@ -70,8 +70,8 @@ async fn workspace_with_admin() -> (Scratch, String, String) { async fn claim(store: &TursoStore) -> (String, String) { let (ws, admin) = store .claim_workspace( - "Dizey", - "ada@dizey.sh", + "Izlek", + "ada@izlek.sh", "Ada", &hash_password("tide-tables-1892").unwrap(), ) @@ -96,9 +96,9 @@ async fn member(store: &TursoStore, workspace_id: &str, email: &str, name: &str) #[tokio::test] async fn migrations_apply_once_and_survive_reopen() { - let dir = std::env::temp_dir().join(format!("dizey-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("dizey.db").to_string_lossy().into_owned(); + let path = dir.join("izlek.db").to_string_lossy().into_owned(); let first = TursoStore::open(&path).await.unwrap(); assert_eq!(first.schema_version().await.unwrap(), 10); @@ -109,7 +109,7 @@ async fn migrations_apply_once_and_survive_reopen() { // must not lose what the first open wrote. let second = TursoStore::open(&path).await.unwrap(); assert_eq!(second.schema_version().await.unwrap(), 10); - assert_eq!(second.workspace().await.unwrap().unwrap().name, "Dizey"); + assert_eq!(second.workspace().await.unwrap().unwrap().name, "Izlek"); drop(second); let _ = std::fs::remove_dir_all(&dir); } @@ -146,7 +146,7 @@ async fn a_second_claim_loses_and_changes_nothing() { // The loser must not have joined as anything at all. assert_eq!( scratch.store.workspace().await.unwrap().unwrap().name, - "Dizey" + "Izlek" ); assert_eq!(scratch.store.count_users("").await.unwrap(), 0); let ws_id = scratch.store.workspace().await.unwrap().unwrap().id; @@ -163,9 +163,9 @@ async fn a_second_claim_loses_and_changes_nothing() { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn concurrent_claims_produce_exactly_one_admin() { - let dir = std::env::temp_dir().join(format!("dizey-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("dizey.db").to_string_lossy().into_owned(); + let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path).await.unwrap()); let hash = hash_password("tide-tables-1892").unwrap(); @@ -176,8 +176,8 @@ async fn concurrent_claims_produce_exactly_one_admin() { claims.push(tokio::spawn(async move { store .claim_workspace( - "Dizey", - &format!("claimant{i}@dizey.sh"), + "Izlek", + &format!("claimant{i}@izlek.sh"), &format!("Claimant {i}"), &hash, ) @@ -215,8 +215,8 @@ async fn workspace_defaults_match_the_settings_screen() { let (ws, _) = scratch .store .claim_workspace( - "Dizey", - "ada@dizey.sh", + "Izlek", + "ada@izlek.sh", "Ada", &hash_password("tide-tables-1892").unwrap(), ) @@ -247,10 +247,10 @@ async fn the_workspace_record_carries_the_sender_but_never_its_password() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("a-very-secret-string".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }, ) .await @@ -259,9 +259,9 @@ async fn the_workspace_record_carries_the_sender_but_never_its_password() { let ws = scratch.store.workspace().await.unwrap().unwrap(); assert_eq!(ws.smtp_host.as_deref(), Some("smtp.fastmail.com")); assert_eq!(ws.smtp_port, Some(587)); - assert_eq!(ws.smtp_username.as_deref(), Some("dizey")); - assert_eq!(ws.smtp_from_name.as_deref(), Some("Dizey")); - assert_eq!(ws.smtp_from_address.as_deref(), Some("dizey@dizey.sh")); + assert_eq!(ws.smtp_username.as_deref(), Some("izlek")); + assert_eq!(ws.smtp_from_name.as_deref(), Some("Izlek")); + assert_eq!(ws.smtp_from_address.as_deref(), Some("izlek@izlek.sh")); assert!(ws.smtp_password_set, "the screen must be able to say 'set'"); let serialised = serde_json::to_string(&ws).unwrap(); @@ -280,10 +280,10 @@ async fn a_save_with_no_password_typed_keeps_the_stored_one() { let mut sender = NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("keep-me".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }; scratch.store.set_sender(&ws_id, sender.clone()).await.unwrap(); @@ -308,10 +308,10 @@ async fn a_typed_password_replaces_the_stored_one() { let mut sender = NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("the-old-one".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }; scratch.store.set_sender(&ws_id, sender.clone()).await.unwrap(); sender.password = Some("the-new-one".into()); @@ -336,10 +336,10 @@ async fn the_stored_password_is_not_the_plaintext_on_disk() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("a-very-secret-string".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }, ) .await @@ -365,7 +365,7 @@ async fn the_stored_password_is_not_the_plaintext_on_disk() { ); } -/// A backup restored without its sibling `dizey.key`, or a key file damaged +/// A backup restored without its sibling `izlek.key`, or a key file damaged /// in place, must not crash mail sending or the settings screen — it has to /// degrade to "no password set", exactly like a workspace that never had a /// sender, so the admin can heal it by retyping the password once. @@ -379,10 +379,10 @@ async fn a_password_that_will_not_decrypt_reads_back_as_none() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("a-very-secret-string".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }, ) .await @@ -413,10 +413,10 @@ async fn a_password_that_will_not_decrypt_reads_back_as_none() { NewSender { host: "smtp.fastmail.com".into(), port: 587, - username: "dizey".into(), + username: "izlek".into(), password: Some("a-fresh-password".into()), - from_name: "Dizey".into(), - from_address: "dizey@dizey.sh".into(), + from_name: "Izlek".into(), + from_address: "izlek@izlek.sh".into(), }, ) .await @@ -435,8 +435,8 @@ async fn a_password_that_will_not_decrypt_reads_back_as_none() { async fn the_database_and_key_file_are_owner_only() { use std::os::unix::fs::PermissionsExt; let scratch = Scratch::open().await; - let db_path = scratch.dir.join("dizey.db"); - let key_path = scratch.dir.join("dizey.key"); + let db_path = scratch.dir.join("izlek.db"); + let key_path = scratch.dir.join("izlek.key"); for path in [&db_path, &key_path] { let mode = std::fs::metadata(path) .unwrap_or_else(|e| panic!("{}: {e}", path.display())) @@ -469,7 +469,7 @@ async fn an_invited_member_has_no_password_until_they_choose_one() { .store .create_user(NewUser { workspace_id: ws_id.clone(), - email: "grace@dizey.sh".into(), + email: "grace@izlek.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -495,7 +495,7 @@ async fn addresses_are_unique_and_case_insensitive() { .store .create_user(NewUser { workspace_id: ws_id.clone(), - email: " ADA@Dizey.sh ".into(), + email: " ADA@Izlek.sh ".into(), display_name: "Ada again".into(), role: Role::Member, invited_by: None, @@ -505,7 +505,7 @@ async fn addresses_are_unique_and_case_insensitive() { assert!( scratch .store - .user_by_email(&ws_id, "Ada@DIZEY.sh") + .user_by_email(&ws_id, "Ada@IZLEK.sh") .await .unwrap() .is_some() @@ -520,7 +520,7 @@ async fn an_unknown_address_is_a_plain_none() { assert!( scratch .store - .user_by_email(&ws_id, "nobody@dizey.sh") + .user_by_email(&ws_id, "nobody@izlek.sh") .await .unwrap() .is_none() @@ -531,8 +531,8 @@ async fn an_unknown_address_is_a_plain_none() { async fn members_list_and_count_for_the_admin_screen() { let (scratch, ws_id, admin_id) = workspace_with_admin().await; for (email, name, role) in [ - ("grace@dizey.sh", "Grace", Role::Member), - ("linus@dizey.sh", "Linus", Role::Viewer), + ("grace@izlek.sh", "Grace", Role::Member), + ("linus@izlek.sh", "Linus", Role::Viewer), ] { scratch .store @@ -559,7 +559,7 @@ async fn profile_and_role_updates_stick() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@dizey.sh".into(), + email: "grace@izlek.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -629,7 +629,7 @@ async fn a_signin_link_stores_only_the_hash_and_is_used_once() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@dizey.sh".into(), + email: "grace@izlek.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -694,7 +694,7 @@ async fn an_expired_link_is_still_a_live_account() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@dizey.sh".into(), + email: "grace@izlek.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: None, @@ -726,7 +726,7 @@ async fn the_store_is_usable_behind_a_trait_object() { let scratch = Scratch::open().await; let store: &dyn Store = &scratch.store; store - .claim_workspace("Dizey", "ada@dizey.sh", "Ada", "$argon2id$fake") + .claim_workspace("Izlek", "ada@izlek.sh", "Ada", "$argon2id$fake") .await .unwrap(); assert!(store.workspace().await.unwrap().is_some()); @@ -734,12 +734,12 @@ async fn the_store_is_usable_behind_a_trait_object() { #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn a_prefetched_link_is_consumed_exactly_once() { - let dir = std::env::temp_dir().join(format!("dizey-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("dizey.db").to_string_lossy().into_owned(); + let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = std::sync::Arc::new(TursoStore::open(&path).await.unwrap()); let (ws_id, _) = claim(&store).await; - let user_id = member(&store, &ws_id, "grace@dizey.sh", "Grace").await; + let user_id = member(&store, &ws_id, "grace@izlek.sh", "Grace").await; let token = Token::mint(); let now = OffsetDateTime::now_utc(); @@ -772,7 +772,7 @@ async fn a_prefetched_link_is_consumed_exactly_once() { #[tokio::test] async fn a_session_lives_until_it_expires_or_is_revoked() { let (scratch, ws_id, _) = workspace_with_admin().await; - let user_id = member(&scratch.store, &ws_id, "grace@dizey.sh", "Grace").await; + let user_id = member(&scratch.store, &ws_id, "grace@izlek.sh", "Grace").await; let token = Token::mint(); let now = OffsetDateTime::now_utc(); @@ -827,7 +827,7 @@ async fn a_session_lives_until_it_expires_or_is_revoked() { #[tokio::test] async fn an_expired_session_is_not_live() { let (scratch, ws_id, _) = workspace_with_admin().await; - let user_id = member(&scratch.store, &ws_id, "grace@dizey.sh", "Grace").await; + let user_id = member(&scratch.store, &ws_id, "grace@izlek.sh", "Grace").await; let now = OffsetDateTime::now_utc(); let session = scratch .store @@ -840,8 +840,8 @@ async fn an_expired_session_is_not_live() { #[tokio::test] async fn changing_a_password_can_sign_out_every_other_device() { let (scratch, ws_id, _) = workspace_with_admin().await; - let user_id = member(&scratch.store, &ws_id, "grace@dizey.sh", "Grace").await; - let other_id = member(&scratch.store, &ws_id, "linus@dizey.sh", "Linus").await; + let user_id = member(&scratch.store, &ws_id, "grace@izlek.sh", "Grace").await; + let other_id = member(&scratch.store, &ws_id, "linus@izlek.sh", "Linus").await; let now = OffsetDateTime::now_utc(); let mut hashes = Vec::new(); @@ -890,7 +890,7 @@ async fn auth_attempts_are_counted_over_a_window() { for minutes_ago in [30, 20, 10, 5, 1] { scratch .store - .record_auth_attempt("grace@dizey.sh", now - Duration::minutes(minutes_ago)) + .record_auth_attempt("grace@izlek.sh", now - Duration::minutes(minutes_ago)) .await .unwrap(); } @@ -904,7 +904,7 @@ async fn auth_attempts_are_counted_over_a_window() { assert_eq!( scratch .store - .count_auth_attempts("grace@dizey.sh", window) + .count_auth_attempts("grace@izlek.sh", window) .await .unwrap(), 3 @@ -920,7 +920,7 @@ async fn auth_attempts_are_counted_over_a_window() { assert_eq!( scratch .store - .count_auth_attempts("nobody@dizey.sh", window) + .count_auth_attempts("nobody@izlek.sh", window) .await .unwrap(), 0 @@ -929,13 +929,13 @@ async fn auth_attempts_are_counted_over_a_window() { // A success clears the bucket that succeeded, and only that one. scratch .store - .clear_auth_attempts("grace@dizey.sh") + .clear_auth_attempts("grace@izlek.sh") .await .unwrap(); assert_eq!( scratch .store - .count_auth_attempts("grace@dizey.sh", window) + .count_auth_attempts("grace@izlek.sh", window) .await .unwrap(), 0 @@ -952,7 +952,7 @@ async fn auth_attempts_are_counted_over_a_window() { // Pruning drops what is out of every window. scratch .store - .record_auth_attempt("grace@dizey.sh", now - Duration::hours(2)) + .record_auth_attempt("grace@izlek.sh", now - Duration::hours(2)) .await .unwrap(); let pruned = scratch @@ -967,15 +967,15 @@ async fn auth_attempts_are_counted_over_a_window() { // Account flows. // --------------------------------------------------------------------------- -use dizey_core::accounts::{AccountError, Accounts, RATE_LIMIT, SIGNIN_LINK_LIFETIME}; -use dizey_core::auth::PasswordProblem; +use izlek_core::accounts::{AccountError, Accounts, RATE_LIMIT, SIGNIN_LINK_LIFETIME}; +use izlek_core::auth::PasswordProblem; use std::sync::Arc; /// An accounts service over a throwaway database. The directory is kept alive /// by the returned guard. async fn accounts() -> (Scratch, Accounts) { let scratch = Scratch::open().await; - let store = TursoStore::open(scratch.dir.join("dizey.db").to_str().unwrap()) + let store = TursoStore::open(scratch.dir.join("izlek.db").to_str().unwrap()) .await .unwrap(); let accounts = Accounts::new(Arc::new(store) as Arc); @@ -985,7 +985,7 @@ async fn accounts() -> (Scratch, Accounts) { async fn claimed() -> (Scratch, Accounts, User) { let (scratch, accounts) = accounts().await; let (_, signed_in) = accounts - .claim_workspace("Dizey", "ada@dizey.sh", "Ada", "tide-tables-1892") + .claim_workspace("Izlek", "ada@izlek.sh", "Ada", "tide-tables-1892") .await .unwrap(); (scratch, accounts, signed_in.user) @@ -995,10 +995,10 @@ async fn claimed() -> (Scratch, Accounts, User) { async fn claiming_makes_an_admin_and_signs_them_in() { let (_scratch, accounts) = accounts().await; let (workspace, signed_in) = accounts - .claim_workspace("Dizey", "ada@dizey.sh", "Ada", "tide-tables-1892") + .claim_workspace("Izlek", "ada@izlek.sh", "Ada", "tide-tables-1892") .await .unwrap(); - assert_eq!(workspace.name, "Dizey"); + assert_eq!(workspace.name, "Izlek"); assert_eq!(signed_in.user.role, Role::Admin); // The cookie value works and is not what is stored. @@ -1021,7 +1021,7 @@ async fn claiming_makes_an_admin_and_signs_them_in() { async fn the_claim_screen_enforces_its_own_password_rules() { let (_scratch, accounts) = accounts().await; let too_short = accounts - .claim_workspace("Dizey", "ada@dizey.sh", "Ada", "short") + .claim_workspace("Izlek", "ada@izlek.sh", "Ada", "short") .await; assert!(matches!( too_short, @@ -1049,7 +1049,7 @@ async fn a_second_claim_is_refused() { async fn an_invited_member_chooses_their_own_password() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); assert!(!invitation.user.has_signed_in(), "no password yet"); @@ -1060,7 +1060,7 @@ async fn an_invited_member_chooses_their_own_password() { // The admin cannot sign in as them in the meantime. let as_them = accounts - .sign_in("grace@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("grace@izlek.sh", "tide-tables-1892", "198.51.100.7") .await; assert!(matches!(as_them, Err(AccountError::Rejected))); @@ -1077,7 +1077,7 @@ async fn an_invited_member_chooses_their_own_password() { // And now the password they chose works, and only that one. accounts - .sign_in("grace@dizey.sh", "sextant-and-chart", "198.51.100.7") + .sign_in("grace@izlek.sh", "sextant-and-chart", "198.51.100.7") .await .unwrap(); } @@ -1086,7 +1086,7 @@ async fn an_invited_member_chooses_their_own_password() { async fn only_an_admin_may_invite() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); let member = accounts @@ -1101,7 +1101,7 @@ async fn only_an_admin_may_invite() { // Server-side, not merely hidden: a member calling the flow is refused. let attempt = accounts - .invite(&member, "linus@dizey.sh", "Linus", Role::Member) + .invite(&member, "linus@izlek.sh", "Linus", Role::Member) .await; assert!(matches!(attempt, Err(AccountError::Forbidden))); @@ -1109,7 +1109,7 @@ async fn only_an_admin_may_invite() { viewer.role = Role::Viewer; assert!(matches!( accounts - .invite(&viewer, "linus@dizey.sh", "Linus", Role::Viewer) + .invite(&viewer, "linus@izlek.sh", "Linus", Role::Viewer) .await, Err(AccountError::Forbidden) )); @@ -1119,7 +1119,7 @@ async fn only_an_admin_may_invite() { async fn a_link_works_once_and_a_wrong_one_never_does() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); @@ -1147,7 +1147,7 @@ async fn a_link_works_once_and_a_wrong_one_never_does() { // The password they actually set is untouched by either failure. accounts - .sign_in("grace@dizey.sh", "sextant-and-chart", "198.51.100.7") + .sign_in("grace@izlek.sh", "sextant-and-chart", "198.51.100.7") .await .unwrap(); } @@ -1156,7 +1156,7 @@ async fn a_link_works_once_and_a_wrong_one_never_does() { async fn a_rejected_password_does_not_burn_the_invitation() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); @@ -1191,7 +1191,7 @@ async fn a_rejected_password_does_not_burn_the_invitation() { async fn an_expired_link_is_refused_and_resending_opens_the_same_account() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); @@ -1229,10 +1229,10 @@ async fn an_expired_link_is_refused_and_resending_opens_the_same_account() { async fn an_unknown_address_and_a_wrong_password_are_indistinguishable() { let (_scratch, accounts, _admin) = claimed().await; let unknown = accounts - .sign_in("nobody@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("nobody@izlek.sh", "tide-tables-1892", "198.51.100.7") .await; let wrong = accounts - .sign_in("ada@dizey.sh", "not-her-password", "198.51.100.8") + .sign_in("ada@izlek.sh", "not-her-password", "198.51.100.8") .await; assert!(matches!(unknown, Err(AccountError::Rejected))); assert!(matches!(wrong, Err(AccountError::Rejected))); @@ -1251,13 +1251,13 @@ async fn the_miss_path_costs_what_the_hit_path_costs() { // which a skipped verify could not. let baseline = std::time::Instant::now(); let _ = accounts - .sign_in("ada@dizey.sh", "not-her-password", "198.51.100.7") + .sign_in("ada@izlek.sh", "not-her-password", "198.51.100.7") .await; let hit_cost = baseline.elapsed(); let started = std::time::Instant::now(); let _ = accounts - .sign_in("nobody@dizey.sh", "not-a-password", "198.51.100.8") + .sign_in("nobody@izlek.sh", "not-a-password", "198.51.100.8") .await; let miss_cost = started.elapsed(); @@ -1271,12 +1271,12 @@ async fn the_miss_path_costs_what_the_hit_path_costs() { async fn an_invited_account_that_has_no_password_cannot_be_signed_into() { let (_scratch, accounts, admin) = claimed().await; accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); // Not "set your password first" — that would confirm the address exists. assert!(matches!( - accounts.sign_in("grace@dizey.sh", "", "198.51.100.7").await, + accounts.sign_in("grace@izlek.sh", "", "198.51.100.7").await, Err(AccountError::Rejected) )); } @@ -1286,20 +1286,20 @@ async fn sign_in_attempts_are_rate_limited_per_address() { let (_scratch, accounts, _admin) = claimed().await; for _ in 0..RATE_LIMIT { let _ = accounts - .sign_in("ada@dizey.sh", "wrong", "198.51.100.7") + .sign_in("ada@izlek.sh", "wrong", "198.51.100.7") .await; } // The next attempt is refused before any Argon2 work happens. assert!(matches!( accounts - .sign_in("ada@dizey.sh", "wrong", "203.0.113.9") + .sign_in("ada@izlek.sh", "wrong", "203.0.113.9") .await, Err(AccountError::RateLimited) )); // A different address from a fresh client is unaffected. assert!(matches!( accounts - .sign_in("someone@dizey.sh", "wrong", "203.0.113.9") + .sign_in("someone@izlek.sh", "wrong", "203.0.113.9") .await, Err(AccountError::Rejected) )); @@ -1315,12 +1315,12 @@ async fn a_flooded_address_never_locks_the_owner_out() { // Each guess from its own client, so only the address bucket fills. for i in 0..(RATE_LIMIT + 5) { let _ = accounts - .sign_in("ada@dizey.sh", "wrong", &format!("203.0.113.{i}")) + .sign_in("ada@izlek.sh", "wrong", &format!("203.0.113.{i}")) .await; } // The owner, from a client of their own, still gets in. accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); } @@ -1331,13 +1331,13 @@ async fn sign_in_attempts_are_rate_limited_per_client() { let (_scratch, accounts, _admin) = claimed().await; for i in 0..RATE_LIMIT { let _ = accounts - .sign_in(&format!("nobody{i}@dizey.sh"), "wrong", "203.0.113.9") + .sign_in(&format!("nobody{i}@izlek.sh"), "wrong", "203.0.113.9") .await; } // Refused before any Argon2 work, whatever address it asks about. assert!(matches!( accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "203.0.113.9") + .sign_in("ada@izlek.sh", "tide-tables-1892", "203.0.113.9") .await, Err(AccountError::RateLimited) )); @@ -1350,7 +1350,7 @@ async fn sign_in_attempts_are_rate_limited_per_client() { async fn link_redemption_is_rate_limited_per_client() { let (_scratch, accounts, admin) = claimed().await; let invitation = accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); for i in 0..RATE_LIMIT { @@ -1412,17 +1412,17 @@ async fn a_successful_sign_in_clears_the_bucket() { let (_scratch, accounts, _admin) = claimed().await; for _ in 0..(RATE_LIMIT - 1) { let _ = accounts - .sign_in("ada@dizey.sh", "wrong", "198.51.100.7") + .sign_in("ada@izlek.sh", "wrong", "198.51.100.7") .await; } accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); // Someone who mistypes and then gets it right is not left at the edge. assert!(matches!( accounts - .sign_in("ada@dizey.sh", "wrong", "198.51.100.7") + .sign_in("ada@izlek.sh", "wrong", "198.51.100.7") .await, Err(AccountError::Rejected) )); @@ -1432,11 +1432,11 @@ async fn a_successful_sign_in_clears_the_bucket() { async fn changing_a_password_signs_out_every_device() { let (_scratch, accounts, admin) = claimed().await; let first = accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); let second = accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.8") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.8") .await .unwrap(); assert!( @@ -1475,7 +1475,7 @@ async fn changing_a_password_signs_out_every_device() { .is_some() ); accounts - .sign_in("ada@dizey.sh", "chronometer-1761", "198.51.100.7") + .sign_in("ada@izlek.sh", "chronometer-1761", "198.51.100.7") .await .unwrap(); } @@ -1497,7 +1497,7 @@ async fn changing_a_password_needs_the_current_one_and_obeys_the_rules() { )); // The old password still works after both refusals. accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); } @@ -1506,11 +1506,11 @@ async fn changing_a_password_needs_the_current_one_and_obeys_the_rules() { async fn signing_out_ends_that_browser_only() { let (_scratch, accounts, _admin) = claimed().await; let laptop = accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.7") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.7") .await .unwrap(); let phone = accounts - .sign_in("ada@dizey.sh", "tide-tables-1892", "198.51.100.8") + .sign_in("ada@izlek.sh", "tide-tables-1892", "198.51.100.8") .await .unwrap(); @@ -1540,18 +1540,18 @@ async fn signing_out_ends_that_browser_only() { async fn an_address_can_only_be_invited_once() { let (_scratch, accounts, admin) = claimed().await; accounts - .invite(&admin, "grace@dizey.sh", "Grace", Role::Member) + .invite(&admin, "grace@izlek.sh", "Grace", Role::Member) .await .unwrap(); assert!(matches!( accounts - .invite(&admin, "GRACE@dizey.sh", "Grace again", Role::Member) + .invite(&admin, "GRACE@izlek.sh", "Grace again", Role::Member) .await, Err(AccountError::AddressTaken) )); assert!(matches!( accounts - .invite(&admin, "ada@dizey.sh", "Ada again", Role::Member) + .invite(&admin, "ada@izlek.sh", "Ada again", Role::Member) .await, Err(AccountError::AddressTaken) )); @@ -1559,8 +1559,8 @@ async fn an_address_can_only_be_invited_once() { // -- board ------------------------------------------------------------------ -use dizey_core::board::{BoardReads, BoardView, Moved, Person, load}; -use dizey_core::store::NewTask; +use izlek_core::board::{BoardReads, BoardView, Moved, Person, load}; +use izlek_core::store::NewTask; use std::sync::atomic::{AtomicUsize, Ordering}; use time::Date; use time::macros::date; @@ -1597,12 +1597,12 @@ impl BoardReads for CountingReads<'_> { async fn board( &self, workspace_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.board(workspace_id).await } - async fn columns(&self, board_id: &str) -> Result, StoreError> { + async fn columns(&self, board_id: &str) -> Result, StoreError> { self.tick(); self.inner.columns(board_id).await } @@ -1610,7 +1610,7 @@ impl BoardReads for CountingReads<'_> { async fn tasks_for_board( &self, board_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.tasks_for_board(board_id).await } @@ -1724,7 +1724,7 @@ async fn a_card_carries_its_assignees_comments_and_dependency_keys() { let mel = store .create_user(NewUser { workspace_id: workspace.clone(), - email: "mel@dizey.sh".into(), + email: "mel@izlek.sh".into(), display_name: "Mel Duarte".into(), role: Role::Member, invited_by: None, @@ -1921,7 +1921,7 @@ fn initials_fall_back_to_two_letters() { // -- task detail ------------------------------------------------------------ -use dizey_core::detail::{ +use izlek_core::detail::{ ActivityEntry, ActivityKind, Comment, DependencyEdge, DetailReads, TaskFacts, load as load_detail, }; @@ -1960,7 +1960,7 @@ impl DetailReads for CountingDetail<'_> { async fn columns_for_board( &self, board_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.columns_for_board(board_id).await } @@ -1991,7 +1991,7 @@ impl DetailReads for CountingDetail<'_> { async fn files_for_task( &self, task_id: &str, - ) -> Result, StoreError> { + ) -> Result, StoreError> { self.tick(); self.inner.files_for_task(task_id).await } @@ -2044,7 +2044,7 @@ async fn a_viewer_is_never_offered_as_an_assignee() { let quiet = store .create_user(NewUser { workspace_id: workspace.clone(), - email: "quiet@dizey.sh".into(), + email: "quiet@izlek.sh".into(), display_name: "Quiet Reader".into(), role: Role::Viewer, invited_by: None, @@ -2314,7 +2314,7 @@ async fn a_task_detail_costs_eight_queries_whatever_it_carries() { let person = store .create_user(NewUser { workspace_id: workspace.clone(), - email: format!("member{n}@dizey.sh"), + email: format!("member{n}@izlek.sh"), display_name: format!("Member {n}"), role: Role::Member, invited_by: None, @@ -2627,7 +2627,7 @@ async fn an_orphan_row_is_refused() { .store .create_user(NewUser { workspace_id: "no-such-workspace".into(), - email: "orphan@dizey.sh".into(), + email: "orphan@izlek.sh".into(), display_name: "Orphan".into(), role: Role::Member, invited_by: None, @@ -2650,9 +2650,9 @@ async fn an_orphan_row_is_refused() { .len(); assert_eq!(existing, 1, "only the admin"); - let dir = std::env::temp_dir().join(format!("dizey-fk-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-fk-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("dizey.db").to_str().unwrap().to_owned(); + let path = dir.join("izlek.db").to_str().unwrap().to_owned(); { TursoStore::open(&path).await.unwrap(); } @@ -2672,7 +2672,7 @@ async fn an_orphan_row_is_refused() { let refused = conn .execute( "INSERT INTO user (id, workspace_id, email, display_name, role, created_at) \ - VALUES ('u-orphan', 'no-such-workspace', 'orphan@dizey.sh', 'Orphan', \ + VALUES ('u-orphan', 'no-such-workspace', 'orphan@izlek.sh', 'Orphan', \ 'member', '2026-08-26T00:00:00Z')", (), ) @@ -2693,7 +2693,7 @@ async fn moved_to( from: &str, to: &str, actor: &str, -) -> dizey_core::board::Transition { +) -> izlek_core::board::Transition { let from_id = column_named(store, workspace, from).await; let to_id = column_named(store, workspace, to).await; match store @@ -2727,9 +2727,9 @@ async fn a_rule_that_fires_on_nothing_is_refused_by_the_schema() { // past it: a status rule with no column, straight at the table. The check // constraint is the guard, and if it were ever dropped this insert would // quietly succeed and the engine would carry a rule that matches nothing. - let dir = std::env::temp_dir().join(format!("dizey-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let path = dir.join("dizey.db").to_string_lossy().into_owned(); + let path = dir.join("izlek.db").to_string_lossy().into_owned(); let store = TursoStore::open(&path).await.unwrap(); let (workspace, _admin) = claim(&store).await; let board = store.board(&workspace).await.unwrap().unwrap(); @@ -2810,7 +2810,7 @@ async fn the_index_decides_who_owns_a_send() { let now = OffsetDateTime::now_utc(); let first = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now) .await .unwrap(); assert!(first.is_some(), "the first run owns the send"); @@ -2820,7 +2820,7 @@ async fn the_index_decides_who_owns_a_send() { // first: the insert loses. let second = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now) .await .unwrap(); assert!(second.is_none(), "the second run owns nothing"); @@ -2856,7 +2856,7 @@ async fn a_second_crossing_is_a_second_send() { assert!( scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now) .await .unwrap() .is_some() @@ -2890,7 +2890,7 @@ async fn a_refused_send_is_recorded_and_owed_again() { let now = OffsetDateTime::now_utc(); let send = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now) .await .unwrap() .unwrap(); @@ -2943,7 +2943,7 @@ async fn a_refused_address_is_not_retried_forever() { let now = OffsetDateTime::now_utc(); let send = scratch .store - .claim_send(&rule.id, &transition.id, &task, "gone@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "gone@izlek.sh", now) .await .unwrap() .unwrap(); @@ -2986,7 +2986,7 @@ async fn an_accepted_send_stops_being_owed() { let now = OffsetDateTime::now_utc(); let send = scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now) .await .unwrap() .unwrap(); @@ -3017,14 +3017,14 @@ async fn a_viewer_is_never_a_recipient() { .store .create_user(NewUser { workspace_id: workspace.clone(), - email: "viewer@dizey.sh".into(), + email: "viewer@izlek.sh".into(), display_name: "Vera".into(), role: Role::Viewer, invited_by: None, }) .await .unwrap(); - let mate = member(&scratch.store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&scratch.store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task( &scratch.store, &workspace, @@ -3045,7 +3045,7 @@ async fn a_viewer_is_never_a_recipient() { scratch.store.recipients_for_board(&board.id).await.unwrap(), ] { assert!( - list.iter().all(|person| person.email != "viewer@dizey.sh"), + list.iter().all(|person| person.email != "viewer@izlek.sh"), "a Viewer was about to be mailed: {list:?}" ); } @@ -3055,7 +3055,7 @@ async fn a_viewer_is_never_a_recipient() { .iter() .map(|p| p.email.as_str()) .collect::>(), - ["emre@dizey.sh"] + ["emre@izlek.sh"] ); } @@ -3076,7 +3076,7 @@ async fn deleting_a_rule_takes_its_ledger_with_it() { let now = OffsetDateTime::now_utc(); scratch .store - .claim_send(&rule.id, &transition.id, &task, "ada@dizey.sh", now) + .claim_send(&rule.id, &transition.id, &task, "ada@izlek.sh", now) .await .unwrap(); @@ -3097,7 +3097,7 @@ async fn deleting_a_rule_takes_its_ledger_with_it() { // -- the engine ------------------------------------------------------------ -use dizey_core::mail::{Engine, MailError, Mailer, Outgoing, backoff}; +use izlek_core::mail::{Engine, MailError, Mailer, Outgoing, backoff}; use std::sync::Mutex; /// A mail server that remembers instead of sending, and refuses when told to. @@ -3140,10 +3140,10 @@ impl Mailer for Remembering { /// A store shared between the tests and an engine. async fn shared() -> (PathBuf, Arc, String, String) { - let dir = std::env::temp_dir().join(format!("dizey-test-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-test-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); let store = Arc::new( - TursoStore::open(dir.join("dizey.db").to_str().unwrap()) + TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await .unwrap(), ); @@ -3154,7 +3154,7 @@ async fn shared() -> (PathBuf, Arc, String, String) { #[tokio::test] async fn a_crossing_mails_the_people_on_the_card_once() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task( &store, &workspace, @@ -3168,7 +3168,7 @@ async fn a_crossing_mails_the_people_on_the_card_once() { let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; let first = engine.on_transition(&transition).await.unwrap(); @@ -3181,11 +3181,11 @@ async fn a_crossing_mails_the_people_on_the_card_once() { let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@dizey.sh"); + assert_eq!(sent[0].to, "emre@izlek.sh"); assert_eq!(sent[0].subject, "Task completed"); assert!(sent[0].body.contains("CLI install script")); assert!( - sent[0].body.contains("https://dizey.sh/?task="), + sent[0].body.contains("https://izlek.sh/?task="), "the mail links back to the task: {}", sent[0].body ); @@ -3196,12 +3196,12 @@ async fn a_crossing_mails_the_people_on_the_card_once() { #[tokio::test] async fn an_edited_rule_does_not_remail_a_crossing_it_already_covered() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; engine.on_transition(&transition).await.unwrap(); @@ -3219,14 +3219,14 @@ async fn an_edited_rule_does_not_remail_a_crossing_it_already_covered() { #[tokio::test] async fn a_rule_that_is_off_sends_nothing() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; store.set_mail_rule_enabled(&rule.id, false).await.unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; assert_eq!( engine.on_transition(&transition).await.unwrap(), @@ -3242,7 +3242,7 @@ async fn a_rule_that_is_off_sends_nothing() { #[tokio::test] async fn a_mail_says_when_the_card_moved_not_when_it_was_sent() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Task completed").await; @@ -3250,7 +3250,7 @@ async fn a_mail_says_when_the_card_moved_not_when_it_was_sent() { // The server is down when the card moves and comes back later. The mail // that finally goes out has to say Tuesday, not Thursday. let mailer = Remembering::refusing(vec![MailError::retryable("connection refused")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; let refused = engine.on_transition(&transition).await.unwrap(); assert_eq!(refused.failed, 1); @@ -3271,28 +3271,28 @@ async fn a_mail_says_when_the_card_moved_not_when_it_was_sent() { #[tokio::test] async fn a_failing_send_is_retried_a_bounded_number_of_times_and_then_written_off() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::refusing( - (0..dizey_core::mail::MAX_ATTEMPTS) + (0..izlek_core::mail::MAX_ATTEMPTS) .map(|_| MailError::retryable("connection timed out")) .collect(), ); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; engine.on_transition(&transition).await.unwrap(); let mut when = OffsetDateTime::now_utc(); - for _ in 1..dizey_core::mail::MAX_ATTEMPTS { - when += backoff(dizey_core::mail::MAX_ATTEMPTS) + Duration::minutes(1); + for _ in 1..izlek_core::mail::MAX_ATTEMPTS { + when += backoff(izlek_core::mail::MAX_ATTEMPTS) + Duration::minutes(1); engine.deliver_owed(when, 10).await.unwrap(); } let ledger = &store.sends_for_rule(&rule.id, 10).await.unwrap()[0]; - assert_eq!(ledger.attempts, dizey_core::mail::MAX_ATTEMPTS); + assert_eq!(ledger.attempts, izlek_core::mail::MAX_ATTEMPTS); assert_eq!(ledger.state, SendState::Abandoned); assert_eq!(ledger.last_error.as_deref(), Some("connection timed out")); assert!( @@ -3310,13 +3310,13 @@ async fn a_failing_send_is_retried_a_bounded_number_of_times_and_then_written_of #[tokio::test] async fn a_refused_address_is_written_off_at_the_first_answer() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::refusing(vec![MailError::permanent("550 no such mailbox")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &admin).await; let report = engine.on_transition(&transition).await.unwrap(); assert_eq!(report.abandoned, 1); @@ -3331,7 +3331,7 @@ async fn a_refused_address_is_written_off_at_the_first_answer() { #[tokio::test] async fn you_can_start_now_waits_for_the_last_blocker() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task( &store, @@ -3368,7 +3368,7 @@ async fn you_can_start_now_waits_for_the_last_blocker() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); // One blocker finished is not unblocked: the other one is still in the way, // and telling Emre to start would be a lie. @@ -3380,7 +3380,7 @@ async fn you_can_start_now_waits_for_the_last_blocker() { assert_eq!(engine.on_transition(&two).await.unwrap().sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@dizey.sh"); + assert_eq!(sent[0].to, "emre@izlek.sh"); assert!( sent[0].body.contains("Onboarding mails"), "the mail is about the freed task, not the blocker: {}", @@ -3392,7 +3392,7 @@ async fn you_can_start_now_waits_for_the_last_blocker() { #[tokio::test] async fn a_card_that_did_not_move_owes_nobody_a_mail() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); a_rule(&store, &workspace, "Done", "Task completed").await; @@ -3412,7 +3412,7 @@ async fn a_card_that_did_not_move_owes_nobody_a_mail() { #[tokio::test] async fn a_deleted_blocker_also_says_you_can_start_now() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task( &store, @@ -3439,7 +3439,7 @@ async fn a_deleted_blocker_also_says_you_can_start_now() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); // A blocker can leave the way in two ways, and being deleted is one of // them. The person waiting hears about it either way. @@ -3457,7 +3457,7 @@ async fn a_deleted_blocker_also_says_you_can_start_now() { let sent = mailer.sent(); assert_eq!(sent.len(), 1); - assert_eq!(sent[0].to, "emre@dizey.sh"); + assert_eq!(sent[0].to, "emre@izlek.sh"); assert_eq!(sent[0].subject, "You can start now"); assert!( sent[0].body.contains("Onboarding mails"), @@ -3475,7 +3475,7 @@ async fn a_deleted_blocker_also_says_you_can_start_now() { #[tokio::test] async fn a_delete_that_leaves_somebody_still_waiting_mails_nobody() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let first = add_task(&store, &workspace, "Backlog", "Signing keys", None, &admin).await; @@ -3504,7 +3504,7 @@ async fn a_delete_that_leaves_somebody_still_waiting_mails_nobody() { .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); // Deleting one of two blockers frees nobody, so there is no event at all // and nothing to fire on. @@ -3531,7 +3531,7 @@ async fn a_delete_that_leaves_somebody_still_waiting_mails_nobody() { #[tokio::test] async fn a_mail_owed_by_a_delete_is_rebuilt_from_the_delete_on_a_retry() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let waiting = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let blocker = add_task(&store, &workspace, "Backlog", "Signing keys", None, &admin).await; @@ -3554,7 +3554,7 @@ async fn a_mail_owed_by_a_delete_is_rebuilt_from_the_delete_on_a_retry() { // readable back as an event — the deleted task's key included, since the // task itself is gone. let mailer = Remembering::refusing(vec![MailError::retryable("connection refused")]); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let deletion = store.delete_task(&blocker, &admin, now).await.unwrap(); let freeing = deletion.event.clone().unwrap(); assert_eq!( @@ -3584,16 +3584,16 @@ async fn a_mail_owed_by_a_delete_is_rebuilt_from_the_delete_on_a_retry() { #[tokio::test] async fn nobody_is_mailed_about_what_they_did_themselves() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; store.assign_task(&task, &mate).await.unwrap(); let rule = a_rule(&store, &workspace, "Done", "Task completed").await; let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); // Emre is the only assignee and Emre moved the card. Telling him what he - // just did is how a person learns to filter Dizey's mail away. + // just did is how a person learns to filter Izlek's mail away. let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &mate).await; let report = engine.on_transition(&transition).await.unwrap(); assert_eq!(report, Default::default()); @@ -3607,7 +3607,7 @@ async fn nobody_is_mailed_about_what_they_did_themselves() { #[tokio::test] async fn the_actor_comes_off_the_board_audience_too_and_the_rest_still_get_it() { let (dir, store, workspace, admin) = shared().await; - let mate = member(&store, &workspace, "emre@dizey.sh", "Emre").await; + let mate = member(&store, &workspace, "emre@izlek.sh", "Emre").await; let board = store.board(&workspace).await.unwrap().unwrap(); let task = add_task(&store, &workspace, "Backlog", "Ship it", None, &admin).await; let column_id = column_named(&store, &workspace, "Done").await; @@ -3623,13 +3623,13 @@ async fn the_actor_comes_off_the_board_audience_too_and_the_rest_still_get_it() .unwrap(); let mailer = Remembering::taking_everything(); - let engine = Engine::new(store.clone(), mailer.clone(), "https://dizey.sh"); + let engine = Engine::new(store.clone(), mailer.clone(), "https://izlek.sh"); let transition = moved_to(&store, &workspace, &task, "Backlog", "Done", &mate).await; assert_eq!(engine.on_transition(&transition).await.unwrap().sent, 1); let sent = mailer.sent(); assert_eq!(sent.len(), 1, "the board minus the person who moved it"); - assert_eq!(sent[0].to, "ada@dizey.sh"); + assert_eq!(sent[0].to, "ada@izlek.sh"); let _ = std::fs::remove_dir_all(&dir); } @@ -3646,7 +3646,7 @@ async fn an_account_records_the_admin_who_made_it() { .store .create_user(NewUser { workspace_id: ws_id, - email: "grace@dizey.sh".into(), + email: "grace@izlek.sh".into(), display_name: "Grace".into(), role: Role::Member, invited_by: Some(admin_id.clone()), @@ -3721,7 +3721,7 @@ async fn a_file_name_that_is_a_path_is_stored_as_the_label_it_is() { let written: Vec = std::fs::read_dir(&scratch.dir) .unwrap() .map(|entry| entry.unwrap().file_name().to_string_lossy().into_owned()) - .filter(|name| !name.starts_with("dizey.db") && name != "dizey.key") + .filter(|name| !name.starts_with("izlek.db") && name != "izlek.key") .collect(); assert!(written.is_empty(), "{written:?}"); } diff --git a/crates/dizey-web/Cargo.toml b/crates/izlek-web/Cargo.toml similarity index 90% rename from crates/dizey-web/Cargo.toml rename to crates/izlek-web/Cargo.toml index 45d94a5..e89f641 100644 --- a/crates/dizey-web/Cargo.toml +++ b/crates/izlek-web/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "dizey-web" +name = "izlek-web" version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true -description = "Dizey web app: leptos UI, server functions and the axum server" +description = "Izlek web app: leptos UI, server functions and the axum server" [lib] crate-type = ["cdylib", "rlib"] @@ -18,7 +18,7 @@ serde.workspace = true time.workspace = true thiserror.workspace = true -dizey-core = { workspace = true } +izlek-core = { workspace = true } axum = { version = "0.8.9", features = ["multipart"], optional = true } tokio = { workspace = true, optional = true } tower = { version = "0.5.2", optional = true } @@ -56,7 +56,7 @@ ssr = [ "dep:tokio", "dep:tower", "dep:tower-http", - "dizey-core/server", + "izlek-core/server", "dep:turso", "dep:serde_json", "dep:lettre", @@ -64,7 +64,7 @@ ssr = [ ] # The HTTP test drives the real router, so it needs the server side of the app. -# Run it with `cargo test -p dizey-web --features ssr`. +# Run it with `cargo test -p izlek-web --features ssr`. [dev-dependencies] tokio = { workspace = true } tower = { version = "0.5.2", features = ["util"] } diff --git a/crates/dizey-web/src/app.rs b/crates/izlek-web/src/app.rs similarity index 94% rename from crates/dizey-web/src/app.rs rename to crates/izlek-web/src/app.rs index 213fffe..75b9372 100644 --- a/crates/dizey-web/src/app.rs +++ b/crates/izlek-web/src/app.rs @@ -8,7 +8,7 @@ use crate::rules::RulesPage; use crate::settings::SettingsPage; /// The HTML document the server streams. `cargo-leptos` writes the bundle to -/// `/pkg/dizey.{js,wasm,css}`, which is what the tags below point at. +/// `/pkg/izlek.{js,wasm,css}`, which is what the tags below point at. pub fn shell(options: LeptosOptions) -> impl IntoView { view! { @@ -38,8 +38,8 @@ pub fn App() -> impl IntoView { provide_meta_context(); view! { - - + <Stylesheet id="leptos" href="/pkg/izlek.css"/> + <Title text="Izlek"/> <Router> // In-order streaming, not the out-of-order default. Out-of-order ships // the page inside a <template> and relies on a script to move it into diff --git a/crates/dizey-web/src/auth.rs b/crates/izlek-web/src/auth.rs similarity index 97% rename from crates/dizey-web/src/auth.rs rename to crates/izlek-web/src/auth.rs index bc8ea04..1475580 100644 --- a/crates/dizey-web/src/auth.rs +++ b/crates/izlek-web/src/auth.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; /// The two password wordings, as the store states them. They are repeated here /// because a password problem has to be named on the client — which has no -/// `dizey_core::auth` — and `the_password_wordings_match_the_store` below fails +/// `izlek_core::auth` — and `the_password_wordings_match_the_store` below fails /// the build if the two ever drift apart. const TOO_SHORT: &str = "at least 10 characters"; const LOOKS_LIKE_YOU: &str = "not your address or your name"; @@ -279,7 +279,7 @@ mod refusal_tests { #[cfg(feature = "ssr")] #[test] fn the_password_wordings_match_the_store() { - use dizey_core::auth::PasswordProblem; + use izlek_core::auth::PasswordProblem; assert_eq!(PasswordProblem::TooShort.to_string(), TOO_SHORT); assert_eq!(PasswordProblem::LooksLikeYou.to_string(), LOOKS_LIKE_YOU); } @@ -305,7 +305,7 @@ pub struct Me { pub id: String, pub display_name: String, pub email: String, - pub role: dizey_core::Role, + pub role: izlek_core::Role, } /// Which of the three doors this browser is standing at. @@ -330,7 +330,7 @@ pub struct Invited { /// The workspace has exactly one name and no screen that sets it, so it is a /// constant rather than a field nobody was shown. -pub const WORKSPACE_NAME: &str = "Dizey"; +pub const WORKSPACE_NAME: &str = "Izlek"; /// Which door to show. (The `#[server]` macro names a struct after the /// function, so the call is `current_gate` and the answer is a `Gate`.) @@ -367,7 +367,7 @@ pub async fn claim_workspace( password: String, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, set_session_cookie}; - use dizey_core::accounts::SESSION_LIFETIME; + use izlek_core::accounts::SESSION_LIFETIME; match accounts() .claim_workspace(WORKSPACE_NAME, &email, &display_name, &password) @@ -385,7 +385,7 @@ pub async fn claim_workspace( #[server] pub async fn invitation(token: String) -> Result<Option<Invited>, ServerFnError> { use crate::server::accounts; - use dizey_core::auth::hash_token; + use izlek_core::auth::hash_token; use time::OffsetDateTime; let store = accounts().store().clone(); @@ -430,7 +430,7 @@ pub async fn redeem_link( password: String, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, client_label, set_session_cookie}; - use dizey_core::accounts::SESSION_LIFETIME; + use izlek_core::accounts::SESSION_LIFETIME; match accounts() .redeem_signin_link(&token, &password, &client_label()) @@ -449,7 +449,7 @@ pub async fn redeem_link( #[server] pub async fn sign_in(email: String, password: String) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, client_label, set_session_cookie}; - use dizey_core::accounts::SESSION_LIFETIME; + use izlek_core::accounts::SESSION_LIFETIME; match accounts().sign_in(&email, &password, &client_label()).await { Ok(signed_in) => { @@ -487,7 +487,7 @@ pub async fn change_password( new: String, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{client_label, require_user, set_session_cookie}; - use dizey_core::accounts::SESSION_LIFETIME; + use izlek_core::accounts::SESSION_LIFETIME; let user = match require_user().await { Ok(user) => user, @@ -511,7 +511,7 @@ pub async fn change_password( pub async fn invite_member( email: String, display_name: String, - role: dizey_core::Role, + role: izlek_core::Role, ) -> Result<Result<String, Refusal>, ServerFnError> { use crate::server::{accounts, require_admin}; diff --git a/crates/dizey-web/src/board.rs b/crates/izlek-web/src/board.rs similarity index 98% rename from crates/dizey-web/src/board.rs rename to crates/izlek-web/src/board.rs index 4484a24..565e71d 100644 --- a/crates/dizey-web/src/board.rs +++ b/crates/izlek-web/src/board.rs @@ -5,7 +5,7 @@ //! is refused in the server functions below — the missing button is a courtesy, //! not the guard. -use dizey_core::board::{BoardView, Person, TaskCard}; +use izlek_core::board::{BoardView, Person, TaskCard}; use leptos::prelude::*; use serde::{Deserialize, Serialize}; use time::Date; @@ -29,7 +29,7 @@ pub struct BoardSnapshot { #[server] pub async fn current_board() -> Result<Result<BoardSnapshot, Refusal>, ServerFnError> { use crate::server::{accounts, require_user}; - use dizey_core::board::load; + use izlek_core::board::load; use time::OffsetDateTime; let user = match require_user().await { @@ -62,7 +62,7 @@ pub async fn create_task( column_id: String, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, require_writer}; - use dizey_core::store::NewTask; + use izlek_core::store::NewTask; let user = match require_writer().await { Ok(user) => user, @@ -74,7 +74,7 @@ pub async fn create_task( } let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); let Some(board) = store.board(&user.workspace_id).await.map_err(fail)? else { return Ok(Some(Refusal::Unavailable)); }; @@ -113,7 +113,7 @@ pub async fn move_card( ) -> Result<Option<Refusal>, ServerFnError> { use crate::detail::guard::writer_and_task; use crate::server::accounts; - use dizey_core::board::Moved; + use izlek_core::board::Moved; use time::OffsetDateTime; let (user, facts) = match writer_and_task(&task_id).await { @@ -124,7 +124,7 @@ pub async fn move_card( // store is asked, so a column id from another board is refused by the // handler and not merely by a foreign key. let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); let columns = store.columns(&facts.board_id).await.map_err(fail)?; if !columns.iter().any(|column| column.id == to_column_id) { return Ok(Some(Refusal::Forbidden)); @@ -151,7 +151,7 @@ pub async fn move_card( // error: the board simply re-reads and looks the same. Ok(Moved::Unchanged) => Ok(None), Ok(Moved::Stale) => Ok(Some(Refusal::MovedAlready)), - Err(dizey_core::store::StoreError::NotFound) => Ok(Some(Refusal::NotFound)), + Err(izlek_core::store::StoreError::NotFound) => Ok(Some(Refusal::NotFound)), Err(error) => { eprintln!("store error: {error}"); Ok(Some(Refusal::Unavailable)) @@ -376,7 +376,7 @@ fn BoardScreen( view! { <header class="topbar"> <div class="wordmark"> - <span class="wordmark-text">"dizey"</span> + <span class="wordmark-text">"izlek"</span> <span class="wordmark-dot"></span> </div> <div class="topbar-divider"></div> diff --git a/crates/dizey-web/src/detail.rs b/crates/izlek-web/src/detail.rs similarity index 98% rename from crates/dizey-web/src/detail.rs rename to crates/izlek-web/src/detail.rs index 9cf3808..2d8c547 100644 --- a/crates/dizey-web/src/detail.rs +++ b/crates/izlek-web/src/detail.rs @@ -6,8 +6,8 @@ //! asker's workspace before it does anything — a task id in a form is an //! authorization question, not a validation one. -use dizey_core::board::Person; -use dizey_core::detail::{Comment, DeletionCost, DependencyEdge, TaskDetail}; +use izlek_core::board::Person; +use izlek_core::detail::{Comment, DeletionCost, DependencyEdge, TaskDetail}; use leptos::either::Either; use leptos::prelude::*; use serde::{Deserialize, Serialize}; @@ -57,8 +57,8 @@ pub enum Direction { #[cfg(feature = "ssr")] pub(crate) mod guard { use crate::auth::Refusal; - use dizey_core::detail::TaskFacts; - use dizey_core::store::{Store, User}; + use izlek_core::detail::TaskFacts; + use izlek_core::store::{Store, User}; /// The task, if this person's workspace is the one holding it. A task in /// another workspace is not found rather than forbidden: the answer says @@ -96,7 +96,7 @@ pub(crate) mod guard { #[server] pub async fn fetch_task(task_id: String) -> Result<Result<DetailSnapshot, Refusal>, ServerFnError> { use crate::server::{accounts, require_user}; - use dizey_core::detail::load; + use izlek_core::detail::load; use time::OffsetDateTime; let user = match require_user().await { @@ -104,7 +104,7 @@ pub async fn fetch_task(task_id: String) -> Result<Result<DetailSnapshot, Refusa Err(refusal) => return Ok(Err(refusal)), }; let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); let Some(detail) = load(store.as_ref(), &user.workspace_id, &task_id) .await @@ -242,7 +242,7 @@ pub async fn save_task( #[server] pub async fn assign(task_id: String, user_id: String) -> Result<Option<Refusal>, ServerFnError> { use crate::server::accounts; - use dizey_core::detail::ActivityKind; + use izlek_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match guard::writer_and_task(&task_id).await { @@ -250,7 +250,7 @@ pub async fn assign(task_id: String, user_id: String) -> Result<Option<Refusal>, Err(refusal) => return Ok(Some(refusal)), }; let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); // The person named in the form is checked against this workspace, not // trusted, and a viewer is refused here rather than left out of the picker. @@ -284,7 +284,7 @@ pub async fn assign(task_id: String, user_id: String) -> Result<Option<Refusal>, #[server] pub async fn unassign(task_id: String, user_id: String) -> Result<Option<Refusal>, ServerFnError> { use crate::server::accounts; - use dizey_core::detail::ActivityKind; + use izlek_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match guard::writer_and_task(&task_id).await { @@ -292,7 +292,7 @@ pub async fn unassign(task_id: String, user_id: String) -> Result<Option<Refusal Err(refusal) => return Ok(Some(refusal)), }; let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); let Some(person) = store.user(&user_id).await.map_err(fail)? else { return Ok(Some(Refusal::NotFound)); @@ -327,8 +327,8 @@ pub async fn link_tasks( direction: Direction, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::accounts; - use dizey_core::detail::ActivityKind; - use dizey_core::store::StoreError; + use izlek_core::detail::ActivityKind; + use izlek_core::store::StoreError; use time::OffsetDateTime; let (actor, _) = match guard::writer_and_task(&task_id).await { @@ -373,7 +373,7 @@ pub async fn unlink_tasks( direction: Direction, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::accounts; - use dizey_core::detail::ActivityKind; + use izlek_core::detail::ActivityKind; use time::OffsetDateTime; let (actor, _) = match guard::writer_and_task(&task_id).await { @@ -391,7 +391,7 @@ pub async fn unlink_tasks( Direction::Blocks => (other_id.clone(), task_id.clone()), }; let now = OffsetDateTime::now_utc(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); store .clear_dependency(&blocked, &blocking, now) .await @@ -540,7 +540,7 @@ pub async fn delete_file(file_id: String) -> Result<Option<Refusal>, ServerFnErr fn StatusControl( task_id: StoredValue<String>, column_id: String, - columns: Vec<dizey_core::board::Column>, + columns: Vec<izlek_core::board::Column>, action: ServerAction<crate::board::MoveCard>, ) -> impl IntoView { // An effect never runs on the server, so this is false through SSR and @@ -1506,7 +1506,7 @@ fn DetailScreen( .actor .as_ref() .map(|person| person.display_name.clone()) - .unwrap_or_else(|| "Dizey".to_string()); + .unwrap_or_else(|| "Izlek".to_string()); view! { <div class="activity-line"> <span class="activity-stamp">{entry.moment()}</span> @@ -1563,7 +1563,7 @@ fn DetailScreen( })} </ul> <div class="confirm-note"> - "The task keeps its record in the database, but nothing in Dizey brings it back." + "The task keeps its record in the database, but nothing in Izlek brings it back." </div> <div class="confirm-row"> <button @@ -1737,7 +1737,7 @@ fn DepRow( /// quiet note saying where it came from. #[component] fn FileChip( - file: dizey_core::detail::FileLine, + file: izlek_core::detail::FileLine, me: Me, action: ServerAction<DeleteFile>, ) -> impl IntoView { @@ -1770,7 +1770,7 @@ fn FileChip( #[component] fn CommentRow(comment: Comment) -> impl IntoView { - use dizey_core::detail::moment_label; + use izlek_core::detail::moment_label; let author = comment.author.clone(); view! { diff --git a/crates/dizey-web/src/files.rs b/crates/izlek-web/src/files.rs similarity index 99% rename from crates/dizey-web/src/files.rs rename to crates/izlek-web/src/files.rs index abde088..e6c84d2 100644 --- a/crates/dizey-web/src/files.rs +++ b/crates/izlek-web/src/files.rs @@ -9,8 +9,8 @@ use axum::extract::{Extension, Multipart, Path}; use axum::http::{HeaderMap, HeaderValue, StatusCode}; use axum::response::{IntoResponse, Redirect, Response}; -use dizey_core::accounts::Accounts; -use dizey_core::store::{NewAttachment, User}; +use izlek_core::accounts::Accounts; +use izlek_core::store::{NewAttachment, User}; use time::OffsetDateTime; use crate::auth::Refusal; @@ -210,7 +210,7 @@ pub async fn upload( } /// The `Content-Disposition` header for one download: always `attachment`, so -/// an uploaded HTML or SVG file is offered to save rather than run on Dizey's +/// an uploaded HTML or SVG file is offered to save rather than run on Izlek's /// origin. The ASCII fallback keeps only characters no quoting scheme could /// turn into a delimiter or a control character; `filename*` carries the real /// name, percent-encoded, for browsers that read it. diff --git a/crates/dizey-web/src/lib.rs b/crates/izlek-web/src/lib.rs similarity index 100% rename from crates/dizey-web/src/lib.rs rename to crates/izlek-web/src/lib.rs diff --git a/crates/dizey-web/src/main.rs b/crates/izlek-web/src/main.rs similarity index 77% rename from crates/dizey-web/src/main.rs rename to crates/izlek-web/src/main.rs index 1e028ff..3ecd07d 100644 --- a/crates/dizey-web/src/main.rs +++ b/crates/izlek-web/src/main.rs @@ -1,26 +1,26 @@ #[cfg(feature = "ssr")] #[tokio::main] async fn main() { - use dizey_core::accounts::Accounts; - use dizey_core::store::TursoStore; + use izlek_core::accounts::Accounts; + use izlek_core::store::TursoStore; use leptos::prelude::*; use std::sync::Arc; - // dizey.toml is read here, before anything is opened, and written with + // izlek.toml is read here, before anything is opened, and written with // development defaults if it is not there yet. A broken key stops the // boot with its name in the message: the failure this prevents is not an - // empty database, it is a second Dizey writing a different file while + // empty database, it is a second Izlek writing a different file while // everyone believes they share a board. - let config = match dizey_core::Config::load() { + let config = match izlek_core::Config::load() { Ok(config) => config, Err(problem) => { - eprintln!("dizey: {problem}"); + eprintln!("izlek: {problem}"); std::process::exit(2); } }; // Said once, so the answer to "which file are we on" lives in the log. for line in config.report() { - println!("dizey {line}"); + println!("izlek {line}"); } // One process per database file: Turso is a single-writer engine and a @@ -30,31 +30,31 @@ async fn main() { let store = TursoStore::open(&config.database.to_string_lossy()) .await .expect("failed to open the database"); - let store: Arc<dyn dizey_core::store::Store> = Arc::new(store); + let store: Arc<dyn izlek_core::store::Store> = Arc::new(store); let accounts = Accounts::new(store.clone()); // The engine is always built, because a sender can appear at any moment: // an admin fills the panel in and the next sweep sends what was held. It // holds one connection pool, rebuilt only when the settings behind it // change, and two things use it — every committed crossing, and the sweep. - let engine = Arc::new(dizey_core::MailEngine::new( + let engine = Arc::new(izlek_core::MailEngine::new( store.clone(), - Arc::new(dizey_web::smtp::WorkspaceSmtp::new(store.clone())), + Arc::new(izlek_web::smtp::WorkspaceSmtp::new(store.clone())), config.base_url.clone(), )); tokio::spawn(sweep(engine.clone())); - let mail = dizey_web::server::Mail::sending(engine); + let mail = izlek_web::server::Mail::sending(engine); let conf = get_configuration(None).expect("failed to read leptos configuration"); let leptos_options = conf.leptos_options; let addr = leptos_options.site_addr; - let app = dizey_web::server::router(accounts, mail, leptos_options); + let app = izlek_web::server::router(accounts, mail, leptos_options); let listener = tokio::net::TcpListener::bind(&addr) .await .expect("failed to bind"); - println!("dizey listening on http://{addr}"); + println!("izlek listening on http://{addr}"); axum::serve( listener, app.into_make_service_with_connect_info::<std::net::SocketAddr>(), @@ -72,7 +72,7 @@ async fn main() { /// own, and a send that has used its attempts is written off rather than /// carried forever. #[cfg(feature = "ssr")] -async fn sweep(engine: std::sync::Arc<dizey_core::MailEngine>) { +async fn sweep(engine: std::sync::Arc<izlek_core::MailEngine>) { /// Enough that a morning's backlog clears in a few passes, few enough that /// one pass cannot sit on the mail server for minutes. const PER_PASS: u32 = 50; @@ -85,11 +85,11 @@ async fn sweep(engine: std::sync::Arc<dizey_core::MailEngine>) { .await { Ok(report) if report.sent + report.failed + report.abandoned > 0 => println!( - "dizey mail sweep: {} sent, {} to retry, {} given up on", + "izlek mail sweep: {} sent, {} to retry, {} given up on", report.sent, report.failed, report.abandoned ), Ok(_) => {} - Err(problem) => eprintln!("dizey mail sweep could not read the ledger: {problem}"), + Err(problem) => eprintln!("izlek mail sweep could not read the ledger: {problem}"), } } } diff --git a/crates/dizey-web/src/pages.rs b/crates/izlek-web/src/pages.rs similarity index 98% rename from crates/dizey-web/src/pages.rs rename to crates/izlek-web/src/pages.rs index 7440646..5577473 100644 --- a/crates/dizey-web/src/pages.rs +++ b/crates/izlek-web/src/pages.rs @@ -55,14 +55,14 @@ fn Topbar() -> impl IntoView { view! { <header class="topbar"> <div class="wordmark"> - <span class="wordmark-text">"dizey"</span> + <span class="wordmark-text">"izlek"</span> <span class="wordmark-dot"></span> </div> </header> } } -/// "Set up Dizey" — the first account in an empty workspace. +/// "Set up Izlek" — the first account in an empty workspace. #[component] fn SetupCard(on_done: impl Fn() + Copy + Send + Sync + 'static) -> impl IntoView { let action = ServerAction::<ClaimWorkspace>::new(); @@ -79,7 +79,7 @@ fn SetupCard(on_done: impl Fn() + Copy + Send + Sync + 'static) -> impl IntoView <span class="auth-kicker">"FIRST ACCOUNT — EMPTY WORKSPACE"</span> <div class="auth-card"> <div class="auth-head"> - <div class="auth-title">"Set up Dizey"</div> + <div class="auth-title">"Set up Izlek"</div> <div class="auth-sub"> "Nobody has signed in yet, so this account administers the workspace: the mail sender, the limits and the member list are yours." </div> @@ -272,7 +272,7 @@ fn SignInCard(on_done: impl Fn() + Copy + Send + Sync + 'static) -> impl IntoVie <span class="auth-kicker">"SIGN IN"</span> <div class="auth-card"> <div class="auth-head"> - <div class="auth-title">"Sign in to Dizey"</div> + <div class="auth-title">"Sign in to Izlek"</div> <div class="auth-sub"> "Accounts are made by the admin. If you were invited, use the link you were sent — it is where you choose your password." </div> diff --git a/crates/dizey-web/src/rules.rs b/crates/izlek-web/src/rules.rs similarity index 97% rename from crates/dizey-web/src/rules.rs rename to crates/izlek-web/src/rules.rs index 2eaa2ee..2856df1 100644 --- a/crates/dizey-web/src/rules.rs +++ b/crates/izlek-web/src/rules.rs @@ -52,8 +52,8 @@ pub struct RulesSnapshot { /// The word for an audience, as the artboard writes it. #[cfg(feature = "ssr")] -fn audience_word(audience: dizey_core::store::Audience) -> &'static str { - use dizey_core::store::Audience; +fn audience_word(audience: izlek_core::store::Audience) -> &'static str { + use izlek_core::store::Audience; match audience { Audience::Assignees => "assignees", Audience::Board => "everyone on board", @@ -65,14 +65,14 @@ fn audience_word(audience: dizey_core::store::Audience) -> &'static str { #[server] pub async fn current_rules() -> Result<Result<RulesSnapshot, Refusal>, ServerFnError> { use crate::server::{accounts, require_admin}; - use dizey_core::store::Trigger; + use izlek_core::store::Trigger; let user = match require_admin().await { Ok(user) => user, Err(refusal) => return Ok(Err(refusal)), }; let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); let Some(board) = store.board(&user.workspace_id).await.map_err(fail)? else { return Ok(Err(Refusal::Unavailable)); }; @@ -115,7 +115,7 @@ pub async fn current_rules() -> Result<Result<RulesSnapshot, Refusal>, ServerFnE last_sent: last_sent .iter() .find(|(id, _)| id == &rule.id) - .map(|(_, at)| dizey_core::detail::moment_label(*at)), + .map(|(_, at)| izlek_core::detail::moment_label(*at)), id: rule.id, } }) @@ -151,7 +151,7 @@ pub async fn create_rule( audience: String, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, require_admin}; - use dizey_core::store::{Audience, Trigger}; + use izlek_core::store::{Audience, Trigger}; let user = match require_admin().await { Ok(user) => user, @@ -168,7 +168,7 @@ pub async fn create_rule( }; let store = accounts().store().clone(); - let fail = |e: dizey_core::store::StoreError| ServerFnError::new(e.to_string()); + let fail = |e: izlek_core::store::StoreError| ServerFnError::new(e.to_string()); let Some(board) = store.board(&user.workspace_id).await.map_err(fail)? else { return Ok(Some(Refusal::Unavailable)); }; @@ -239,7 +239,7 @@ pub async fn delete_rule(rule_id: String) -> Result<Option<Refusal>, ServerFnErr #[cfg(feature = "ssr")] async fn rule_of_this_workspace( rule_id: &str, -) -> Result<std::sync::Arc<dyn dizey_core::store::Store>, Refusal> { +) -> Result<std::sync::Arc<dyn izlek_core::store::Store>, Refusal> { use crate::server::{accounts, require_admin}; let user = require_admin().await?; @@ -316,7 +316,7 @@ fn RulesScreen(snapshot: RulesSnapshot, on_change: Callback<()>) -> impl IntoVie view! { <header class="topbar"> <div class="wordmark"> - <span class="wordmark-text">"dizey"</span> + <span class="wordmark-text">"izlek"</span> <span class="wordmark-dot"></span> </div> <div class="topbar-divider"></div> diff --git a/crates/dizey-web/src/server.rs b/crates/izlek-web/src/server.rs similarity index 94% rename from crates/dizey-web/src/server.rs rename to crates/izlek-web/src/server.rs index 18435cc..70b1b94 100644 --- a/crates/dizey-web/src/server.rs +++ b/crates/izlek-web/src/server.rs @@ -7,15 +7,15 @@ use axum::http::HeaderValue; use axum::http::header::{COOKIE, SET_COOKIE}; use axum::http::request::Parts; -use dizey_core::accounts::{AccountError, Accounts}; -use dizey_core::board::Transition; -use dizey_core::mail::Engine; -use dizey_core::store::{Freeing, User}; +use izlek_core::accounts::{AccountError, Accounts}; +use izlek_core::board::Transition; +use izlek_core::mail::Engine; +use izlek_core::store::{Freeing, User}; use leptos::prelude::*; use leptos_axum::ResponseOptions; /// The session cookie's name. One cookie, one browser, one session row. -pub const SESSION_COOKIE: &str = "dizey_session"; +pub const SESSION_COOKIE: &str = "izlek_session"; /// The workspace's account service, put into context by the router. pub fn accounts() -> Accounts { @@ -76,21 +76,21 @@ impl Mail { /// Sends one test mail and waits for the answer, because the answer is the /// whole point of pressing the button. `None` means this process has no /// engine at all, which happens only in tests. - pub async fn test(&self, to: &str) -> Option<Result<time::Duration, dizey_core::MailError>> { + pub async fn test(&self, to: &str) -> Option<Result<time::Duration, izlek_core::MailError>> { let engine = self.0.clone()?; Some(engine.send_test(to).await) } - fn log(report: dizey_core::store::Result<dizey_core::mail::Report>) { + fn log(report: izlek_core::store::Result<izlek_core::mail::Report>) { match report { Ok(report) if report.sent + report.failed + report.abandoned > 0 => { println!( - "dizey mail {} sent, {} to retry, {} given up on", + "izlek mail {} sent, {} to retry, {} given up on", report.sent, report.failed, report.abandoned ); } Ok(_) => {} - Err(problem) => eprintln!("dizey mail the ledger could not be read: {problem}"), + Err(problem) => eprintln!("izlek mail the ledger could not be read: {problem}"), } } } @@ -125,7 +125,7 @@ pub fn session_in(headers: &axum::http::HeaderMap) -> Option<String> { } /// A stable-enough label for the client, for rate limiting. A proxy header is -/// only trusted because Dizey is meant to sit behind one; the address bucket is +/// only trusted because Izlek is meant to sit behind one; the address bucket is /// the limit that actually protects the Argon2 work either way. pub fn client_label() -> String { let Some(parts) = use_context::<Parts>() else { @@ -290,7 +290,7 @@ pub fn router( /// browser without script has no such thing: it posts the form, the server /// function handler answers `302` back to the page it came from, and the value /// — the whole refusal — sits in a body nobody will ever look at. The click -/// then looks like nothing happening, which is the worst answer Dizey can give. +/// then looks like nothing happening, which is the worst answer Izlek can give. /// /// So the refusal is copied onto the `Location`, as `?refusal=<code>&on=<call>`, /// and the page renders it from the query. This is one place rather than @@ -350,7 +350,7 @@ fn carrying(location: &str, code: &str, called: &str) -> Option<String> { } // The Location we are rewriting came from the form post's Referer, and on a // cross-origin post the Referer is whatever the other site is. Sending the - // browser back there would make Dizey an open redirect, so the address is + // browser back there would make Izlek an open redirect, so the address is // rebuilt from its path and query alone and anything that is not a plain // absolute path is answered with the board. let here = same_origin(location); @@ -396,7 +396,7 @@ mod refusal_redirect_tests { #[test] fn a_bare_address_gains_a_query() { assert_eq!( - carrying("http://dizey.sh/", "cycle", "link_tasks").as_deref(), + carrying("http://izlek.sh/", "cycle", "link_tasks").as_deref(), Some("/?refusal=cycle&on=link_tasks") ); } @@ -404,7 +404,7 @@ mod refusal_redirect_tests { #[test] fn an_open_modal_stays_open() { assert_eq!( - carrying("http://dizey.sh/?task=DZ-01", "cycle", "link_tasks").as_deref(), + carrying("http://izlek.sh/?task=DZ-01", "cycle", "link_tasks").as_deref(), Some("/?task=DZ-01&refusal=cycle&on=link_tasks") ); } @@ -413,7 +413,7 @@ mod refusal_redirect_tests { fn a_second_refusal_replaces_the_first() { assert_eq!( carrying( - "http://dizey.sh/?task=DZ-01&refusal=cycle&on=link_tasks", + "http://izlek.sh/?task=DZ-01&refusal=cycle&on=link_tasks", "not-found", "link_tasks" ) @@ -423,7 +423,7 @@ mod refusal_redirect_tests { } // The Referer of a cross-origin post is the other site's address, and it - // reaches this function as the Location. Dizey answers on its own ground or + // reaches this function as the Location. Izlek answers on its own ground or // not at all. #[test] fn another_site_cannot_be_redirected_to() { @@ -442,7 +442,7 @@ mod refusal_redirect_tests { } // An address with a path keeps the path — it is read as a path on this // site, which is the point: whatever the Referer claimed, the browser - // is sent somewhere on Dizey. + // is sent somewhere on Izlek. let carried = carrying( "http://elsewhere.example/steal?task=DZ-01", "cycle", @@ -464,6 +464,6 @@ mod refusal_redirect_tests { #[test] fn a_call_with_no_name_carries_nothing() { - assert_eq!(carrying("http://dizey.sh/", "cycle", ""), None); + assert_eq!(carrying("http://izlek.sh/", "cycle", ""), None); } } diff --git a/crates/dizey-web/src/settings.rs b/crates/izlek-web/src/settings.rs similarity index 98% rename from crates/dizey-web/src/settings.rs rename to crates/izlek-web/src/settings.rs index 4c6b612..36a23cb 100644 --- a/crates/dizey-web/src/settings.rs +++ b/crates/izlek-web/src/settings.rs @@ -56,7 +56,7 @@ impl Sender { #[cfg(feature = "ssr")] impl Sender { /// What the screen may see of the workspace's sender. - pub fn of(workspace: &dizey_core::store::Workspace) -> Self { + pub fn of(workspace: &izlek_core::store::Workspace) -> Self { Self { host: workspace.smtp_host.clone().unwrap_or_default(), // 587 is submission with STARTTLS, which is what a new panel should @@ -67,7 +67,7 @@ impl Sender { from_address: workspace.smtp_from_address.clone().unwrap_or_default(), password_set: workspace.smtp_password_set, test: workspace.sender_test.as_ref().map(|test| TestResult { - moment: dizey_core::detail::moment_label(test.at), + moment: izlek_core::detail::moment_label(test.at), took: test.error.is_none().then(|| took_label(test.took_ms)), error: test.error.clone(), }), @@ -115,7 +115,7 @@ pub struct Member { pub id: String, pub display_name: String, pub email: String, - pub role: dizey_core::Role, + pub role: izlek_core::Role, pub has_password: bool, /// The day they last signed in, as the list writes it, or nothing. pub last_signed_in: Option<String>, @@ -191,7 +191,7 @@ async fn sender_now() -> Result<Sender, ServerFnError> { } #[cfg(feature = "ssr")] -async fn members_now(asking: &dizey_core::store::User) -> Result<Vec<Member>, ServerFnError> { +async fn members_now(asking: &izlek_core::store::User) -> Result<Vec<Member>, ServerFnError> { let store = crate::server::accounts().store().clone(); let owner = store .owner() @@ -206,7 +206,7 @@ async fn members_now(asking: &dizey_core::store::User) -> Result<Vec<Member>, Se .into_iter() .map(|user| Member { has_password: user.password_hash.is_some(), - last_signed_in: user.last_signed_in_at.map(|at| dizey_core::board::day_label(at.date())), + last_signed_in: user.last_signed_in_at.map(|at| izlek_core::board::day_label(at.date())), is_you: user.id == asking.id, is_owner: owner.as_deref() == Some(user.id.as_str()), id: user.id, @@ -319,7 +319,7 @@ pub async fn save_sender( from_address: String, ) -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, require_admin}; - use dizey_core::store::NewSender; + use izlek_core::store::NewSender; let admin = match require_admin().await { Ok(admin) => admin, @@ -387,12 +387,12 @@ pub async fn save_sender( /// went so the answer survives a reload. /// /// It goes to their own address and nowhere else. A test that could be pointed -/// at an address somebody typed would be a way to make Dizey mail a stranger +/// at an address somebody typed would be a way to make Izlek mail a stranger /// on demand, which is a thing worth not building. #[server] pub async fn send_test_mail() -> Result<Option<Refusal>, ServerFnError> { use crate::server::{accounts, mail, require_admin}; - use dizey_core::store::SenderTest; + use izlek_core::store::SenderTest; let admin = match require_admin().await { Ok(admin) => admin, @@ -568,7 +568,7 @@ fn SettingsScreen( view! { <header class="topbar"> <div class="wordmark"> - <span class="wordmark-text">"dizey"</span> + <span class="wordmark-text">"izlek"</span> <span class="wordmark-dot"></span> </div> <div class="topbar-divider"></div> @@ -818,7 +818,7 @@ fn SenderPanel(sender: Sender, on_change: Callback<()>) -> impl IntoView { type="text" name="from_name" value=sender.from_name - placeholder="Dizey" + placeholder="Izlek" /> </label> <label class="field"> @@ -828,7 +828,7 @@ fn SenderPanel(sender: Sender, on_change: Callback<()>) -> impl IntoView { type="text" name="from_address" value=sender.from_address - placeholder="board@dizey.sh" + placeholder="board@izlek.sh" /> </label> </div> diff --git a/crates/dizey-web/src/smtp.rs b/crates/izlek-web/src/smtp.rs similarity index 98% rename from crates/dizey-web/src/smtp.rs rename to crates/izlek-web/src/smtp.rs index 1979bea..e9bb43d 100644 --- a/crates/dizey-web/src/smtp.rs +++ b/crates/izlek-web/src/smtp.rs @@ -19,8 +19,8 @@ use std::sync::Arc; -use dizey_core::store::Store; -use dizey_core::mail::{MailError, Mailer, Outgoing}; +use izlek_core::store::Store; +use izlek_core::mail::{MailError, Mailer, Outgoing}; use lettre::message::header::ContentType; use lettre::transport::smtp::authentication::Credentials; use lettre::{AsyncSmtpTransport, AsyncTransport, Message, Tokio1Executor}; diff --git a/crates/dizey-web/tests/http.rs b/crates/izlek-web/tests/http.rs similarity index 87% rename from crates/dizey-web/tests/http.rs rename to crates/izlek-web/tests/http.rs index 88cfbc1..18a46c0 100644 --- a/crates/dizey-web/tests/http.rs +++ b/crates/izlek-web/tests/http.rs @@ -15,10 +15,10 @@ use std::sync::Arc; use axum::Router; use axum::body::Body; use axum::http::{HeaderValue, Request, StatusCode, header}; -use dizey_core::Role; -use dizey_core::accounts::Accounts; -use dizey_core::store::TursoStore; -use dizey_web::server::SESSION_COOKIE; +use izlek_core::Role; +use izlek_core::accounts::Accounts; +use izlek_core::store::TursoStore; +use izlek_web::server::SESSION_COOKIE; use leptos::prelude::LeptosOptions; use leptos::server_fn::ServerFn; use tower::ServiceExt; @@ -32,15 +32,15 @@ struct App { impl App { async fn open() -> Self { - let dir = std::env::temp_dir().join(format!("dizey-http-{}", Uuid::new_v4())); + let dir = std::env::temp_dir().join(format!("izlek-http-{}", Uuid::new_v4())); std::fs::create_dir_all(&dir).unwrap(); - let store = TursoStore::open(dir.join("dizey.db").to_str().unwrap()) + let store = TursoStore::open(dir.join("izlek.db").to_str().unwrap()) .await .unwrap(); - let options = LeptosOptions::builder().output_name("dizey").build(); - let router = dizey_web::server::router( + let options = LeptosOptions::builder().output_name("izlek").build(); + let router = izlek_web::server::router( Accounts::new(Arc::new(store)), - dizey_web::server::Mail::silent(), + izlek_web::server::Mail::silent(), options, ); Self { dir, router } @@ -156,7 +156,7 @@ impl App { fields: &[(&str, &str)], file: Option<(&str, &str, &[u8])>, ) -> Answer { - const BOUNDARY: &str = "dizey-test-boundary"; + const BOUNDARY: &str = "izlek-test-boundary"; let mut body = Vec::new(); for (name, value) in fields { body.extend_from_slice( @@ -308,15 +308,15 @@ const SENDER_PASSWORD: &str = "cavalry-battery-hinge-40"; async fn sender_saved(app: &App, admin: &str) -> bool { let answer = app .post( - path::<dizey_web::settings::SaveSender>(), + path::<izlek_web::settings::SaveSender>(), Some(admin), &[ ("host", "smtp.fastmail.com"), ("port", "465"), - ("username", "dizey"), + ("username", "izlek"), ("password", SENDER_PASSWORD), - ("from_name", "Dizey"), - ("from_address", "dizey@dizey.sh"), + ("from_name", "Izlek"), + ("from_address", "izlek@izlek.sh"), ], ) .await; @@ -327,11 +327,11 @@ async fn sender_saved(app: &App, admin: &str) -> bool { async fn admin(app: &App) -> String { let answer = app .post( - path::<dizey_web::auth::ClaimWorkspace>(), + path::<izlek_web::auth::ClaimWorkspace>(), None, &[ ("display_name", "Ada Lovelace"), - ("email", "ada@dizey.sh"), + ("email", "ada@izlek.sh"), ("password", "correct horse battery staple"), ], ) @@ -350,7 +350,7 @@ async fn invited(app: &App, admin: &str, email: &str, name: &str, role: Role) -> }; let answer = app .post( - path::<dizey_web::auth::InviteMember>(), + path::<izlek_web::auth::InviteMember>(), Some(admin), &[("email", email), ("display_name", name), ("role", role)], ) @@ -365,7 +365,7 @@ async fn invited(app: &App, admin: &str, email: &str, name: &str, role: Role) -> let answer = app .post( - path::<dizey_web::auth::RedeemLink>(), + path::<izlek_web::auth::RedeemLink>(), None, &[ ("token", &token), @@ -381,7 +381,7 @@ async fn invited(app: &App, admin: &str, email: &str, name: &str, role: Role) -> /// The id of the board's first column, read the way the board page reads it. async fn first_column(app: &App, cookie: &str) -> String { let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(cookie), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(cookie), &[]) .await; assert_eq!(answer.status, StatusCode::OK, "{}", answer.body); answer @@ -396,12 +396,12 @@ async fn first_column(app: &App, cookie: &str) -> String { async fn a_viewer_who_posts_to_create_task_anyway_is_refused() { let app = App::open().await; let admin = admin(&app).await; - let viewer = invited(&app, &admin, "quiet@dizey.sh", "Quiet Reader", Role::Viewer).await; + let viewer = invited(&app, &admin, "quiet@izlek.sh", "Quiet Reader", Role::Viewer).await; let column = first_column(&app, &admin).await; let answer = app .post( - path::<dizey_web::board::CreateTask>(), + path::<izlek_web::board::CreateTask>(), Some(&viewer), &[ ("title", "Viewer should not get this"), @@ -415,7 +415,7 @@ async fn a_viewer_who_posts_to_create_task_anyway_is_refused() { // And the refusal is not cosmetic: the board is still empty. let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(&admin), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(&admin), &[]) .await; assert!( !answer.body.contains("Viewer should not get this"), @@ -428,12 +428,12 @@ async fn a_viewer_who_posts_to_create_task_anyway_is_refused() { async fn a_member_may_create_a_task() { let app = App::open().await; let admin = admin(&app).await; - let member = invited(&app, &admin, "mo@dizey.sh", "Mo Dubois", Role::Member).await; + let member = invited(&app, &admin, "mo@izlek.sh", "Mo Dubois", Role::Member).await; let column = first_column(&app, &admin).await; let answer = app .post( - path::<dizey_web::board::CreateTask>(), + path::<izlek_web::board::CreateTask>(), Some(&member), &[("title", "Wire the deadline chip"), ("column_id", &column)], ) @@ -441,7 +441,7 @@ async fn a_member_may_create_a_task() { assert_eq!(answer.body, "null", "a member was refused: {}", answer.body); let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(&admin), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(&admin), &[]) .await; assert!(answer.body.contains("Wire the deadline chip")); assert!(answer.body.contains("DZ-01"), "no key on the new task"); @@ -454,7 +454,7 @@ async fn a_task_cannot_be_dropped_into_another_workspaces_column() { let answer = app .post( - path::<dizey_web::board::CreateTask>(), + path::<izlek_web::board::CreateTask>(), Some(&admin), &[ ("title", "Wrong column"), @@ -473,7 +473,7 @@ async fn a_card_needs_a_title() { let answer = app .post( - path::<dizey_web::board::CreateTask>(), + path::<izlek_web::board::CreateTask>(), Some(&admin), &[("title", " "), ("column_id", &column)], ) @@ -487,7 +487,7 @@ async fn the_board_is_not_readable_without_a_session() { let _admin = admin(&app).await; let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), None, &[]) + .post(path::<izlek_web::board::CurrentBoard>(), None, &[]) .await; assert_eq!(answer.body, "{\"Err\":\"SignInFirst\"}"); } @@ -497,7 +497,7 @@ async fn the_board_is_not_readable_without_a_session() { async fn a_task(app: &App, cookie: &str, column: &str, title: &str) -> String { let answer = app .post( - path::<dizey_web::board::CreateTask>(), + path::<izlek_web::board::CreateTask>(), Some(cookie), &[("title", title), ("column_id", column)], ) @@ -505,7 +505,7 @@ async fn a_task(app: &App, cookie: &str, column: &str, title: &str) -> String { assert_eq!(answer.body, "null", "the task was refused: {}", answer.body); let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(cookie), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(cookie), &[]) .await; let needle = format!("\"title\":\"{title}\""); let before = answer @@ -524,13 +524,13 @@ async fn a_task(app: &App, cookie: &str, column: &str, title: &str) -> String { async fn a_viewer_who_posts_a_comment_anyway_is_refused() { let app = App::open().await; let admin = admin(&app).await; - let viewer = invited(&app, &admin, "eyes@dizey.sh", "Ida Eyes", Role::Viewer).await; + let viewer = invited(&app, &admin, "eyes@izlek.sh", "Ida Eyes", Role::Viewer).await; let column = first_column(&app, &admin).await; let task = a_task(&app, &admin, &column, "Ship the detail modal").await; let answer = app .post( - path::<dizey_web::detail::PostComment>(), + path::<izlek_web::detail::PostComment>(), Some(&viewer), &[("task_id", &task), ("body", "Viewers cannot say this")], ) @@ -541,7 +541,7 @@ async fn a_viewer_who_posts_a_comment_anyway_is_refused() { // The refusal is not cosmetic: nothing was written. let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", &task)], ) @@ -557,13 +557,13 @@ async fn a_viewer_who_posts_a_comment_anyway_is_refused() { async fn a_member_may_comment_and_the_author_is_the_session() { let app = App::open().await; let admin = admin(&app).await; - let member = invited(&app, &admin, "kai@dizey.sh", "Kai Renner", Role::Member).await; + let member = invited(&app, &admin, "kai@izlek.sh", "Kai Renner", Role::Member).await; let column = first_column(&app, &admin).await; let task = a_task(&app, &admin, &column, "Wire the picker").await; let answer = app .post( - path::<dizey_web::detail::PostComment>(), + path::<izlek_web::detail::PostComment>(), Some(&member), &[("task_id", &task), ("body", "Picker is narrow on purpose")], ) @@ -572,7 +572,7 @@ async fn a_member_may_comment_and_the_author_is_the_session() { let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", &task)], ) @@ -595,7 +595,7 @@ async fn a_link_that_would_close_a_circle_is_refused_at_the_endpoint() { let answer = app .post( - path::<dizey_web::detail::LinkTasks>(), + path::<izlek_web::detail::LinkTasks>(), Some(&admin), &[ ("task_id", &second), @@ -612,7 +612,7 @@ async fn a_link_that_would_close_a_circle_is_refused_at_the_endpoint() { let answer = app .post( - path::<dizey_web::detail::LinkTasks>(), + path::<izlek_web::detail::LinkTasks>(), Some(&admin), &[ ("task_id", &first), @@ -633,7 +633,7 @@ async fn a_refusal_reaches_a_browser_with_no_script() { let second = a_task(&app, &admin, &column, "Light the cable").await; app.post( - path::<dizey_web::detail::LinkTasks>(), + path::<izlek_web::detail::LinkTasks>(), Some(&admin), &[ ("task_id", &second), @@ -647,9 +647,9 @@ async fn a_refusal_reaches_a_browser_with_no_script() { // to read the answer's body. let answer = app .post_without_script( - path::<dizey_web::detail::LinkTasks>(), + path::<izlek_web::detail::LinkTasks>(), Some(&admin), - &format!("http://dizey.test/?task={first}"), + &format!("http://izlek.test/?task={first}"), &[ ("task_id", &first), ("other_id", &second), @@ -679,9 +679,9 @@ async fn a_call_that_was_not_refused_carries_nothing_back() { let answer = app .post_without_script( - path::<dizey_web::detail::LinkTasks>(), + path::<izlek_web::detail::LinkTasks>(), Some(&admin), - "http://dizey.test/", + "http://izlek.test/", &[ ("task_id", &second), ("other_id", &first), @@ -704,7 +704,7 @@ async fn a_task_id_from_nowhere_is_not_found() { let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", "00000000-0000-0000-0000-000000000000")], ) @@ -716,13 +716,13 @@ async fn a_task_id_from_nowhere_is_not_found() { async fn a_viewer_who_posts_a_delete_anyway_is_refused() { let app = App::open().await; let admin = admin(&app).await; - let viewer = invited(&app, &admin, "wren@dizey.sh", "Wren Ash", Role::Viewer).await; + let viewer = invited(&app, &admin, "wren@izlek.sh", "Wren Ash", Role::Viewer).await; let column = first_column(&app, &admin).await; let task = a_task(&app, &admin, &column, "Viewers cannot remove this").await; let answer = app .post( - path::<dizey_web::detail::DeleteTask>(), + path::<izlek_web::detail::DeleteTask>(), Some(&viewer), &[("task_id", &task)], ) @@ -730,7 +730,7 @@ async fn a_viewer_who_posts_a_delete_anyway_is_refused() { assert_eq!(answer.body, "\"Forbidden\""); let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(&admin), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(&admin), &[]) .await; assert!( answer.body.contains("Viewers cannot remove this"), @@ -743,14 +743,14 @@ async fn a_viewer_who_posts_a_delete_anyway_is_refused() { async fn a_member_may_delete_and_the_delete_is_soft() { let app = App::open().await; let admin = admin(&app).await; - let member = invited(&app, &admin, "rae@dizey.sh", "Rae Okonkwo", Role::Member).await; + let member = invited(&app, &admin, "rae@izlek.sh", "Rae Okonkwo", Role::Member).await; let column = first_column(&app, &admin).await; let task = a_task(&app, &admin, &column, "Mistyped in a hurry").await; // What it would cost is a read: it says so and writes nothing. let answer = app .post( - path::<dizey_web::detail::WhatDeleteCosts>(), + path::<izlek_web::detail::WhatDeleteCosts>(), Some(&member), &[("task_id", &task)], ) @@ -761,7 +761,7 @@ async fn a_member_may_delete_and_the_delete_is_soft() { answer.body ); let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(&admin), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(&admin), &[]) .await; assert!( answer.body.contains("Mistyped in a hurry"), @@ -770,7 +770,7 @@ async fn a_member_may_delete_and_the_delete_is_soft() { let answer = app .post( - path::<dizey_web::detail::DeleteTask>(), + path::<izlek_web::detail::DeleteTask>(), Some(&member), &[("task_id", &task)], ) @@ -779,7 +779,7 @@ async fn a_member_may_delete_and_the_delete_is_soft() { // Gone from the board, and gone from the detail: soft is not visible. let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(&admin), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(&admin), &[]) .await; assert!( !answer.body.contains("Mistyped in a hurry"), @@ -788,7 +788,7 @@ async fn a_member_may_delete_and_the_delete_is_soft() { ); let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", &task)], ) @@ -800,7 +800,7 @@ async fn a_member_may_delete_and_the_delete_is_soft() { /// browser would. async fn columns_of(app: &App, cookie: &str) -> Vec<String> { let answer = app - .post(path::<dizey_web::board::CurrentBoard>(), Some(cookie), &[]) + .post(path::<izlek_web::board::CurrentBoard>(), Some(cookie), &[]) .await; assert_eq!(answer.status, StatusCode::OK, "{}", answer.body); answer @@ -816,13 +816,13 @@ async fn columns_of(app: &App, cookie: &str) -> Vec<String> { async fn a_viewer_who_posts_a_move_anyway_is_refused() { let app = App::open().await; let admin = admin(&app).await; - let viewer = invited(&app, &admin, "quiet@dizey.sh", "Quiet Reader", Role::Viewer).await; + let viewer = invited(&app, &admin, "quiet@izlek.sh", "Quiet Reader", Role::Viewer).await; let columns = columns_of(&app, &admin).await; let task = a_task(&app, &admin, &columns[0], "Stays in Backlog").await; let answer = app .post( - path::<dizey_web::board::MoveCard>(), + path::<izlek_web::board::MoveCard>(), Some(&viewer), &[ ("task_id", &task), @@ -838,7 +838,7 @@ async fn a_viewer_who_posts_a_move_anyway_is_refused() { // And nothing moved: the refusal is in the handler, not in the drawing. let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", &task)], ) @@ -854,13 +854,13 @@ async fn a_viewer_who_posts_a_move_anyway_is_refused() { async fn a_member_may_move_a_card() { let app = App::open().await; let admin = admin(&app).await; - let member = invited(&app, &admin, "mo@dizey.sh", "Mo Dubois", Role::Member).await; + let member = invited(&app, &admin, "mo@izlek.sh", "Mo Dubois", Role::Member).await; let columns = columns_of(&app, &admin).await; let task = a_task(&app, &admin, &columns[0], "Gets picked up").await; let answer = app .post( - path::<dizey_web::board::MoveCard>(), + path::<izlek_web::board::MoveCard>(), Some(&member), &[ ("task_id", &task), @@ -873,7 +873,7 @@ async fn a_member_may_move_a_card() { let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", &task)], ) @@ -885,14 +885,14 @@ async fn a_member_may_move_a_card() { async fn a_drop_decided_against_a_stale_board_is_refused() { let app = App::open().await; let admin = admin(&app).await; - let member = invited(&app, &admin, "mo@dizey.sh", "Mo Dubois", Role::Member).await; + let member = invited(&app, &admin, "mo@izlek.sh", "Mo Dubois", Role::Member).await; let columns = columns_of(&app, &admin).await; let task = a_task(&app, &admin, &columns[0], "Contested").await; // Two people picked the same card up out of Backlog. let first = app .post( - path::<dizey_web::board::MoveCard>(), + path::<izlek_web::board::MoveCard>(), Some(&admin), &[ ("task_id", &task), @@ -905,7 +905,7 @@ async fn a_drop_decided_against_a_stale_board_is_refused() { let second = app .post( - path::<dizey_web::board::MoveCard>(), + path::<izlek_web::board::MoveCard>(), Some(&member), &[ ("task_id", &task), @@ -919,7 +919,7 @@ async fn a_drop_decided_against_a_stale_board_is_refused() { // The winner's move stands, and there is exactly one crossing. let answer = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin), &[("task_id", &task)], ) @@ -941,7 +941,7 @@ async fn a_card_cannot_be_moved_into_another_boards_column() { let answer = app .post( - path::<dizey_web::board::MoveCard>(), + path::<izlek_web::board::MoveCard>(), Some(&admin), &[ ("task_id", &task), @@ -962,7 +962,7 @@ async fn a_signed_out_browser_is_told_nothing_by_the_settings_call() { assert!(sender_saved(&app, &admin_cookie).await); let answer = app - .post(path::<dizey_web::settings::CurrentSettings>(), None, &[]) + .post(path::<izlek_web::settings::CurrentSettings>(), None, &[]) .await; assert_eq!(answer.status, StatusCode::OK, "{}", answer.body); @@ -978,11 +978,11 @@ async fn a_member_is_told_nothing_about_the_sender() { let app = App::open().await; let admin_cookie = admin(&app).await; assert!(sender_saved(&app, &admin_cookie).await); - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let answer = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&member), &[], ) @@ -1004,7 +1004,7 @@ async fn an_admin_sees_the_sender_and_never_a_password() { let answer = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1014,8 +1014,8 @@ async fn an_admin_sees_the_sender_and_never_a_password() { assert!( answer.body.contains( "\"sender\":{\"host\":\"smtp.fastmail.com\",\"port\":465,\ - \"username\":\"dizey\",\"from_name\":\"Dizey\",\ - \"from_address\":\"dizey@dizey.sh\",\"password_set\":true,\ + \"username\":\"izlek\",\"from_name\":\"Izlek\",\ + \"from_address\":\"izlek@izlek.sh\",\"password_set\":true,\ \"test\":null}" ), "{}", @@ -1034,19 +1034,19 @@ async fn an_admin_sees_the_sender_and_never_a_password() { async fn only_an_admin_may_write_the_sender() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let answer = app .post( - path::<dizey_web::settings::SaveSender>(), + path::<izlek_web::settings::SaveSender>(), Some(&member), &[ ("host", "smtp.attacker.example"), ("port", "587"), ("username", "emre"), ("password", "let-me-in"), - ("from_name", "Dizey"), - ("from_address", "emre@dizey.sh"), + ("from_name", "Izlek"), + ("from_address", "emre@izlek.sh"), ], ) .await; @@ -1057,7 +1057,7 @@ async fn only_an_admin_may_write_the_sender() { // And nothing was written: the admin's own view still shows no sender. let seen = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1073,15 +1073,15 @@ async fn a_signed_out_browser_may_not_write_the_sender() { let answer = app .post( - path::<dizey_web::settings::SaveSender>(), + path::<izlek_web::settings::SaveSender>(), None, &[ ("host", "smtp.attacker.example"), ("port", "587"), ("username", "nobody"), ("password", "let-me-in"), - ("from_name", "Dizey"), - ("from_address", "nobody@dizey.sh"), + ("from_name", "Izlek"), + ("from_address", "nobody@izlek.sh"), ], ) .await; @@ -1091,7 +1091,7 @@ async fn a_signed_out_browser_may_not_write_the_sender() { let seen = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1111,15 +1111,15 @@ async fn an_edit_with_no_password_typed_keeps_the_stored_one() { let answer = app .post( - path::<dizey_web::settings::SaveSender>(), + path::<izlek_web::settings::SaveSender>(), Some(&admin_cookie), &[ ("host", "smtp.fastmail.com"), ("port", "587"), - ("username", "dizey"), + ("username", "izlek"), ("password", ""), - ("from_name", "Dizey"), - ("from_address", "dizey@dizey.sh"), + ("from_name", "Izlek"), + ("from_address", "izlek@izlek.sh"), ], ) .await; @@ -1127,7 +1127,7 @@ async fn an_edit_with_no_password_typed_keeps_the_stored_one() { let seen = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1150,15 +1150,15 @@ async fn a_first_sender_with_no_password_is_refused_and_says_why() { let answer = app .post( - path::<dizey_web::settings::SaveSender>(), + path::<izlek_web::settings::SaveSender>(), Some(&admin_cookie), &[ ("host", "smtp.fastmail.com"), ("port", "587"), - ("username", "dizey"), + ("username", "izlek"), ("password", ""), - ("from_name", "Dizey"), - ("from_address", "dizey@dizey.sh"), + ("from_name", "Izlek"), + ("from_address", "izlek@izlek.sh"), ], ) .await; @@ -1180,17 +1180,17 @@ async fn a_sender_field_that_cannot_work_is_refused_by_name() { ("port", &[("port", "0")]), ("port", &[("port", "99999")]), ("username", &[("username", "")]), - ("from_address", &[("from_address", "board-at-dizey")]), - ("from_address", &[("from_address", "board@dizey")]), + ("from_address", &[("from_address", "board-at-izlek")]), + ("from_address", &[("from_address", "board@izlek")]), ]; for (field, overrides) in bad { let mut form: Vec<(&str, &str)> = vec![ ("host", "smtp.fastmail.com"), ("port", "587"), - ("username", "dizey"), + ("username", "izlek"), ("password", SENDER_PASSWORD), - ("from_name", "Dizey"), - ("from_address", "dizey@dizey.sh"), + ("from_name", "Izlek"), + ("from_address", "izlek@izlek.sh"), ]; for (key, value) in *overrides { for slot in form.iter_mut() { @@ -1201,7 +1201,7 @@ async fn a_sender_field_that_cannot_work_is_refused_by_name() { } let answer = app .post( - path::<dizey_web::settings::SaveSender>(), + path::<izlek_web::settings::SaveSender>(), Some(&admin_cookie), &form, ) @@ -1220,11 +1220,11 @@ async fn a_sender_field_that_cannot_work_is_refused_by_name() { async fn saving_a_profile_renames_the_person_asking_and_nobody_else() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let answer = app .post( - path::<dizey_web::settings::SaveProfile>(), + path::<izlek_web::settings::SaveProfile>(), Some(&member), &[("display_name", "Emre Y")], ) @@ -1233,7 +1233,7 @@ async fn saving_a_profile_renames_the_person_asking_and_nobody_else() { let mine = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&member), &[], ) @@ -1242,7 +1242,7 @@ async fn saving_a_profile_renames_the_person_asking_and_nobody_else() { let theirs = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1257,7 +1257,7 @@ async fn a_profile_cannot_be_saved_without_a_name() { let answer = app .post( - path::<dizey_web::settings::SaveProfile>(), + path::<izlek_web::settings::SaveProfile>(), Some(&admin_cookie), &[("display_name", " ")], ) @@ -1272,7 +1272,7 @@ async fn a_signed_out_browser_cannot_rename_anybody() { let answer = app .post( - path::<dizey_web::settings::SaveProfile>(), + path::<izlek_web::settings::SaveProfile>(), None, &[("display_name", "Whoever")], ) @@ -1286,11 +1286,11 @@ async fn a_signed_out_browser_cannot_rename_anybody() { async fn a_member_who_posts_new_limits_anyway_is_refused() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let answer = app .post( - path::<dizey_web::settings::SaveLimits>(), + path::<izlek_web::settings::SaveLimits>(), Some(&member), &[ ("attachment_limit_mb", "400"), @@ -1304,7 +1304,7 @@ async fn a_member_who_posts_new_limits_anyway_is_refused() { // And the refusal is not cosmetic: the limits are where they were. let after = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1323,7 +1323,7 @@ async fn an_admin_changes_the_limits_and_they_stay_changed() { let answer = app .post( - path::<dizey_web::settings::SaveLimits>(), + path::<izlek_web::settings::SaveLimits>(), Some(&admin_cookie), &[ ("attachment_limit_mb", "10"), @@ -1336,7 +1336,7 @@ async fn an_admin_changes_the_limits_and_they_stay_changed() { let after = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1360,7 +1360,7 @@ async fn a_limit_outside_what_the_disk_should_promise_is_refused() { for (attachment, photo) in [("5000", "2"), ("0", "2"), ("25", "0"), ("25", "200")] { let answer = app .post( - path::<dizey_web::settings::SaveLimits>(), + path::<izlek_web::settings::SaveLimits>(), Some(&admin_cookie), &[ ("attachment_limit_mb", attachment), @@ -1382,7 +1382,7 @@ async fn a_file_type_that_is_not_an_extension_is_refused() { let answer = app .post( - path::<dizey_web::settings::SaveLimits>(), + path::<izlek_web::settings::SaveLimits>(), Some(&admin_cookie), &[ ("attachment_limit_mb", "25"), @@ -1400,32 +1400,32 @@ async fn a_file_type_that_is_not_an_extension_is_refused() { async fn a_member_is_not_sent_the_member_list() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; - let _ = invited(&app, &admin_cookie, "quiet@dizey.sh", "Quiet", Role::Viewer).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; + let _ = invited(&app, &admin_cookie, "quiet@izlek.sh", "Quiet", Role::Viewer).await; let answer = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&member), &[], ) .await; assert!(answer.body.contains("\"members\":null"), "{}", answer.body); - assert!(!answer.body.contains("quiet@dizey.sh"), "{}", answer.body); + assert!(!answer.body.contains("quiet@izlek.sh"), "{}", answer.body); } #[tokio::test] async fn an_admin_sees_who_has_a_password_and_never_a_hash() { let app = App::open().await; let admin_cookie = admin(&app).await; - let _ = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let _ = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; // Invited and never signed in: the account exists, the password does not. let answer = app .post( - path::<dizey_web::auth::InviteMember>(), + path::<izlek_web::auth::InviteMember>(), Some(&admin_cookie), &[ - ("email", "mert@dizey.sh"), + ("email", "mert@izlek.sh"), ("display_name", "Mert"), ("role", "member"), ], @@ -1435,12 +1435,12 @@ async fn an_admin_sees_who_has_a_password_and_never_a_hash() { let answer = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) .await; - assert!(answer.body.contains("mert@dizey.sh"), "{}", answer.body); + assert!(answer.body.contains("mert@izlek.sh"), "{}", answer.body); assert!(answer.body.contains("\"has_password\":false"), "{}", answer.body); assert!(answer.body.contains("\"has_password\":true"), "{}", answer.body); assert!( @@ -1456,13 +1456,13 @@ async fn an_admin_sees_who_has_a_password_and_never_a_hash() { async fn a_member_who_posts_a_resend_anyway_is_refused() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let mert = app .post( - path::<dizey_web::auth::InviteMember>(), + path::<izlek_web::auth::InviteMember>(), Some(&admin_cookie), &[ - ("email", "mert@dizey.sh"), + ("email", "mert@izlek.sh"), ("display_name", "Mert"), ("role", "member"), ], @@ -1471,7 +1471,7 @@ async fn a_member_who_posts_a_resend_anyway_is_refused() { assert_eq!(mert.status, StatusCode::OK, "{}", mert.body); let members = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1485,7 +1485,7 @@ async fn a_member_who_posts_a_resend_anyway_is_refused() { let answer = app .post( - path::<dizey_web::settings::ResendLink>(), + path::<izlek_web::settings::ResendLink>(), Some(&member), &[("user_id", &mert_id)], ) @@ -1502,10 +1502,10 @@ async fn a_resent_link_opens_the_same_account() { let admin_cookie = admin(&app).await; let invitation = app .post( - path::<dizey_web::auth::InviteMember>(), + path::<izlek_web::auth::InviteMember>(), Some(&admin_cookie), &[ - ("email", "mert@dizey.sh"), + ("email", "mert@izlek.sh"), ("display_name", "Mert"), ("role", "member"), ], @@ -1515,14 +1515,14 @@ async fn a_resent_link_opens_the_same_account() { let list = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) .await; let mert_id = list .body - .split_once("mert@dizey.sh") + .split_once("mert@izlek.sh") .map(|(before, _)| before) .and_then(|before| before.rsplit_once("\"id\":\"")) .and_then(|(_, rest)| rest.split('"').next()) @@ -1531,7 +1531,7 @@ async fn a_resent_link_opens_the_same_account() { let answer = app .post( - path::<dizey_web::settings::ResendLink>(), + path::<izlek_web::settings::ResendLink>(), Some(&admin_cookie), &[("user_id", &mert_id)], ) @@ -1545,7 +1545,7 @@ async fn a_resent_link_opens_the_same_account() { let redeemed = app .post( - path::<dizey_web::auth::RedeemLink>(), + path::<izlek_web::auth::RedeemLink>(), None, &[("token", &token), ("password", "lantern gravel spoon meadow")], ) @@ -1564,10 +1564,10 @@ async fn an_invitation_names_the_admin_who_made_it_and_not_the_invitee() { let answer = app .post( - path::<dizey_web::auth::InviteMember>(), + path::<izlek_web::auth::InviteMember>(), Some(&admin_cookie), &[ - ("email", "grace@dizey.sh"), + ("email", "grace@izlek.sh"), ("display_name", "Grace Hopper"), ("role", "member"), ], @@ -1583,7 +1583,7 @@ async fn an_invitation_names_the_admin_who_made_it_and_not_the_invitee() { let answer = app .post( - path::<dizey_web::auth::Invitation>(), + path::<izlek_web::auth::Invitation>(), None, &[("token", token.as_str())], ) @@ -1611,7 +1611,7 @@ async fn signing_out_stops_the_session_being_worth_anything() { let works = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&cookie), &[], ) @@ -1619,14 +1619,14 @@ async fn signing_out_stops_the_session_being_worth_anything() { assert!(works.body.contains("administers"), "{}", works.body); let out = app - .post(path::<dizey_web::auth::SignOut>(), Some(&cookie), &[]) + .post(path::<izlek_web::auth::SignOut>(), Some(&cookie), &[]) .await; assert_eq!(out.status, StatusCode::OK, "{}", out.body); // The same cookie, replayed. The server has to be the one refusing. let after = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&cookie), &[], ) @@ -1648,9 +1648,9 @@ async fn signing_out_without_script_lands_on_the_sign_in_page() { let out = app .post_without_script( - path::<dizey_web::auth::SignOut>(), + path::<izlek_web::auth::SignOut>(), Some(&cookie), - "http://dizey.test/settings", + "http://izlek.test/settings", &[], ) .await; @@ -1665,16 +1665,16 @@ async fn signing_out_without_script_lands_on_the_sign_in_page() { async fn signing_out_leaves_every_other_session_alone() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let out = app - .post(path::<dizey_web::auth::SignOut>(), Some(&member), &[]) + .post(path::<izlek_web::auth::SignOut>(), Some(&member), &[]) .await; assert_eq!(out.status, StatusCode::OK, "{}", out.body); let still = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1686,11 +1686,11 @@ async fn signing_out_leaves_every_other_session_alone() { async fn a_member_may_not_press_the_test_button() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; let answer = app .post( - path::<dizey_web::settings::SendTestMail>(), + path::<izlek_web::settings::SendTestMail>(), Some(&member), &[], ) @@ -1704,11 +1704,11 @@ async fn a_member_may_not_press_the_test_button() { async fn a_viewer_may_not_press_the_test_button() { let app = App::open().await; let admin_cookie = admin(&app).await; - let viewer = invited(&app, &admin_cookie, "pinar@dizey.sh", "Pinar", Role::Viewer).await; + let viewer = invited(&app, &admin_cookie, "pinar@izlek.sh", "Pinar", Role::Viewer).await; let answer = app .post( - path::<dizey_web::settings::SendTestMail>(), + path::<izlek_web::settings::SendTestMail>(), Some(&viewer), &[], ) @@ -1723,7 +1723,7 @@ async fn a_signed_out_browser_may_not_press_the_test_button() { let app = App::open().await; let answer = app - .post(path::<dizey_web::settings::SendTestMail>(), None, &[]) + .post(path::<izlek_web::settings::SendTestMail>(), None, &[]) .await; assert_eq!(answer.status, StatusCode::OK, "{}", answer.body); @@ -1737,7 +1737,7 @@ async fn testing_a_sender_that_was_never_filled_in_says_so_rather_than_sending() let answer = app .post( - path::<dizey_web::settings::SendTestMail>(), + path::<izlek_web::settings::SendTestMail>(), Some(&admin_cookie), &[], ) @@ -1750,7 +1750,7 @@ async fn testing_a_sender_that_was_never_filled_in_says_so_rather_than_sending() // Nothing was recorded either: the panel still has no test line to show. let seen = app .post( - path::<dizey_web::settings::CurrentSettings>(), + path::<izlek_web::settings::CurrentSettings>(), Some(&admin_cookie), &[], ) @@ -1762,7 +1762,7 @@ async fn testing_a_sender_that_was_never_filled_in_says_so_rather_than_sending() async fn rule_written(app: &App, admin: &str, column_id: &str, subject: &str) -> bool { let answer = app .post( - path::<dizey_web::rules::CreateRule>(), + path::<izlek_web::rules::CreateRule>(), Some(admin), &[ ("trigger", "status"), @@ -1778,7 +1778,7 @@ async fn rule_written(app: &App, admin: &str, column_id: &str, subject: &str) -> /// The id of the one rule the workspace has. async fn only_rule(app: &App, admin: &str) -> String { let answer = app - .post(path::<dizey_web::rules::CurrentRules>(), Some(admin), &[]) + .post(path::<izlek_web::rules::CurrentRules>(), Some(admin), &[]) .await; answer .body @@ -1800,7 +1800,7 @@ async fn an_admin_writes_a_rule_and_reads_it_back_as_a_sentence() { let answer = app .post( - path::<dizey_web::rules::CurrentRules>(), + path::<izlek_web::rules::CurrentRules>(), Some(&admin_cookie), &[], ) @@ -1832,7 +1832,7 @@ async fn a_rule_with_no_subject_is_refused_and_says_why() { let answer = app .post( - path::<dizey_web::rules::CreateRule>(), + path::<izlek_web::rules::CreateRule>(), Some(&admin_cookie), &[ ("trigger", "status"), @@ -1852,7 +1852,7 @@ async fn a_rule_may_not_be_hung_off_a_column_that_is_not_on_this_board() { let answer = app .post( - path::<dizey_web::rules::CreateRule>(), + path::<izlek_web::rules::CreateRule>(), Some(&admin_cookie), &[ ("trigger", "status"), @@ -1866,7 +1866,7 @@ async fn a_rule_may_not_be_hung_off_a_column_that_is_not_on_this_board() { let seen = app .post( - path::<dizey_web::rules::CurrentRules>(), + path::<izlek_web::rules::CurrentRules>(), Some(&admin_cookie), &[], ) @@ -1882,7 +1882,7 @@ async fn an_audience_the_screen_never_offers_is_refused() { let answer = app .post( - path::<dizey_web::rules::CreateRule>(), + path::<izlek_web::rules::CreateRule>(), Some(&admin_cookie), &[ ("trigger", "status"), @@ -1905,7 +1905,7 @@ async fn switching_a_rule_off_leaves_it_listed_and_switched_off() { let answer = app .post( - path::<dizey_web::rules::SetRuleEnabled>(), + path::<izlek_web::rules::SetRuleEnabled>(), Some(&admin_cookie), &[("rule_id", &rule), ("enabled", "false")], ) @@ -1915,7 +1915,7 @@ async fn switching_a_rule_off_leaves_it_listed_and_switched_off() { // The screen lists what exists, not what is live. let seen = app .post( - path::<dizey_web::rules::CurrentRules>(), + path::<izlek_web::rules::CurrentRules>(), Some(&admin_cookie), &[], ) @@ -1935,8 +1935,8 @@ async fn a_rule_id_this_workspace_does_not_own_is_refused() { let stranger = Uuid::new_v4().to_string(); for path in [ - path::<dizey_web::rules::SetRuleEnabled>(), - path::<dizey_web::rules::DeleteRule>(), + path::<izlek_web::rules::SetRuleEnabled>(), + path::<izlek_web::rules::DeleteRule>(), ] { let answer = app .post( @@ -1959,7 +1959,7 @@ async fn deleting_a_rule_takes_it_off_the_screen() { let answer = app .post( - path::<dizey_web::rules::DeleteRule>(), + path::<izlek_web::rules::DeleteRule>(), Some(&admin_cookie), &[("rule_id", &rule)], ) @@ -1968,7 +1968,7 @@ async fn deleting_a_rule_takes_it_off_the_screen() { let seen = app .post( - path::<dizey_web::rules::CurrentRules>(), + path::<izlek_web::rules::CurrentRules>(), Some(&admin_cookie), &[], ) @@ -1984,18 +1984,18 @@ async fn only_an_admin_may_read_or_write_the_rules() { assert!(rule_written(&app, &admin_cookie, &column, "Task completed").await); let rule = only_rule(&app, &admin_cookie).await; - let member = invited(&app, &admin_cookie, "emre@dizey.sh", "Emre", Role::Member).await; - let viewer = invited(&app, &admin_cookie, "pinar@dizey.sh", "Pinar", Role::Viewer).await; + let member = invited(&app, &admin_cookie, "emre@izlek.sh", "Emre", Role::Member).await; + let viewer = invited(&app, &admin_cookie, "pinar@izlek.sh", "Pinar", Role::Viewer).await; for who in [&member, &viewer] { let read = app - .post(path::<dizey_web::rules::CurrentRules>(), Some(who), &[]) + .post(path::<izlek_web::rules::CurrentRules>(), Some(who), &[]) .await; assert!(read.body.contains("Forbidden"), "{}", read.body); let written = app .post( - path::<dizey_web::rules::CreateRule>(), + path::<izlek_web::rules::CreateRule>(), Some(who), &[ ("trigger", "status"), @@ -2009,7 +2009,7 @@ async fn only_an_admin_may_read_or_write_the_rules() { let switched = app .post( - path::<dizey_web::rules::SetRuleEnabled>(), + path::<izlek_web::rules::SetRuleEnabled>(), Some(who), &[("rule_id", &rule), ("enabled", "false")], ) @@ -2018,7 +2018,7 @@ async fn only_an_admin_may_read_or_write_the_rules() { let deleted = app .post( - path::<dizey_web::rules::DeleteRule>(), + path::<izlek_web::rules::DeleteRule>(), Some(who), &[("rule_id", &rule)], ) @@ -2029,7 +2029,7 @@ async fn only_an_admin_may_read_or_write_the_rules() { // And the rule is untouched: still there, still on. let seen = app .post( - path::<dizey_web::rules::CurrentRules>(), + path::<izlek_web::rules::CurrentRules>(), Some(&admin_cookie), &[], ) @@ -2052,11 +2052,11 @@ async fn a_signed_out_browser_may_not_touch_the_rules() { for (path, form) in [ ( - path::<dizey_web::rules::CurrentRules>(), + path::<izlek_web::rules::CurrentRules>(), vec![] as Vec<(&str, &str)>, ), ( - path::<dizey_web::rules::CreateRule>(), + path::<izlek_web::rules::CreateRule>(), vec![ ("trigger", "status"), ("column_id", column.as_str()), @@ -2065,11 +2065,11 @@ async fn a_signed_out_browser_may_not_touch_the_rules() { ], ), ( - path::<dizey_web::rules::SetRuleEnabled>(), + path::<izlek_web::rules::SetRuleEnabled>(), vec![("rule_id", rule.as_str()), ("enabled", "false")], ), ( - path::<dizey_web::rules::DeleteRule>(), + path::<izlek_web::rules::DeleteRule>(), vec![("rule_id", rule.as_str())], ), ] { @@ -2148,7 +2148,7 @@ async fn the_files_section_is_on_the_detail_page() { ); } -/// The id of the file named `name` in a [`dizey_web::detail::FetchTask`] +/// The id of the file named `name` in a [`izlek_web::detail::FetchTask`] /// snapshot's body, read the way the page would: found by its name, then the /// `id` field that comes right before it on the wire. fn attachment_id_named(body: &str, name: &str) -> String { @@ -2168,7 +2168,7 @@ fn attachment_id_named(body: &str, name: &str) -> String { async fn a_viewer_who_posts_an_upload_anyway_is_refused() { let app = App::open().await; let admin = admin(&app).await; - let viewer = invited(&app, &admin, "quiet@dizey.sh", "Quiet Reader", Role::Viewer).await; + let viewer = invited(&app, &admin, "quiet@izlek.sh", "Quiet Reader", Role::Viewer).await; let column = first_column(&app, &admin).await; let task = a_task(&app, &admin, &column, "Viewers cannot attach").await; @@ -2191,7 +2191,7 @@ async fn a_viewer_who_posts_an_upload_anyway_is_refused() { async fn a_member_uploads_a_file_and_the_chip_comes_back() { let app = App::open().await; let admin = admin(&app).await; - let member = invited(&app, &admin, "mo@dizey.sh", "Mo Dubois", Role::Member).await; + let member = invited(&app, &admin, "mo@izlek.sh", "Mo Dubois", Role::Member).await; let column = first_column(&app, &admin).await; let task = a_task(&app, &admin, &column, "Attach the spec").await; @@ -2212,7 +2212,7 @@ async fn a_member_uploads_a_file_and_the_chip_comes_back() { let snapshot = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&member), &[("task_id", &task)], ) @@ -2242,7 +2242,7 @@ async fn a_file_past_the_workspace_limit_is_refused_before_it_is_kept() { let answer = app .post( - path::<dizey_web::settings::SaveLimits>(), + path::<izlek_web::settings::SaveLimits>(), Some(&admin_cookie), &[ ("attachment_limit_mb", "1"), @@ -2270,7 +2270,7 @@ async fn a_file_past_the_workspace_limit_is_refused_before_it_is_kept() { let snapshot = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin_cookie), &[("task_id", &task)], ) @@ -2287,7 +2287,7 @@ async fn a_file_type_off_the_list_is_refused() { let answer = app .post( - path::<dizey_web::settings::SaveLimits>(), + path::<izlek_web::settings::SaveLimits>(), Some(&admin_cookie), &[ ("attachment_limit_mb", "25"), @@ -2355,7 +2355,7 @@ async fn the_stored_type_is_what_the_bytes_are_not_what_the_upload_claimed() { let snapshot = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin_cookie), &[("task_id", &task)], ) @@ -2385,7 +2385,7 @@ async fn a_file_name_that_is_a_path_is_kept_as_a_label() { let snapshot = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin_cookie), &[("task_id", &task)], ) @@ -2437,7 +2437,7 @@ async fn a_file_from_another_workspace_is_not_found() { assert_eq!(answer.status, StatusCode::SEE_OTHER); let snapshot = app_b .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin_b), &[("task_id", &task_b)], ) @@ -2469,8 +2469,8 @@ async fn an_upload_without_a_file_is_refused() { async fn only_the_uploader_or_an_admin_may_delete_a_file() { let app = App::open().await; let admin_cookie = admin(&app).await; - let member_a = invited(&app, &admin_cookie, "asha@dizey.sh", "Asha", Role::Member).await; - let member_b = invited(&app, &admin_cookie, "beau@dizey.sh", "Beau", Role::Member).await; + let member_a = invited(&app, &admin_cookie, "asha@izlek.sh", "Asha", Role::Member).await; + let member_b = invited(&app, &admin_cookie, "beau@izlek.sh", "Beau", Role::Member).await; let column = first_column(&app, &admin_cookie).await; let task = a_task(&app, &admin_cookie, &column, "Two uploaders, one task").await; @@ -2495,7 +2495,7 @@ async fn only_the_uploader_or_an_admin_may_delete_a_file() { let snapshot = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin_cookie), &[("task_id", &task)], ) @@ -2505,7 +2505,7 @@ async fn only_the_uploader_or_an_admin_may_delete_a_file() { let answer = app .post( - path::<dizey_web::detail::DeleteFile>(), + path::<izlek_web::detail::DeleteFile>(), Some(&member_b), &[("file_id", &file_a)], ) @@ -2514,7 +2514,7 @@ async fn only_the_uploader_or_an_admin_may_delete_a_file() { let answer = app .post( - path::<dizey_web::detail::DeleteFile>(), + path::<izlek_web::detail::DeleteFile>(), Some(&member_a), &[("file_id", &file_a)], ) @@ -2523,7 +2523,7 @@ async fn only_the_uploader_or_an_admin_may_delete_a_file() { let answer = app .post( - path::<dizey_web::detail::DeleteFile>(), + path::<izlek_web::detail::DeleteFile>(), Some(&admin_cookie), &[("file_id", &file_b)], ) @@ -2532,7 +2532,7 @@ async fn only_the_uploader_or_an_admin_may_delete_a_file() { let snapshot = app .post( - path::<dizey_web::detail::FetchTask>(), + path::<izlek_web::detail::FetchTask>(), Some(&admin_cookie), &[("task_id", &task)], ) diff --git a/style/main.scss b/style/main.scss index 68da659..3c96b85 100644 --- a/style/main.scss +++ b/style/main.scss @@ -1,4 +1,4 @@ -// Design tokens taken from the Dizey artboards. +// Design tokens taken from the Izlek artboards. :root { --bg: #f7f6f2; --surface: #fffefb;