update min version of dependencies in the package (#68)

* Added support to use azure-cli credentials from the JS sdk

* remove jsdoc annotations

* minor updates and review changes

* updgrading CI to run against 8, 10, 12 versions of node.js. Removing support for 6.x.

* Add support for client_id, object_id and ms_res_id query parameters for VmMSI. Fixes #58.

* expose resource for getting tokens via azure cli

* addressed review feedback

* get subscriptions if the  tokenAudience is for  Resource Manager.

* depedency version updates

* update check package version script
This commit is contained in:
Amar Zavery 2019-07-23 10:59:30 -07:00 коммит произвёл GitHub
Родитель 1223c5c13d
Коммит 8715839d9a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 47 добавлений и 21 удалений

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

@ -1,3 +1,3 @@
import { checkPackageJsonVersion } from "@ts-common/azure-js-dev-tools";
process.exitCode = checkPackageJsonVersion(__dirname);
process.exitCode = checkPackageJsonVersion({ startPath: __dirname }).check() as number;

9
.vscode/launch.json поставляемый
Просмотреть файл

@ -1,6 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Sample Debug",
"program": "${workspaceFolder}/samples/msiVmTokenCredentialsLogin.ts",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
},
{
"type": "node",
"request": "launch",

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

@ -1,4 +1,10 @@
# Changelog
## 2.0.3 - 2019/07/23
- Updated min version of dependency `@azure/ms-rest-js` to `^2.0.3`.
- Updated min version of dependenct `@azure/ms-rest-azure-env` to `^2.0.0`.
- Improved documentation of `MSIOptions.resource`
- Improved samples in README.md
## 2.0.2 - 2019/06/13
- Ensure we always get JSON responses back from Azure CLI.

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

@ -101,7 +101,7 @@ If the service principal is already created then login with service principal in
5. az account show --sdk-auth > auth.json
```typescript
import * as msRestNodeAuth from "../lib/msRestNodeAuth";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
const options: msRestNodeAuth.LoginWithAuthFileOptions = {
filePath: "<file path to auth file>",
@ -116,7 +116,7 @@ msRestNodeAuth.loginWithAuthFileWithAuthResponse(options).then((authRes) => {
### MSI (Managed Service Identity) based login from a virtual machine created in Azure.
```typescript
import * as msRestNodeAuth from "../lib/msRestNodeAuth";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
const options: msRestNodeAuth.MSIVmOptions = {
port: 50342;
@ -131,7 +131,7 @@ msRestNodeAuth.loginWithVmMSI(options).then((msiTokenRes) => {
### MSI (Managed Service Identity) based login from an AppService or Azure Function created in Azure.
```typescript
import * as msRestNodeAuth from "../lib/msRestNodeAuth";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
const options: msRestNodeAuth.MSIAppServiceOptions = {
msiEndpoint: "http://127.0.0.1:41741/MSI/token/";

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

@ -11,9 +11,12 @@ import { AuthConstants } from "../util/authConstants";
export interface MSIOptions {
/**
* @prop {string} [resource] - The resource uri or token audience for which the token is needed.
* For e.g. it can be:
* - resourcemanagement endpoint "https://management.azure.com/" (default)
* - management endpoint "https://management.core.windows.net/"
* For example:
* - Defaults to Azure Resource Manager from environment: AzureCloud. "https://management.azure.com/" (default)
* - For ServiceManagement (ASM): "https://management.core.windows.net/"
* - For Azure KeyVault: "https://vault.azure.net"
* - For Azure Batch: "https://batch.core.windows.net"
* - For Azure Active Directory Graph: "https://graph.windows.net"
*/
resource?: string;
@ -39,6 +42,14 @@ export interface MSITokenResponse extends TokenResponse {
* This object can only be used to acquire token on a virtual machine provisioned in Azure with managed service identity.
*/
export abstract class MSITokenCredentials implements TokenClientCredentials {
/**
* Azure resource endpoints.
* - Defaults to Azure Resource Manager from environment: AzureCloud. "https://management.azure.com/"
* - For ServiceManagement (ASM): "https://management.core.windows.net/"
* - For Azure KeyVault: "https://vault.azure.net"
* - For Azure Batch: "https://batch.core.windows.net"
* - For Azure Active Directory Graph: "https://graph.windows.net"
*/
resource: string;
protected _httpClient: HttpClient;

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

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-nodeauth"
},
"version": "2.0.2",
"version": "2.0.3",
"description": "Azure Authentication library in node.js with type definitions.",
"keywords": [
"node",
@ -28,28 +28,28 @@
"tsconfig.json"
],
"dependencies": {
"@azure/ms-rest-azure-env": "^1.1.2",
"@azure/ms-rest-js": "^1.8.7",
"@azure/ms-rest-azure-env": "^2.0.0",
"@azure/ms-rest-js": "^2.0.3",
"adal-node": "^0.1.28"
},
"license": "MIT",
"devDependencies": {
"@ts-common/azure-js-dev-tools": "^0.4.9",
"@types/chai": "^4.1.6",
"@ts-common/azure-js-dev-tools": "^22.2.0",
"@types/chai": "^4.1.7",
"@types/dotenv": "^6.1.1",
"@types/mocha": "^5.2.5",
"@types/mocha": "^5.2.7",
"@types/node": "^10.12.0",
"chai": "^4.2.0",
"dotenv": "^8.0.0",
"mocha": "^5.2.0",
"nock": "^10.0.1",
"npm-run-all": "^4.1.3",
"mocha": "^6.2.0",
"nock": "^10.0.6",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.0",
"rollup": "^0.67.1",
"rollup": "^1.17.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.1.3"
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"typescript": "^3.5.3"
},
"homepage": "https://github.com/Azure/ms-rest-nodeauth",
"repository": {
@ -69,4 +69,4 @@
"test:unit": "mocha",
"check:packagejsonversion": "ts-node ./.scripts/checkPackageJsonVersion.ts"
}
}
}