diff --git a/Cargo.lock b/Cargo.lock index f551916..dece6c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,6 +19,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "actix-files" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d832782fac6ca7369a70c9ee9a20554623c5e51c76e190ad151780ebea1cf689" +dependencies = [ + "actix-http", + "actix-service", + "actix-utils", + "actix-web", + "askama_escape", + "bitflags 1.3.2", + "bytes", + "derive_more", + "futures-core", + "http-range", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", +] + [[package]] name = "actix-http" version = "3.4.0" @@ -325,6 +348,24 @@ dependencies = [ "backtrace", ] +[[package]] +name = "argon2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ba4cac0a46bc1d2912652a751c47f2a9f3a7fe89bcae2275d418f5270402f9" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + [[package]] name = "async-trait" version = "0.1.73" @@ -399,6 +440,15 @@ dependencies = [ "serde", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -888,8 +938,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1001,6 +1053,12 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + [[package]] name = "httparse" version = "1.8.0" @@ -1215,6 +1273,25 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minijinja" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c43c912b380856deeb78d826e3b77df13a90e69aef6223e3ad28c02d2ca857" +dependencies = [ + "serde", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1348,6 +1425,29 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "password-auth" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2a4764cc1f8d961d802af27193c6f4f0124bd0e76e8393cf818e18880f0524" +dependencies = [ + "argon2", + "getrandom", + "password-hash", + "rand_core", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -1585,10 +1685,11 @@ dependencies = [ "clap", "env_logger", "rustical_api", + "rustical_auth", "rustical_dav", + "rustical_frontend", "rustical_store", "serde", - "serde_json", "tokio", "toml", "tracing", @@ -1606,6 +1707,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "rustical_auth" +version = "0.1.0" +dependencies = [ + "actix-web", + "actix-web-httpauth", + "derive_more", + "futures-util", + "password-auth", + "serde", +] + [[package]] name = "rustical_dav" version = "0.1.0" @@ -1613,11 +1726,28 @@ dependencies = [ "actix-web", "actix-web-httpauth", "anyhow", + "async-trait", "base64 0.21.3", "derive_more", "futures-util", + "password-auth", "quick-xml", "roxmltree", + "rustical_auth", + "rustical_store", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "rustical_frontend" +version = "0.1.0" +dependencies = [ + "actix-files", + "actix-web", + "anyhow", + "minijinja", "rustical_store", "serde", "serde_json", @@ -1631,10 +1761,10 @@ dependencies = [ "anyhow", "async-trait", "serde", - "serde_json", "sha2", "sqlx", "tokio", + "toml", ] [[package]] @@ -2287,6 +2417,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.13" diff --git a/Cargo.toml b/Cargo.toml index 8bdf7a5..b3e648c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,10 @@ edition = "2021" [dependencies] rustical_store = { path = "./crates/store/" } +rustical_auth = { path = "./crates/auth/" } rustical_api = { path = "./crates/api/" } rustical_dav = { path = "./crates/dav/" } +rustical_frontend = { path = "./crates/frontend/" } serde = { version = "1.0.188", features = ["derive"] } tokio = { version = "1.32.0", features = [ "net", @@ -19,6 +21,5 @@ tracing = "0.1.37" env_logger = "0.10.0" actix-web = "4.4.0" anyhow = { version = "1.0.75", features = ["backtrace"] } -serde_json = "1.0.105" toml = "0.7.6" clap = { version = "4.4.2", features = ["derive", "env"] }