Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump zenoh version #109

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ jobs:
rustup component add rustfmt clippy

- name: Code format check
run: cargo fmt --check

run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
- name: Clippy
run: cargo clippy --all-targets -- --deny warnings

Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: fmt
name: fmt
entry: cargo fmt -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
language: system
types: [rust]
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 19 additions & 17 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use std::collections::HashMap;
use std::fmt;
use std::{collections::HashMap, fmt};

use crate::config::TlsClientConfig;
use aws_config::Region;
use aws_sdk_s3::config::Credentials;
use aws_sdk_s3::operation::create_bucket::CreateBucketOutput;
use aws_sdk_s3::operation::delete_object::DeleteObjectOutput;
use aws_sdk_s3::operation::delete_objects::DeleteObjectsOutput;
use aws_sdk_s3::operation::get_object::GetObjectOutput;
use aws_sdk_s3::operation::head_object::HeadObjectOutput;
use aws_sdk_s3::operation::put_object::PutObjectOutput;
use aws_sdk_s3::primitives::ByteStream;
use aws_sdk_s3::types::{
BucketLocationConstraint, CreateBucketConfiguration, Delete, Object, ObjectIdentifier,
use aws_sdk_s3::{
config::Credentials,
operation::{
create_bucket::CreateBucketOutput, delete_object::DeleteObjectOutput,
delete_objects::DeleteObjectsOutput, get_object::GetObjectOutput,
head_object::HeadObjectOutput, put_object::PutObjectOutput,
},
primitives::ByteStream,
types::{
BucketLocationConstraint, CreateBucketConfiguration, Delete, Object, ObjectIdentifier,
},
Client,
};
use aws_sdk_s3::Client;
use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;
use zenoh::internal::zerror;
use zenoh::internal::Value;
use zenoh::Result as ZResult;
use zenoh::{
internal::{zerror, Value},
Result as ZResult,
};

use crate::config::TlsClientConfig;

/// Client to communicate with the S3 storage.
pub(crate) struct S3Client {
Expand Down
11 changes: 4 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use async_rustls::rustls::{ClientConfig, OwnedTrustAnchor, RootCertStore};
use std::{fs::File, io::BufReader};

use async_rustls::rustls::{ClientConfig, OwnedTrustAnchor, RootCertStore};
use aws_sdk_s3::config::Credentials;
use hyper::client::HttpConnector;
use hyper_rustls::HttpsConnector;
use rustls_pki_types::CertificateDer;
use serde_json::{Map, Value};
use std::{fs::File, io::BufReader};
use webpki::TrustAnchor;
use zenoh::internal::zerror;
use zenoh::key_expr::OwnedKeyExpr;
use zenoh::Result as ZResult;
use zenoh::{internal::zerror, key_expr::OwnedKeyExpr, Result as ZResult};
use zenoh_backend_traits::config::{PrivacyGetResult, PrivacyTransparentGet, StorageConfig};

// Properties used by the Backend
Expand Down Expand Up @@ -366,8 +364,7 @@ impl TlsClientConfig {
}

pub fn base64_decode(data: &str) -> ZResult<Vec<u8>> {
use base64::engine::general_purpose;
use base64::Engine;
use base64::{engine::general_purpose, Engine};
Ok(general_purpose::STANDARD
.decode(data)
.map_err(|e| zerror!("Unable to perform base64 decoding: {e:?}"))?)
Expand Down
24 changes: 11 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,26 @@ pub mod client;
pub mod config;
pub mod utils;

use std::{collections::HashMap, str::FromStr, vec};

use async_std::sync::Arc;
use async_trait::async_trait;
use client::S3Client;
use config::{S3Config, TlsClientConfig, TLS_PROP};
use futures::future::join_all;
use futures::stream::FuturesUnordered;
use futures::{future::join_all, stream::FuturesUnordered};
#[cfg(feature = "dynamic_plugin")]
use lazy_static::lazy_static;
use std::collections::HashMap;
use std::str::FromStr;
use std::vec;
#[cfg(feature = "dynamic_plugin")]
use tokio::runtime::Runtime;
use utils::S3Key;
use zenoh::encoding::Encoding;
use zenoh::internal::zerror;
use zenoh::internal::Value;
use zenoh::key_expr::OwnedKeyExpr;
use zenoh::selector::Parameters;
use zenoh::time::Timestamp;
use zenoh::try_init_log_from_env;
use zenoh::Result as ZResult;
use zenoh::{
bytes::Encoding,
internal::{zerror, Value},
key_expr::OwnedKeyExpr,
query::Parameters,
time::Timestamp,
try_init_log_from_env, Result as ZResult,
};
use zenoh_backend_traits::{
config::{StorageConfig, VolumeConfig},
Capability, History, Persistence, Storage, StorageInsertionResult, StoredData, Volume,
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
//
use core::fmt;
use std::convert::TryFrom;
use zenoh::key_expr::OwnedKeyExpr;
use zenoh::Result as ZResult;

use zenoh::{key_expr::OwnedKeyExpr, Result as ZResult};

pub struct S3Key<'a> {
pub prefix: Option<&'a String>,
Expand Down