@@ -36,19 +36,21 @@ export class MainThreadSecretState extends Disposable implements MainThreadSecre
3636 }
3737
3838 async $getPassword ( extensionId : string , key : string ) : Promise < string | undefined > {
39- this . logService . trace ( `Getting password for ${ extensionId } extension:` , key ) ;
39+ this . logService . trace ( `MainThreadSecretState#getPassword: Getting password for ${ extensionId } extension: ` , key ) ;
4040 const fullKey = await this . getFullKey ( extensionId ) ;
4141 const password = await this . credentialsService . getPassword ( fullKey , key ) ;
4242 if ( ! password ) {
43- this . logService . trace ( 'No password found for:' , key ) ;
43+ this . logService . trace ( 'MainThreadSecretState#getPassword: No password found for: ' , key ) ;
4444 return undefined ;
4545 }
4646
4747 let decrypted : string | null ;
4848 try {
49+ this . logService . trace ( 'MainThreadSecretState#getPassword: Decrypting password for: ' , key ) ;
4950 decrypted = await this . encryptionService . decrypt ( password ) ;
5051 } catch ( e ) {
5152 this . logService . error ( e ) ;
53+ this . logService . trace ( 'MainThreadSecretState#getPassword: Trying migration for: ' , key ) ;
5254
5355 // If we are on a platform that newly started encrypting secrets before storing them,
5456 // then passwords previously stored were stored un-encrypted (NOTE: but still being stored in a secure keyring).
@@ -65,7 +67,7 @@ export class MainThreadSecretState extends Disposable implements MainThreadSecre
6567 try {
6668 const value = JSON . parse ( decrypted ) ;
6769 if ( value . extensionId === extensionId ) {
68- this . logService . trace ( 'Password found for:' , key ) ;
70+ this . logService . trace ( 'MainThreadSecretState#getPassword: Password found for: ' , key ) ;
6971 return value . content ;
7072 }
7173 } catch ( parseError ) {
@@ -82,17 +84,20 @@ export class MainThreadSecretState extends Disposable implements MainThreadSecre
8284 }
8385 }
8486
85- this . logService . trace ( 'No password found for:' , key ) ;
87+ this . logService . trace ( 'MainThreadSecretState#getPassword: No password found for: ' , key ) ;
8688 return undefined ;
8789 }
8890
8991 async $setPassword ( extensionId : string , key : string , value : string ) : Promise < void > {
92+ this . logService . trace ( `MainThreadSecretState#setPassword: Setting password for ${ extensionId } extension: ` , key ) ;
9093 const fullKey = await this . getFullKey ( extensionId ) ;
9194 const toEncrypt = JSON . stringify ( {
9295 extensionId,
9396 content : value
9497 } ) ;
98+ this . logService . trace ( 'MainThreadSecretState#setPassword: Encrypting password for: ' , key ) ;
9599 const encrypted = await this . encryptionService . encrypt ( toEncrypt ) ;
100+ this . logService . trace ( 'MainThreadSecretState#setPassword: Storing password for: ' , key ) ;
96101 return await this . credentialsService . setPassword ( fullKey , key , encrypted ) ;
97102 }
98103
0 commit comments