mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-02-23 15:50:00 +01:00
refactor(common): Rename common -> types
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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::*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use common::{FlowType, JsonError};
|
||||
use types::{FlowType, JsonError};
|
||||
use device::GOOGLE_TOKEN_URL;
|
||||
|
||||
use chrono::UTC;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -244,7 +244,6 @@ pub struct ConsoleApplicationSecret {
|
||||
pub installed: Option<ApplicationSecret>,
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod tests {
|
||||
use super::*;
|
||||
Reference in New Issue
Block a user