mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Don't enforce the password limit for file keytar (#9974)
* Allow users to use file based keychain if they have to * Don't enforce this limit for FS keytar * Spacing
This commit is contained in:
@@ -141,7 +141,7 @@ export class SimpleTokenCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async saveCredential(id: string, key: string): Promise<void> {
|
async saveCredential(id: string, key: string): Promise<void> {
|
||||||
if (key.length > 2500) { // Windows limitation
|
if (!this.forceFileStorage && key.length > 2500) { // Windows limitation
|
||||||
throw new Error('Key length is longer than 2500 chars');
|
throw new Error('Key length is longer than 2500 chars');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,9 +159,11 @@ export class SimpleTokenCache {
|
|||||||
async getCredential(id: string): Promise<string | undefined> {
|
async getCredential(id: string): Promise<string | undefined> {
|
||||||
try {
|
try {
|
||||||
const result = await this.keytar.getPassword(this.serviceName, id);
|
const result = await this.keytar.getPassword(this.serviceName, id);
|
||||||
|
|
||||||
if (result === null) {
|
if (result === null) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.log(`Getting key failed: ${ex}`);
|
console.log(`Getting key failed: ${ex}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user