Skip to content

Commit

Permalink
Update libraries. Especially base64
Browse files Browse the repository at this point in the history
  • Loading branch information
cypherkitty committed Dec 29, 2024
1 parent adf0fcb commit 82da567
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 37 deletions.
21 changes: 11 additions & 10 deletions meta-secret/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ exclude = [

[workspace.dependencies]
# Error handling
thiserror = "2.0.6"
anyhow = "1.0.93"
thiserror = "2.0.9"
anyhow = "1.0.95"

# Logging and tracing
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18" }
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19" }
tracing-attributes = "0.1.28"

# Json
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.133"
serde_derive = "1.0.215"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
serde_derive = "1.0.217"
serde_yaml = "0.9.33"

# Async utils
Expand All @@ -41,7 +42,7 @@ ed25519-dalek = "2.1.1"
rand = "0.8.5"
getrandom = { version = "0.2.15", features = ["js"] }
sha2 = { version = "0.10.8", features = ["oid"] }
base64 = "0.20.0"
base64 = "0.22.1"
hex = "0.4.3"
#https://github.com/dsprenkels/sss-rs
shamirsecretsharing = "0.1.5"
Expand All @@ -55,5 +56,5 @@ tower-http = { version = "0.6.2", features = ["cors", "trace"] }
http = "1.2.0"

# Sql
diesel = { version = "2.2.4" }
diesel_migrations = { version = "2.2.0" }
diesel = { version = "2.2.6" }
diesel_migrations = { version = "2.2.0" }
4 changes: 2 additions & 2 deletions meta-secret/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ wasm-build-local:
SAVE ARTIFACT pkg AS LOCAL web-cli/ui/pkg

web-build:
FROM node:22.7-bookworm
FROM node:23.5.0-bookworm

ENV PROJECT_UI_DIR=web-cli/ui

Expand All @@ -78,7 +78,7 @@ web-build:
COPY . .

WORKDIR ${PROJECT_UI_DIR}
RUN npm install && npm run build
RUN --no-cache npm install && npm run build
SAVE IMAGE meta-secret-web:latest

app-test:
Expand Down
5 changes: 1 addition & 4 deletions meta-secret/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ meta-secret-core = { path = "../core" }
thiserror.workspace = true
anyhow.workspace = true

clap = { version = "3.2", features = ["derive"] }

clap = { version = "3.2.25", features = ["derive"] }

serde.workspace = true
serde_json.workspace = true
serde_derive.workspace = true
serde_yaml.workspace = true
15 changes: 6 additions & 9 deletions meta-secret/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,25 @@ serde_derive.workspace = true

tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["json", "env-filter"] }
tracing-attributes = "0.1.27"
tracing-attributes.workspace = true


ed25519-dalek.workspace = true
rand.workspace = true
getrandom.workspace = true
sha2.workspace = true
base64.workspace = true
hex.workspace = true
#https://github.com/dsprenkels/sss-rs
shamirsecretsharing.workspace = true
age.workspace = true

serde_bytes = "0.11"
serde-big-array = "0.4"
serde-big-array = "0.5.1"

qrcode-generator = "4.1.6"
rqrr = "0.5"
image = "0.24"
qrcode-generator = "4.1.9"
rqrr = "0.6.0"
image = "0.24.9"

wasm-bindgen = "0.2.93"
wasm-bindgen = "0.2.99"
log = "0.4.22"

[dependencies.uuid]
Expand All @@ -67,4 +65,3 @@ features = [

[dev-dependencies]
tokio = { version = "1.20.1", features = ["full"] }
pretty_assertions = "1"
15 changes: 4 additions & 11 deletions meta-secret/core/src/crypto/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ pub mod base64 {
use crate::crypto::encoding::base64::Base64Text;
use crate::crypto::encoding::Array256Bit;
use crate::secret::shared_secret::PlainText;
use base64::alphabet::URL_SAFE;
use base64::engine::fast_portable::{FastPortable, NO_PAD};
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};
use image::EncodableLayout;

const URL_SAFE_ENGINE: FastPortable = FastPortable::from(&URL_SAFE, NO_PAD);

impl From<Vec<u8>> for Base64Text {
fn from(data: Vec<u8>) -> Self {
Base64Text::from(data.as_slice())
Expand All @@ -46,7 +43,7 @@ pub mod base64 {

impl From<&[u8]> for Base64Text {
fn from(data: &[u8]) -> Self {
Self(base64::encode_engine(data, &URL_SAFE_ENGINE))
Self(URL_SAFE_NO_PAD.encode(data))
}
}

Expand Down Expand Up @@ -95,14 +92,10 @@ pub mod base64 {
}

pub mod decoder {
use base64::alphabet::URL_SAFE;
use base64::engine::fast_portable::{FastPortable, NO_PAD};

use crate::crypto::encoding::base64::Base64Text;
use crate::crypto::encoding::Array256Bit;
use crate::errors::CoreError;

const URL_SAFE_ENGINE: FastPortable = FastPortable::from(&URL_SAFE, NO_PAD);
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};

impl TryFrom<&Base64Text> for String {
type Error = CoreError;
Expand All @@ -119,7 +112,7 @@ pub mod base64 {

fn try_from(base64: &Base64Text) -> Result<Self, Self::Error> {
let Base64Text(base64_text) = base64;
let data = base64::decode_engine(base64_text, &URL_SAFE_ENGINE)?;
let data = URL_SAFE_NO_PAD.decode(base64_text)?;
Ok(data)
}
}
Expand Down
1 change: 0 additions & 1 deletion meta-secret/core/tests/mod.rs

This file was deleted.

0 comments on commit 82da567

Please sign in to comment.