mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
cli: option to disable encryption of keychain matter
* option to disable encryption of keys Avoids issue of token invalidation when switching machines with a shared home directory, as suggested by @connor4312 in https://github.com/microsoft/vscode-remote-release/issues/8110#issuecomment-1452270922 Fixes #8110 * Update cli/src/auth.rs Co-authored-by: Connor Peet <connor@peet.io> * Change variable to VSCODE_CLI_DISABLE_KEYCHAIN_ENCRYPT Co-authored-by: Connor Peet <connor@peet.io> --------- Co-authored-by: Connor Peet <connor@peet.io>
This commit is contained in:
@@ -183,6 +183,9 @@ where
|
||||
T: Serialize + ?Sized,
|
||||
{
|
||||
let dec = serde_json::to_string(value).expect("expected to serialize");
|
||||
if std::env::var("VSCODE_CLI_DISABLE_KEYCHAIN_ENCRYPT").is_ok() {
|
||||
return dec;
|
||||
}
|
||||
encrypt(&dec)
|
||||
}
|
||||
|
||||
@@ -191,7 +194,7 @@ fn unseal<T>(value: &str) -> Option<T>
|
||||
where
|
||||
T: DeserializeOwned,
|
||||
{
|
||||
// small back-compat for old unencrypted values
|
||||
// small back-compat for old unencrypted values, or if VSCODE_CLI_DISABLE_KEYCHAIN_ENCRYPT set
|
||||
if let Ok(v) = serde_json::from_str::<T>(value) {
|
||||
return Some(v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user