Update rust-s3 dependency and move Cargo.toml dependencies
This commit is contained in:
@@ -18,7 +18,8 @@ rocket_i18n = "0.4.1"
|
||||
reqwest = "0.11.11"
|
||||
scheduled-thread-pool = "0.2.6"
|
||||
serde = "1.0.137"
|
||||
rust-s3 = { version = "0.29.0", no-default-features = true, features = ["blocking"] }
|
||||
#rust-s3 = { version = "0.29.0", default-features = false, features = ["blocking"] }
|
||||
rust-s3 = { version = "0.33.0", optional = true, features = ["blocking"] }
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0.81"
|
||||
tantivy = "0.13.3"
|
||||
@@ -62,3 +63,4 @@ diesel_migrations = "1.3.0"
|
||||
postgres = ["diesel/postgres", "plume-macro/postgres" ]
|
||||
sqlite = ["diesel/sqlite", "plume-macro/sqlite" ]
|
||||
search-lindera = ["lindera-tantivy"]
|
||||
s3 = ["rust-s3"]
|
||||
|
||||
@@ -392,13 +392,15 @@ impl S3Config {
|
||||
secret_key: Some(self.access_key_secret.clone()),
|
||||
security_token: None,
|
||||
session_token: None,
|
||||
expiration: None,
|
||||
};
|
||||
|
||||
let bucket = Bucket::new(&self.bucket, region, credentials).unwrap();
|
||||
if self.path_style {
|
||||
Bucket::new_with_path_style(&self.bucket, region, credentials)
|
||||
bucket.with_path_style()
|
||||
} else {
|
||||
Bucket::new(&self.bucket, region, credentials)
|
||||
}.unwrap()
|
||||
bucket
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@ pub enum Error {
|
||||
Webfinger,
|
||||
Expired,
|
||||
UserAlreadyExists,
|
||||
Anyhow(anyhow::Error),
|
||||
#[cfg(feature = "s3")]
|
||||
S3(s3::error::S3Error),
|
||||
}
|
||||
|
||||
impl From<bcrypt::BcryptError> for Error {
|
||||
@@ -171,9 +172,10 @@ impl From<request::Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<anyhow::Error> for Error {
|
||||
fn from(err: anyhow::Error) -> Error {
|
||||
Error::Anyhow(err)
|
||||
#[cfg(feature = "s3")]
|
||||
impl From<s3::error::S3Error> for Error {
|
||||
fn from(err: s3::error::S3Error) -> Error {
|
||||
Error::S3(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user