forked from github-starred/komodo
implement configurable login options
This commit is contained in:
@@ -84,7 +84,8 @@ impl GoogleOauthClient {
|
||||
}
|
||||
|
||||
pub fn get_google_user(&self, id_token: &str) -> anyhow::Result<GoogleUser> {
|
||||
let t: Token<Value, GoogleUser, jwt::Unverified> = Token::parse_unverified(id_token).context("failed to parse id_token")?;
|
||||
let t: Token<Value, GoogleUser, jwt::Unverified> =
|
||||
Token::parse_unverified(id_token).context("failed to parse id_token")?;
|
||||
Ok(t.claims().to_owned())
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,16 @@ pub struct CoreConfig {
|
||||
#[serde(default = "default_jwt_valid_for")]
|
||||
pub jwt_valid_for: Timelength,
|
||||
|
||||
// used to verify validity from github webhooks
|
||||
pub github_webhook_secret: String,
|
||||
|
||||
// integration with slack app
|
||||
pub slack_url: Option<String>,
|
||||
|
||||
// enable login with local auth
|
||||
pub local_auth: bool,
|
||||
|
||||
// github integration
|
||||
pub github_webhook_secret: String,
|
||||
pub github_oauth: OauthCredentials,
|
||||
|
||||
// google integration
|
||||
@@ -52,7 +57,11 @@ fn default_jwt_valid_for() -> Timelength {
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
||||
pub struct OauthCredentials {
|
||||
#[serde(default)]
|
||||
pub enabled: bool,
|
||||
#[serde(default)]
|
||||
pub id: String,
|
||||
#[serde(default)]
|
||||
pub secret: String,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user