Skip to content

Commit

Permalink
refactor(common): Rename common -> types
Browse files Browse the repository at this point in the history
  • Loading branch information
dermesser committed Aug 31, 2016
1 parent 9e59bf0 commit 85b12dd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/authenticator_delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/installed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs.in
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
2 changes: 1 addition & 1 deletion src/refresh.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use common::{FlowType, JsonError};
use types::{FlowType, JsonError};
use device::GOOGLE_TOKEN_URL;

use chrono::UTC;
Expand Down
2 changes: 1 addition & 1 deletion src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/common.rs → src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ pub struct ConsoleApplicationSecret {
pub installed: Option<ApplicationSecret>,
}


#[cfg(test)]
pub mod tests {
use super::*;
Expand Down

0 comments on commit 85b12dd

Please sign in to comment.