fix: correctly pass through the `tokenCache` option (#107)

This commit is contained in:
Arthur Schreiber 2021-03-26 19:52:49 +01:00 коммит произвёл GitHub
Родитель c6b149d297
Коммит 4c177518c3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1,5 +1,8 @@
# Changelog
## 3.0.9 - Unreleased
- Pass user provided `tokenCache` option to `withUsernamePasswordWithAuthResponse` and `withServicePrincipalSecretWithAuthResponse` methods to the credentials being created.
## 3.0.8 - 2021/03/23
- Fix command injection in core function `execAz()` by replacing `exec()` with `execFile()` - CVE-2021-28458

Просмотреть файл

@ -174,7 +174,7 @@ export async function withUsernamePasswordWithAuthResponse(username: string, pas
options.environment = Environment.AzureCloud;
}
const creds = new UserTokenCredentials(options.clientId, options.domain, username, password, options.tokenAudience, options.environment);
const creds = new UserTokenCredentials(options.clientId, options.domain, username, password, options.tokenAudience, options.environment, options.tokenCache);
const tokenResponse = await creds.getToken();
// The token cache gets propulated for all the tenants as a part of building the tenantList.
@ -214,7 +214,7 @@ export async function withServicePrincipalSecretWithAuthResponse(clientId: strin
options.environment = Environment.AzureCloud;
}
const creds = new ApplicationTokenCredentials(clientId, domain, secret, options.tokenAudience, options.environment);
const creds = new ApplicationTokenCredentials(clientId, domain, secret, options.tokenAudience, options.environment, options.tokenCache);
await creds.getToken();
const subscriptionList = await _getSubscriptions(creds, [domain], options.tokenAudience);

Просмотреть файл

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-nodeauth"
},
"version": "3.0.8",
"version": "3.0.9",
"description": "Azure Authentication library in node.js with type definitions.",
"keywords": [
"node",
@ -70,4 +70,4 @@
"test:unit": "mocha",
"check:packagejsonversion": "ts-node ./.scripts/checkPackageJsonVersion.ts"
}
}
}