mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00: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:
parent
b0b73ee333
commit
ef46983a3a
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue