diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-06-04 06:35:14 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-06-04 06:35:14 +0000 |
commit | f2a274ee1291531c1154176bca5b9a47e9c234bd (patch) | |
tree | 6721b515739c6e5f9236ffd6f4ecc2dfecc471d2 /src/bin/obnam-server.rs | |
parent | cb33088dbedf4b772013f83b8226047cc4355dd2 (diff) | |
parent | 9c2590d2428f0d3de882686ec2ec5832e7123c62 (diff) | |
download | obnam2-f2a274ee1291531c1154176bca5b9a47e9c234bd.tar.gz |
Merge branch 'aead' into 'main'
add encryption of individual chunks
Closes #110
See merge request larswirzenius/obnam!146
Diffstat (limited to 'src/bin/obnam-server.rs')
-rw-r--r-- | src/bin/obnam-server.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bin/obnam-server.rs b/src/bin/obnam-server.rs index 9a6540f..29ea9ff 100644 --- a/src/bin/obnam-server.rs +++ b/src/bin/obnam-server.rs @@ -109,9 +109,9 @@ pub async fn create_chunk( } }; - let chunk = DataChunk::new(data.to_vec()); + let chunk = DataChunk::new(data.to_vec(), meta); - let id = match store.save(&meta, &chunk) { + let id = match store.save(&chunk) { Ok(id) => id, Err(e) => { error!("couldn't save: {}", e); @@ -119,7 +119,7 @@ pub async fn create_chunk( } }; - info!("created chunk {}: {:?}", id, meta); + info!("created chunk {}", id); Ok(ChunkResult::Created(id)) } @@ -155,8 +155,6 @@ pub async fn search_chunks( } if key == "generation" && value == "true" { store.find_generations().expect("SQL lookup failed") - } else if key == "data" && value == "true" { - store.find_file_chunks().expect("SQL lookup failed") } else if key == "sha256" { store.find_by_sha256(value).expect("SQL lookup failed") } else { |