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

Derive Serialize and Deserialize for Region and Credentials #277

Merged
merged 2 commits into from Jul 21, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions aws-creds/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "aws-creds"
version = "0.29.1"
version = "0.30.0"
authors = ["Drazen Urch"]
description = "Tiny Rust library for working with Amazon IAM credential,s, supports `s3` crate"
repository = "https://github.com/durch/rust-s3"
Expand All @@ -21,9 +21,7 @@ rust-ini = "0.18"
attohttpc = { version = "0.19", default-features = false, features = ["json"], optional = true }
url = "2"
serde-xml-rs = "0.5"
serde = "1"
serde_derive = "1"

serde = { version = "1.0.137", features = ["derive"] }

[features]
default = ["native-tls"]
Expand Down
3 changes: 2 additions & 1 deletion aws-creds/src/credentials.rs
@@ -1,6 +1,7 @@
#![allow(dead_code)]
use crate::error::CredentialsError;
use ini::Ini;
use serde::{Deserialize, Serialize};
use serde_xml_rs as serde_xml;
use std::collections::HashMap;
use std::env;
Expand Down Expand Up @@ -61,7 +62,7 @@ use url::Url;
/// #[cfg(feature="http-credentials")]
/// let credentials = Credentials::new(None, None, None, None, None);
/// ```
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct Credentials {
/// AWS public access key.
pub access_key: Option<String>,
Expand Down
3 changes: 0 additions & 3 deletions aws-creds/src/lib.rs
@@ -1,9 +1,6 @@
#![allow(unused_imports)]
#![forbid(unsafe_code)]

#[macro_use]
extern crate serde_derive;

mod credentials;
pub use credentials::*;
pub mod error;
3 changes: 2 additions & 1 deletion aws-region/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "aws-region"
version = "0.24.1"
version = "0.25.0"
authors = ["Drazen Urch"]
description = "Tiny Rust library for working with Amazon AWS regions, supports `s3` crate"
repository = "https://github.com/durch/rust-s3"
Expand All @@ -16,3 +16,4 @@ path = "src/lib.rs"

[dependencies]
thiserror = "1"
serde = { version = "1.0.137", features = ["derive"] }
3 changes: 2 additions & 1 deletion aws-region/src/region.rs
@@ -1,5 +1,6 @@
#![allow(dead_code)]

use serde::{Deserialize, Serialize};
use std::fmt;
use std::str::{self, FromStr};

Expand All @@ -24,7 +25,7 @@ use std::str::{self, FromStr};
/// let region = Region::Custom { region: region_name, endpoint };
///
/// ```
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub enum Region {
/// us-east-1
UsEast1,
Expand Down
4 changes: 2 additions & 2 deletions s3/Cargo.toml
Expand Up @@ -22,9 +22,9 @@ path = "src/lib.rs"
async-std = { version = "1", optional = true }
async-trait = "0.1"
attohttpc = { version = "0.19", optional = true, default-features = false }
aws-creds = { version = "0.29", default-features = false }
aws-creds = { version = "0.30.0", default-features = false }
# aws-creds = { path = "../aws-creds", default-features = false }
aws-region = "0.24"
aws-region = "0.25.0"
# aws-region = {path = "../aws-region"}
base64 = "0.13"
cfg-if = "1"
Expand Down