spacedrive/crates/crypto/Cargo.toml

73 lines
2.1 KiB
TOML
Raw Normal View History

[package]
name = "sd-crypto"
version = "0.0.0"
authors = ["Jake Robinson <jake@spacedrive.com>"]
readme = "README.md"
description = "A library to handle cryptographic functions within Spacedrive"
rust-version = "1.67.0"
license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
[features]
rspc = ["dep:rspc", "dep:specta"]
specta = ["dep:specta"]
serde = ["dep:serde", "dep:serde_json", "dep:serde-big-array", "uuid/serde"]
keymanager = ["dep:dashmap", "os-keyrings"]
os-keyrings = ["dep:secret-service", "dep:security-framework"]
[dependencies]
# rng
[ENG-1479] AI Prototype (#1845) * First draft on image labeling * Fixing execution providers for other OSs * Better error handling and shutdown * Working with shallow media processor * bruh * Fix warnings * Now hooked to media processor job * Link desktop app with libonnxruntime to avoid TLS error during startup * Be able to change models on runtime Revert to use labels table instead of tags * A bug on a model-less inference * Show AI labels on Inspector - Change yolo inference to use half precision - Add labels api to core * Remove LD_PRELOAD * Fix race condition on model executor shutdown * Don't load all images in memory moron * Embeed yolo model in prod build - Change yolo model path to new one relative to executable * Disable volume watcher on linux, it was crashing the app - Invalidate labels when they are updated * Rust fmt * Minor changes * Gate onnxruntime linking to the ai-models feature * Add build script to sd-server to handle onnxruntime linking workaround * Move AI stuff to its own crate and normalize deps * Rust fmt * Don't regenerate labels unless asked to * Now blazingly fast * Bad merge * Fix * Fix * Add backend logic to download extra yolo models * Add models api route - Add api call to get available model version - Add api call to change the model version * Improve new model download logic - Add frontend to change image labeler model * Fix new model downloader * Fix model select width * invalidate labels count after media_processor generates a new output * Rename AI crate and first draft on download notifications * fix types --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
rand = { workspace = true }
rand_chacha = { workspace = true }
# hashing
argon2 = "0.5.0"
balloon-hash = "0.4.0"
[ENG-1479] AI Prototype (#1845) * First draft on image labeling * Fixing execution providers for other OSs * Better error handling and shutdown * Working with shallow media processor * bruh * Fix warnings * Now hooked to media processor job * Link desktop app with libonnxruntime to avoid TLS error during startup * Be able to change models on runtime Revert to use labels table instead of tags * A bug on a model-less inference * Show AI labels on Inspector - Change yolo inference to use half precision - Add labels api to core * Remove LD_PRELOAD * Fix race condition on model executor shutdown * Don't load all images in memory moron * Embeed yolo model in prod build - Change yolo model path to new one relative to executable * Disable volume watcher on linux, it was crashing the app - Invalidate labels when they are updated * Rust fmt * Minor changes * Gate onnxruntime linking to the ai-models feature * Add build script to sd-server to handle onnxruntime linking workaround * Move AI stuff to its own crate and normalize deps * Rust fmt * Don't regenerate labels unless asked to * Now blazingly fast * Bad merge * Fix * Fix * Add backend logic to download extra yolo models * Add models api route - Add api call to get available model version - Add api call to change the model version * Improve new model download logic - Add frontend to change image labeler model * Fix new model downloader * Fix model select width * invalidate labels count after media_processor generates a new output * Rename AI crate and first draft on download notifications * fix types --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
blake3 = { workspace = true, features = ["traits-preview"] }
# aeads
aes-gcm = "0.10.1"
chacha20poly1305 = "0.10.1"
aead = { version = "0.5.1", features = ["stream"] }
# cryptographic hygiene
zeroize = "1.5.7"
# error handling
[ENG-1479] AI Prototype (#1845) * First draft on image labeling * Fixing execution providers for other OSs * Better error handling and shutdown * Working with shallow media processor * bruh * Fix warnings * Now hooked to media processor job * Link desktop app with libonnxruntime to avoid TLS error during startup * Be able to change models on runtime Revert to use labels table instead of tags * A bug on a model-less inference * Show AI labels on Inspector - Change yolo inference to use half precision - Add labels api to core * Remove LD_PRELOAD * Fix race condition on model executor shutdown * Don't load all images in memory moron * Embeed yolo model in prod build - Change yolo model path to new one relative to executable * Disable volume watcher on linux, it was crashing the app - Invalidate labels when they are updated * Rust fmt * Minor changes * Gate onnxruntime linking to the ai-models feature * Add build script to sd-server to handle onnxruntime linking workaround * Move AI stuff to its own crate and normalize deps * Rust fmt * Don't regenerate labels unless asked to * Now blazingly fast * Bad merge * Fix * Fix * Add backend logic to download extra yolo models * Add models api route - Add api call to get available model version - Add api call to change the model version * Improve new model download logic - Add frontend to change image labeler model * Fix new model downloader * Fix model select width * invalidate labels count after media_processor generates a new output * Rename AI crate and first draft on download notifications * fix types --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
thiserror = { workspace = true }
# metadata de/serialization
[ENG-1479] AI Prototype (#1845) * First draft on image labeling * Fixing execution providers for other OSs * Better error handling and shutdown * Working with shallow media processor * bruh * Fix warnings * Now hooked to media processor job * Link desktop app with libonnxruntime to avoid TLS error during startup * Be able to change models on runtime Revert to use labels table instead of tags * A bug on a model-less inference * Show AI labels on Inspector - Change yolo inference to use half precision - Add labels api to core * Remove LD_PRELOAD * Fix race condition on model executor shutdown * Don't load all images in memory moron * Embeed yolo model in prod build - Change yolo model path to new one relative to executable * Disable volume watcher on linux, it was crashing the app - Invalidate labels when they are updated * Rust fmt * Minor changes * Gate onnxruntime linking to the ai-models feature * Add build script to sd-server to handle onnxruntime linking workaround * Move AI stuff to its own crate and normalize deps * Rust fmt * Don't regenerate labels unless asked to * Now blazingly fast * Bad merge * Fix * Fix * Add backend logic to download extra yolo models * Add models api route - Add api call to get available model version - Add api call to change the model version * Improve new model download logic - Add frontend to change image labeler model * Fix new model downloader * Fix model select width * invalidate labels count after media_processor generates a new output * Rename AI crate and first draft on download notifications * fix types --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
serde = { workspace = true, features = ["derive"], optional = true }
serde_json = { workspace = true, optional = true }
serde-big-array = { version = "0.5.1", optional = true }
# for storedkey organisation and handling
[ENG-1479] AI Prototype (#1845) * First draft on image labeling * Fixing execution providers for other OSs * Better error handling and shutdown * Working with shallow media processor * bruh * Fix warnings * Now hooked to media processor job * Link desktop app with libonnxruntime to avoid TLS error during startup * Be able to change models on runtime Revert to use labels table instead of tags * A bug on a model-less inference * Show AI labels on Inspector - Change yolo inference to use half precision - Add labels api to core * Remove LD_PRELOAD * Fix race condition on model executor shutdown * Don't load all images in memory moron * Embeed yolo model in prod build - Change yolo model path to new one relative to executable * Disable volume watcher on linux, it was crashing the app - Invalidate labels when they are updated * Rust fmt * Minor changes * Gate onnxruntime linking to the ai-models feature * Add build script to sd-server to handle onnxruntime linking workaround * Move AI stuff to its own crate and normalize deps * Rust fmt * Don't regenerate labels unless asked to * Now blazingly fast * Bad merge * Fix * Fix * Add backend logic to download extra yolo models * Add models api route - Add api call to get available model version - Add api call to change the model version * Improve new model download logic - Add frontend to change image labeler model * Fix new model downloader * Fix model select width * invalidate labels count after media_processor generates a new output * Rename AI crate and first draft on download notifications * fix types --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
uuid = { workspace = true, features = ["v4"] }
# better concurrency for the keymanager
dashmap = { version = "5.4.0", optional = true }
[ENG-262] Key Manager Integration (#450) * add keys router * make progress on keymanager integration * make name non-negotiable * hyphenate encryption algorithm names * Revert "make name non-negotiable" This reverts commit 9c0f51329e5d7cceea2d6ade0b8124a79806b747. * add some more keymanager queries * add master password and default key routes * add newly registered key to db + fmt * clippy, formatting and `updateKeyName` route * add automount to schema+automount keys where `true` * update bindings * working key add/mount * working keylist * mounted keys show first * cleanup code * add comments, code cleanup, more functions * unmount all keys button * comment and keymanager `clear_master_password()` * add no keys available message * fix unmount button * use dashmap for concurrency * fix missing keylist issue and add invalidate query macro * set correct RSPC types * statically set master password (TEMPORARILY) * add remove key function within the keymanager * key dropdown menu and impl * formatting * allow `option_if_let_else` * add comment about key stats * add additional comment * rpsc error handling for the keys route * fix rspc errors with an impl * crypto crate errors to `sd-crypto::Error` * remove `map_err` * use custom result type * cargo fmt * clippy * fix builds * remove `Error::MutexLock` * fix unnecessary unwrap * mutex error handling (buggy for some reason) * clean default key logic * fix default key clearing * allow a key to be removed without bugs * implement requested changes * use a single `useMemo` * update schema with defaults * re-generate migrations * use rust enums in TS * remove dead code * remove mutate expansion * read key list from keymanager, not prisma * add "Default" key marker and cleanup TS * rustfmt * remove dead code
2022-11-05 11:18:01 +00:00
# optional, for support with rspc
rspc = { workspace = true, features = [], optional = true }
specta = { workspace = true, features = ["uuid"], optional = true }
[ENG-307] Key manager features (#467) * working key management in settings page * sync with library button * fix `rspc` feature and add passphrase generation * untested key manager rework * trying to return values from mutations * update library manager and remove settiong master PW * update bindings * set static secret key/master password * prompt user for master password if correct one hasn't been provided yet * add `hasMasterPassword` route * add `clearMasterPassword` route + remove dead code * tweak `set_master_password()` and add dedicated error * tweak UI, fix `few hooks than expected`, add unmount+lock button * remove old comment * fmt * clippy * move static key/password setting so it doesn't fail sometimes * add dedicated `get_key()` and remove keys from memory * add `getKey` route * update bindings * use `const` instead of `let` * comment updates * update schema to remove salt * add string parse error * generate passphrase within key manager * generate new migrations * feature gate serde support in `crypto` crate * fmt * more specific error types * foramatting * add locking mechanism to keysettings page (not working?) * fix react hook issues Co-authored-by: maxichrome <maxichrome@users.noreply.github.com> * remove empty onclick * add keymanager dropdown menu * working key backup functionality * add experimental master password changing support * update bindings * semi-working change master password dialog * use gear/lock icons to clean up key manager UI * make settings button functional * make buttons uniform and format code * fix double base64 encode * add change master password dialog and secret key dialog * code cleanup * restore backup dialog * change UI wording * make a start on restoring from a backup * potentially working keystore restore * don't overwrite verification key if one is set * working backup restore + fix master password changing * fix typo in static password/verification key check logic * change wording to make UI clearer * disable mount button if key is empty * handle errors+remove type annotations * show total imported keys on backup restoration * add zxcvbn package * change input border colour based on zxcvbn score * clippy and formatting * password strength meter * remove nbsp * add button type to stop early form submission * use `react-hook-form` for backup restoration dialog * more `react-hook-form` stuff * attempt to fix password meter * small cleanup * Fix password meter * update colours Co-authored-by: maxichrome <maxichrome@users.noreply.github.com> Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
2022-12-02 10:18:21 +00:00
# for asynchronous crypto
tokio = { workspace = true, features = ["io-util", "rt-multi-thread", "sync"] }
[ENG-1479] AI Prototype (#1845) * First draft on image labeling * Fixing execution providers for other OSs * Better error handling and shutdown * Working with shallow media processor * bruh * Fix warnings * Now hooked to media processor job * Link desktop app with libonnxruntime to avoid TLS error during startup * Be able to change models on runtime Revert to use labels table instead of tags * A bug on a model-less inference * Show AI labels on Inspector - Change yolo inference to use half precision - Add labels api to core * Remove LD_PRELOAD * Fix race condition on model executor shutdown * Don't load all images in memory moron * Embeed yolo model in prod build - Change yolo model path to new one relative to executable * Disable volume watcher on linux, it was crashing the app - Invalidate labels when they are updated * Rust fmt * Minor changes * Gate onnxruntime linking to the ai-models feature * Add build script to sd-server to handle onnxruntime linking workaround * Move AI stuff to its own crate and normalize deps * Rust fmt * Don't regenerate labels unless asked to * Now blazingly fast * Bad merge * Fix * Fix * Add backend logic to download extra yolo models * Add models api route - Add api call to get available model version - Add api call to change the model version * Improve new model download logic - Add frontend to change image labeler model * Fix new model downloader * Fix model select width * invalidate labels count after media_processor generates a new output * Rename AI crate and first draft on download notifications * fix types --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
hex = { workspace = true }
# linux OS keyring - using `v2.0.2` as newer versions broke a lot due to async/lifetimes
[target.'cfg(target_os = "linux")'.dependencies]
secret-service = { version = "2.0.2", optional = true }
# macos/ios OS keyring
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
security-framework = { version = "2.8.1", optional = true }
[dev-dependencies]
2023-01-25 22:03:10 +00:00
tokio = { workspace = true, features = [
"fs",
"macros",
] } # features needed for examples