aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client
diff options
context:
space:
mode:
authorVladislav Stepanov <8uk.8ak@gmail.com>2023-04-14 23:18:58 +0400
committerGitHub <noreply@github.com>2023-04-14 20:18:58 +0100
commitc05d2850420a2c163b8f62c33a6cef7c0ae1ad8d (patch)
tree2c44a44eda7e76fa74e78ac1fd02f55c1ed4d804 /atuin-client
parentSwitch to uuidv7 (#864) (diff)
downloadatuin-c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d.zip
Workspace reorder (#868)
* Try different workspace structure Move main crate (atuin) to be on the same level with other crates in this workspace * extract common dependencies to the workspace definition * fix base64 v0.21 deprecation warning * questionable: update deps & fix chrono deprecations possible panic sites are unchanged, they're just more visible now * Revert "questionable: update deps & fix chrono deprecations" This reverts commit 993e60f8dea81a1625a04285a617959ad09a0866.
Diffstat (limited to 'atuin-client')
-rw-r--r--atuin-client/Cargo.toml58
-rw-r--r--atuin-client/src/encryption.rs8
2 files changed, 31 insertions, 35 deletions
diff --git a/atuin-client/Cargo.toml b/atuin-client/Cargo.toml
index 1eda2c29..0f498d3c 100644
--- a/atuin-client/Cargo.toml
+++ b/atuin-client/Cargo.toml
@@ -1,12 +1,13 @@
[package]
name = "atuin-client"
-version = "14.0.0"
-authors = ["Ellie Huxtable <ellie@elliehuxtable.com>"]
edition = "2018"
-license = "MIT"
description = "client library for atuin"
-homepage = "https://atuin.sh"
-repository = "https://github.com/ellie/atuin"
+
+version = { workspace = true }
+authors = { workspace = true }
+license = { workspace = true }
+homepage = { workspace = true }
+repository = { workspace = true }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -25,47 +26,40 @@ sync = [
[dependencies]
atuin-common = { path = "../atuin-common", version = "14.0.0" }
-log = "0.4"
-chrono = { version = "0.4", features = ["serde"] }
-clap = { version = "4.0.18", features = ["derive"] }
-eyre = "0.6"
-directories = "4"
-uuid = { version = "1.2", features = ["v4"] }
-whoami = "1.1.2"
-interim = { version = "0.1.0", features = ["chrono"] }
-config = { version = "0.13", default-features = false, features = ["toml"] }
-serde = { version = "1.0.145", features = ["derive"] }
-serde_json = "1.0.86"
+log = { workspace = true }
+chrono = { workspace = true }
+clap = { workspace = true }
+eyre = { workspace = true }
+directories = { workspace = true }
+uuid = { workspace = true }
+whoami = { workspace = true }
+interim = { workspace = true }
+config = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
parse_duration = "2.1.1"
-async-trait = "0.1.58"
-itertools = "0.10.5"
+async-trait = { workspace = true }
+itertools = { workspace = true }
shellexpand = "2"
-sqlx = { version = "0.6", features = [
- "runtime-tokio-rustls",
- "chrono",
- "sqlite",
-] }
+sqlx = { workspace = true, features = ["sqlite"] }
minspan = "0.1.1"
regex = "1.5.4"
serde_regex = "1.1.0"
-fs-err = "2.9"
+fs-err = { workspace = true }
sql-builder = "3"
lazy_static = "1"
memchr = "2.5"
# sync
urlencoding = { version = "2.1.0", optional = true }
-sodiumoxide = { version = "0.2.6", optional = true }
-reqwest = { version = "0.11", features = [
- "json",
- "rustls-tls-native-roots",
-], default-features = false, optional = true }
+sodiumoxide = { workspace = true, optional = true }
+reqwest = { workspace = true, optional = true }
hex = { version = "0.4", optional = true }
sha2 = { version = "0.10", optional = true }
rmp-serde = { version = "1.1.1", optional = true }
-base64 = { version = "0.20.0", optional = true }
-tokio = { version = "1", features = ["full"] }
-semver = "1.0.14"
+base64 = { workspace = true, optional = true }
+tokio = { workspace = true }
+semver = { workspace = true }
[dev-dependencies]
tokio = { version = "1", features = ["full"] }
diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs
index 40badb5e..fe19ce9b 100644
--- a/atuin-client/src/encryption.rs
+++ b/atuin-client/src/encryption.rs
@@ -10,6 +10,7 @@
use std::{io::prelude::*, path::PathBuf};
+use base64::prelude::{Engine, BASE64_STANDARD};
use eyre::{eyre, Context, Result};
use fs_err as fs;
use serde::{Deserialize, Serialize};
@@ -72,14 +73,15 @@ pub fn load_encoded_key(settings: &Settings) -> Result<String> {
pub type Key = secretbox::Key;
pub fn encode_key(key: secretbox::Key) -> Result<String> {
let buf = rmp_serde::to_vec(&key).wrap_err("could not encode key to message pack")?;
- let buf = base64::encode(buf);
+ let buf = BASE64_STANDARD.encode(buf);
Ok(buf)
}
pub fn decode_key(key: String) -> Result<secretbox::Key> {
- let buf =
- base64::decode(key.trim_end()).wrap_err("encryption key is not a valid base64 encoding")?;
+ let buf = BASE64_STANDARD
+ .decode(key.trim_end())
+ .wrap_err("encryption key is not a valid base64 encoding")?;
let buf: secretbox::Key = rmp_serde::from_slice(&buf)
.wrap_err("encryption key is not a valid message pack encoding")?;