Skip to content

Commit e270a50

Browse files
committed
refactor: remove invalid Gmail OAuth2 tokens
They were already unused since <chatmail/provider-db#310>
1 parent b863345 commit e270a50

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/oauth2.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ use crate::provider;
1414
use crate::provider::Oauth2Authorizer;
1515
use crate::tools::time;
1616

17-
const OAUTH2_GMAIL: Oauth2 = Oauth2 {
18-
// see <https://developers.google.com/identity/protocols/OAuth2InstalledApp>
19-
client_id: "959970109878-4mvtgf6feshskf7695nfln6002mom908.apps.googleusercontent.com",
20-
get_code: "https://accounts.google.com/o/oauth2/auth?client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI&response_type=code&scope=https%3A%2F%2Fmail.google.com%2F%20email&access_type=offline",
21-
init_token: "https://accounts.google.com/o/oauth2/token?client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI&code=$CODE&grant_type=authorization_code",
22-
refresh_token: "https://accounts.google.com/o/oauth2/token?client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URI&refresh_token=$REFRESH_TOKEN&grant_type=refresh_token",
23-
get_userinfo: Some(
24-
"https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=$ACCESS_TOKEN",
25-
),
26-
};
27-
2817
const OAUTH2_YANDEX: Oauth2 = Oauth2 {
2918
// see <https://tech.yandex.com/oauth/doc/dg/reference/auto-code-client-docpage/>
3019
client_id: "c4d0b6735fc8420a816d7e1303469341",
@@ -279,7 +268,6 @@ impl Oauth2 {
279268
.and_then(|provider| provider.oauth2_authorizer.as_ref())
280269
{
281270
return Some(match oauth2_authorizer {
282-
Oauth2Authorizer::Gmail => OAUTH2_GMAIL,
283271
Oauth2Authorizer::Yandex => OAUTH2_YANDEX,
284272
});
285273
}

src/provider.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,9 @@ pub enum UsernamePattern {
8282

8383
/// Type of OAuth 2 authorization.
8484
#[derive(Debug, PartialEq, Eq)]
85-
#[repr(u8)]
8685
pub enum Oauth2Authorizer {
8786
/// Yandex.
88-
Yandex = 1,
89-
90-
/// Gmail.
91-
Gmail = 2,
87+
Yandex,
9288
}
9389

9490
/// Email server endpoint.

0 commit comments

Comments
 (0)