Support connect gateway (#306)

This commit is contained in:
Kevin Yue authored and GitHub committed 2024-01-28 11:41:48 +08:00
1 parent 6fe6a1387a
commit b2bb35994f
14 files changed
+220 -92

No files matched your search

+18
View File
@@ -139,6 +139,24 @@ impl CachedCredential {
pub fn set_auth_cookie(&mut self, auth_cookie: AuthCookieCredential) {
self.auth_cookie = auth_cookie;
}
pub fn set_username(&mut self, username: String) {
self.username = username;
}
pub fn set_password(&mut self, password: Option<String>) {
self.password = password.map(|s| s.to_string());
}
}
impl From<PasswordCredential> for CachedCredential {
fn from(value: PasswordCredential) -> Self {
Self::new(
value.username().to_owned(),
Some(value.password().to_owned()),
AuthCookieCredential::new("", "", ""),
)
}
}
#[derive(Debug, Serialize, Deserialize, Type, Clone)]