1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use oauth2_client::re_exports::{Deserialize_enum_str, Scope, Serialize_enum_str};

pub const TOKEN_URL: &str = "https://oauth2.googleapis.com/token";
pub const AUTHORIZATION_URL: &str = "https://accounts.google.com/o/oauth2/v2/auth";
pub const DEVICE_AUTHORIZATION_URL: &str = "https://oauth2.googleapis.com/device/code";

pub mod authorization_code_grant;
pub mod device_authorization_grant;

pub use authorization_code_grant::{
    GoogleProviderForDesktopApps, GoogleProviderForWebServerApps,
    GoogleProviderForWebServerAppsAccessType,
};
pub use device_authorization_grant::GoogleProviderForTvAndDeviceApps;

pub mod extensions;
pub use extensions::GoogleExtensionsBuilder;

#[derive(Deserialize_enum_str, Serialize_enum_str, Debug, Clone, PartialEq)]
pub enum GoogleScope {
    //
    #[serde(rename = "email")]
    #[serde(alias = "https://www.googleapis.com/auth/userinfo.email")]
    Email,
    #[serde(rename = "profile")]
    #[serde(alias = "https://www.googleapis.com/auth/userinfo.profile")]
    Profile,
    //
    #[serde(rename = "openid")]
    Openid,
    //
    #[serde(rename = "https://www.googleapis.com/auth/drive.file")]
    DriveFile,
    //
    #[serde(rename = "https://www.googleapis.com/auth/youtube")]
    Youtube,
    #[serde(rename = "https://www.googleapis.com/auth/youtube.readonly")]
    YoutubeReadonly,
    //
    // TODO
    //
    //
    //
    #[serde(other)]
    Other(String),
}
impl Scope for GoogleScope {}