refactor(common): Rename common -> types

This commit is contained in:
Lewin Bormann
2016-08-31 20:01:24 +02:00
parent 9e59bf0496
commit 85b12dd3e8
8 changed files with 14 additions and 13 deletions

View File

@@ -8,7 +8,7 @@ use std::fmt;
use std::convert::From;
use authenticator_delegate::{AuthenticatorDelegate, PollError, PollInformation};
use common::{RequestError, Token, FlowType, ApplicationSecret};
use types::{RequestError, Token, FlowType, ApplicationSecret};
use device::DeviceFlow;
use installed::{InstalledFlow, InstalledFlowReturnMethod};
use refresh::{RefreshResult, RefreshFlow};
@@ -368,8 +368,8 @@ pub enum Retry {
mod tests {
use super::*;
use super::super::device::tests::MockGoogleAuth;
use super::super::common::tests::SECRET;
use super::super::common::ConsoleApplicationSecret;
use super::super::types::tests::SECRET;
use super::super::types::ConsoleApplicationSecret;
use storage::MemoryStorage;
use std::default::Default;
use hyper;

View File

@@ -5,7 +5,7 @@ use std::io;
use std::error::Error;
use authenticator::Retry;
use common::RequestError;
use types::RequestError;
use chrono::{DateTime, Local, UTC};
use std::time::Duration;

View File

@@ -12,7 +12,7 @@ use std::borrow::BorrowMut;
use std::io::Read;
use std::i64;
use common::{Token, FlowType, Flow, RequestError, JsonError};
use types::{Token, FlowType, Flow, RequestError, JsonError};
use authenticator_delegate::{PollError, PollInformation};
pub const GOOGLE_TOKEN_URL: &'static str = "https://accounts.google.com/o/oauth2/token";

View File

@@ -19,7 +19,7 @@ use serde_json::error;
use url::form_urlencoded;
use url::percent_encoding::{percent_encode, QUERY_ENCODE_SET};
use common::{ApplicationSecret, Token};
use types::{ApplicationSecret, Token};
use authenticator_delegate::AuthenticatorDelegate;
const OOB_REDIRECT_URI: &'static str = "urn:ietf:wg:oauth:2.0:oob";

View File

@@ -12,19 +12,21 @@ extern crate mime;
extern crate url;
extern crate itertools;
mod authenticator_delegate;
mod authenticator;
mod authenticator_delegate;
mod device;
mod storage;
mod helper;
mod installed;
mod refresh;
mod common;
mod storage;
mod types;
pub use device::DeviceFlow;
pub use refresh::{RefreshFlow, RefreshResult};
pub use common::{Token, FlowType, ApplicationSecret, ConsoleApplicationSecret, Scheme, TokenType};
pub use types::{Token, FlowType, ApplicationSecret, ConsoleApplicationSecret, Scheme, TokenType};
pub use installed::{InstalledFlow, InstalledFlowReturnMethod};
pub use storage::{TokenStorage, NullStorage, MemoryStorage, DiskTokenStorage};
pub use authenticator::{Authenticator, Retry, GetToken};
pub use authenticator_delegate::{AuthenticatorDelegate, DefaultAuthenticatorDelegate, PollError,
PollInformation};
pub use helper::*;

View File

@@ -1,4 +1,4 @@
use common::{FlowType, JsonError};
use types::{FlowType, JsonError};
use device::GOOGLE_TOKEN_URL;
use chrono::UTC;

View File

@@ -12,7 +12,7 @@ use std::fs;
use std::io;
use std::io::{Read, Write};
use common::Token;
use types::Token;
/// Implements a specialized storage to set and retrieve `Token` instances.
/// The `scope_hash` represents the signature of the scopes for which the given token

View File

@@ -244,7 +244,6 @@ pub struct ConsoleApplicationSecret {
pub installed: Option<ApplicationSecret>,
}
#[cfg(test)]
pub mod tests {
use super::*;