fix(deps): Use small base64 crate instead of rustc-serialize

This commit is contained in:
Lewin Bormann
2016-09-28 20:10:53 +02:00
parent 8d9c42c449
commit a4d60e754b
4 changed files with 10 additions and 7 deletions

7
Cargo.lock generated
View File

@@ -2,6 +2,7 @@
name = "yup-oauth2"
version = "0.6.3"
dependencies = [
"base64 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -9,7 +10,6 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"open 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -26,6 +26,11 @@ dependencies = [
"syntex_syntax 0.43.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "base64"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "0.5.0"

View File

@@ -11,12 +11,12 @@ license = "MIT OR Apache-2.0"
build = "src/build.rs"
[dependencies]
base64 = "0.2"
chrono = ">= 0.2"
hyper = "^ 0.9.0"
itertools = ">= 0.4"
log = ">= 0.3"
openssl = "0.7"
rustc-serialize = "0.3"
serde = "0.8"
serde_json = "0.8"
serde_macros = { version = "0.8", optional = true }

View File

@@ -1,7 +1,7 @@
extern crate serde;
extern crate serde_json;
extern crate rustc_serialize;
extern crate base64;
extern crate chrono;
extern crate openssl;
extern crate hyper;

View File

@@ -24,10 +24,10 @@ use storage::{hash_scopes, MemoryStorage, TokenStorage};
use hyper::header;
use url::form_urlencoded;
use base64;
use chrono;
use hyper;
use openssl;
use rustc_serialize;
use serde_json;
const GRANT_TYPE: &'static str = "urn:ietf:params:oauth:grant-type:jwt-bearer";
@@ -36,9 +36,7 @@ const GOOGLE_RS256_HEAD: &'static str = "{\"alg\":\"RS256\",\"typ\":\"JWT\"}";
// Encodes s as Base64
fn encode_base64<T: AsRef<[u8]>>(s: T) -> String {
use rustc_serialize::base64::ToBase64;
s.as_ref().to_base64(rustc_serialize::base64::URL_SAFE)
base64::encode(s.as_ref())
}
// Calculates the SHA256 hash.