Skip to content

Commit 69696d7

Browse files
authored
merge: Merge pull request #14 from arunaengine/feat/0.7_rework
Version 0.7 rework
2 parents 6a26de2 + 328ac21 commit 69696d7

100 files changed

Lines changed: 15323 additions & 9024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 1101 additions & 921 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ resolver = "2"
66

77
[workspace.package]
88
version = "0.6.0"
9-
authors = ["Sebastian Beyvers <sb@pus.de>"]
10-
edition = "2021"
11-
repository = "https://github.com/ArunaStorage/aruna-file"
12-
license = "MIT OR Apache-2.0"
9+
authors = ["Jannis Schlegel <das_Abroxas@proton.me>", "Sebastian Beyvers <sb@pus.de>"]
10+
edition = "2024"
11+
repository = "https://github.com/arunaengine/pithos"
12+
license = "MIT OR Apache-2.0"
13+
14+
[workspace.dependencies]
15+
thiserror = "2.0.16"
16+
tracing = "0.1.41"
17+
tracing-subscriber = { version = "0.3.20", features = [
18+
"env-filter",
19+
"time",
20+
"fmt",
21+
"registry",
22+
] }
23+
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
## Description
2323

24-
Pithos (a large ancient greek storage container) is a packaging file format for arbitrary data that enhances the use of Object Storage for (research) data management. This is done by combining multiple existing file standards with new enhancements. A format specification can be found [[here]](./spec/SPECIFICATION.md).
24+
Pithos (a large ancient greek storage container) is a packaging file format for arbitrary data that enhances the use of Object Storage for (research) data management. This is done by combining multiple existing file standards with new enhancements. A format specification can be found [[here]](./spec/PITHOS_1.0.0_draft.md).
2525

2626
## Features
2727

crates/pithos/Cargo.toml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
[package]
22
name = "pithos"
3-
description = "Client for the Pithos object storage file format"
4-
version = "0.6.2"
3+
description = "CLI for the Pithos container file format"
4+
version = "0.7.0"
55
authors.workspace = true
66
edition.workspace = true
77
repository.workspace = true
88
license.workspace = true
99

1010
[dependencies]
11-
anyhow = "1.0.98"
12-
async-channel = "2.3.1"
13-
async-trait = "0.1.88"
14-
base64 = "0.22.1"
15-
borsh = { version = "1.5.7", features = ["std", "derive"] }
16-
bytes = "1.10.1"
17-
chacha20poly1305 = "0.10.1"
18-
clap = { version = "4.5.38", features = ["derive"] }
19-
crypto_kx = { version = "0.2.1", features = ["serde"] }
20-
dotenvy = "0.15.7"
21-
futures = "0.3.31"
22-
futures-util = "0.3.31"
23-
openssl = "0.10.72"
24-
pithos_lib = { path = "../pithos_lib", version = "0.6.2" }
25-
rand = "0.9.1"
26-
serde_json = "1.0.140"
27-
tokio = { version = "1.45.0", features = ["full"] }
28-
tokio-stream = "0.1.17"
29-
tokio-util = "0.7.15"
30-
tracing = "0.1.41"
31-
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "time"] }
32-
x25519-dalek = "2.0.1"
33-
indicatif = "0.17.11"
11+
clap = { version = "4.5.21", features = ["derive"] }
12+
pithos_lib = { path = "../pithos_lib" }
13+
thiserror = { workspace = true }
14+
tracing = "0.1.40"
15+
tracing-subscriber = {version = "0.3.18", features = ["env-filter", "time"]}
16+
x25519-dalek = {workspace = true}
17+
#indicatif = "0.17.9"

crates/pithos/src/io/utils.rs

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,25 @@
1-
use anyhow::Result;
2-
use openssl::pkey::{Id, PKey};
1+
use pithos_lib::error::PithosError;
32
use std::fs::File;
43
use std::io::Read;
54
use std::path::PathBuf;
5+
use x25519_dalek::{PublicKey, StaticSecret};
66

7-
//TODO: Try to load openSSL pem and if fails try to load Crypt4GH pem
8-
pub fn load_key_from_pem(filepath: &PathBuf, private: bool) -> Result<[u8; 32]> {
7+
pub fn load_private_key_from_pem(filepath: &PathBuf) -> Result<StaticSecret, PithosError> {
98
// Open file handle and read file bytes
109
let mut file = File::open(filepath)?;
1110
let mut file_content = vec![0u8; file.metadata()?.len() as usize];
1211
file.read_exact(&mut file_content)?;
1312

14-
// Parse into key
15-
let mut key_bytes: [u8; 32] = [0; 32];
16-
if private {
17-
key_bytes.copy_from_slice(
18-
PKey::private_key_from_pem(&file_content)?
19-
.raw_private_key()?
20-
.as_slice(),
21-
);
22-
} else {
23-
key_bytes.copy_from_slice(
24-
PKey::public_key_from_pem(&file_content)?
25-
.raw_public_key()?
26-
.as_slice(),
27-
);
28-
}
29-
30-
Ok(key_bytes)
13+
Ok(pithos_lib::helpers::x25519_keys::private_key_from_pem_bytes(&file_content)?)
3114
}
3215

33-
pub fn _load_key_from_string(key_bytes: &[u8], private: bool) -> Result<[u8; 32]> {
34-
// Parse into key
35-
let mut x25519_key_bytes: [u8; 32] = [0; 32];
36-
if private {
37-
x25519_key_bytes.copy_from_slice(
38-
PKey::private_key_from_raw_bytes(key_bytes, Id::X25519)?
39-
.raw_private_key()?
40-
.as_slice(),
41-
);
42-
} else {
43-
x25519_key_bytes.copy_from_slice(
44-
PKey::public_key_from_raw_bytes(key_bytes, Id::X25519)?
45-
.raw_public_key()?
46-
.as_slice(),
47-
);
48-
}
16+
pub fn load_public_key_from_pem(filepath: &PathBuf) -> Result<PublicKey, PithosError> {
17+
// Open file handle and read file bytes
18+
let mut file = File::open(filepath)?;
19+
let mut file_content = vec![0u8; file.metadata()?.len() as usize];
20+
file.read_exact(&mut file_content)?;
4921

50-
Ok(x25519_key_bytes)
22+
Ok(pithos_lib::helpers::x25519_keys::public_key_from_pem_bytes(
23+
&file_content,
24+
)?)
5125
}

0 commit comments

Comments
 (0)