secretless (#305)
This commit is contained in:
Родитель
fd27b31c11
Коммит
59ed13d8b1
|
@ -5,12 +5,16 @@ on:
|
|||
branches: [ master ]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
checks: write
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
checks: write
|
||||
pull-requests: write
|
||||
environment: build
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3
|
||||
|
@ -23,16 +27,21 @@ jobs:
|
|||
- run: npm ci
|
||||
- run: npm run checkFormat
|
||||
- run: npm run lint
|
||||
- name: Azure login
|
||||
uses: azure/login@v2
|
||||
with:
|
||||
client-id: ${{ secrets.APP_ID }}
|
||||
tenant-id: ${{ secrets.TENANT_ID }}
|
||||
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}
|
||||
- run: npm run testPipeline
|
||||
env:
|
||||
AUTO_TEST: true
|
||||
LOGIN_TEST: true
|
||||
TEST_DATABASE: "e2e"
|
||||
APP_ID: "b699d721-4f6f-4320-bc9a-88d578dfe68f"
|
||||
APP_KEY: ${{secrets.APP_KEY}}
|
||||
TENANT_ID: "72f988bf-86f1-41af-91ab-2d7cd011db47"
|
||||
ENGINE_CONNECTION_STRING: "https://sdkse2etest.eastus.kusto.windows.net"
|
||||
DM_CONNECTION_STRING: "https://ingest-sdkse2etest.eastus.kusto.windows.net"
|
||||
AZURE_CLIENT_ID: ${{ secrets.APP_ID }}
|
||||
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v2
|
||||
- name: Publish Unit Test Results
|
||||
|
|
|
@ -256,29 +256,27 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@azure/identity": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.3.2.tgz",
|
||||
"integrity": "sha512-aDLwgMXpNBEXOlfCP9r5Rn+inmbnTbadlOnrKI2dPS9Lpf4gHvpYBV+DEZKttakfJ+qn4iWWb7zONQSO3A4XSA==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.0.1.tgz",
|
||||
"integrity": "sha512-yRdgF03SFLqUMZZ1gKWt0cs0fvrDIkq2bJ6Oidqcoo5uM85YMBnXWMzYKK30XqIT76lkFyAaoAAy5knXhrG4Lw==",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-auth": "^1.5.0",
|
||||
"@azure/core-client": "^1.4.0",
|
||||
"@azure/core-rest-pipeline": "^1.1.0",
|
||||
"@azure/core-tracing": "^1.0.0",
|
||||
"@azure/core-util": "^1.0.0",
|
||||
"@azure/core-util": "^1.3.0",
|
||||
"@azure/logger": "^1.0.0",
|
||||
"@azure/msal-browser": "^2.37.1",
|
||||
"@azure/msal-common": "^13.1.0",
|
||||
"@azure/msal-node": "^1.17.3",
|
||||
"@azure/msal-browser": "^3.5.0",
|
||||
"@azure/msal-node": "^2.5.1",
|
||||
"events": "^3.0.0",
|
||||
"jws": "^4.0.0",
|
||||
"open": "^8.0.0",
|
||||
"stoppable": "^1.1.0",
|
||||
"tslib": "^2.2.0",
|
||||
"uuid": "^8.3.0"
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/identity/node_modules/@azure/core-tracing": {
|
||||
|
@ -292,14 +290,6 @@
|
|||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/identity/node_modules/@azure/msal-common": {
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz",
|
||||
"integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/logger": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz",
|
||||
|
@ -312,43 +302,35 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@azure/msal-browser": {
|
||||
"version": "2.38.3",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.3.tgz",
|
||||
"integrity": "sha512-2WuLFnWWPR1IdvhhysT18cBbkXx1z0YIchVss5AwVA95g7CU5CpT3d+5BcgVGNXDXbUU7/5p0xYHV99V5z8C/A==",
|
||||
"version": "3.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.11.1.tgz",
|
||||
"integrity": "sha512-tZFJnP5ZpgkmazSriEDW+Xl3/4WI823uhnYhWCHPkGywFWEZoPA5VkiCK8x4x8ECXp3mGr5qEI82MU43PBiaKA==",
|
||||
"dependencies": {
|
||||
"@azure/msal-common": "13.3.1"
|
||||
"@azure/msal-common": "14.8.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-browser/node_modules/@azure/msal-common": {
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz",
|
||||
"integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==",
|
||||
"node_modules/@azure/msal-common": {
|
||||
"version": "14.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.8.1.tgz",
|
||||
"integrity": "sha512-9HfBMDTIgtFFkils+o6gO/aGEoLLuc4z+QLLfhy/T1bTNPiVsX/9CjaBPMZGnMltN/IlMkU5SGGNggGh55p5xA==",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-node": {
|
||||
"version": "1.18.4",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz",
|
||||
"integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==",
|
||||
"version": "2.6.6",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.6.6.tgz",
|
||||
"integrity": "sha512-j+1hW81ccglIYWukXufzRA4O71BCmpbmCO66ECDyE9FuPno6SjiR+K+mIk4tg6aQ7/UO2QA/EnRmT6YN0EF1Hw==",
|
||||
"dependencies": {
|
||||
"@azure/msal-common": "13.3.1",
|
||||
"@azure/msal-common": "14.8.1",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"uuid": "^8.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "10 || 12 || 14 || 16 || 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-node/node_modules/@azure/msal-common": {
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz",
|
||||
"integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/storage-blob": {
|
||||
|
@ -18851,7 +18833,7 @@
|
|||
"version": "6.0.1",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@azure/identity": "^3.3.2",
|
||||
"@azure/identity": "^4.0.1",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"axios": "^1.6.0",
|
||||
"follow-redirects": "^1.15.1",
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/identity": "^3.3.2",
|
||||
"@azure/identity": "^4.0.1",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"axios": "^1.6.0",
|
||||
"follow-redirects": "^1.15.1",
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import KustoIngestStatusQueues from "../../src/status";
|
||||
import {
|
||||
Client,
|
||||
ClientRequestProperties,
|
||||
|
@ -29,6 +28,7 @@ import {
|
|||
} from "../../src";
|
||||
import { sleep } from "../../src/retry";
|
||||
|
||||
import { AzureCliCredential } from "@azure/identity";
|
||||
import assert from "assert";
|
||||
import fs, { ReadStream } from "fs";
|
||||
import util from "util";
|
||||
|
@ -44,22 +44,33 @@ interface ParsedJsonMapping {
|
|||
}
|
||||
|
||||
const databaseName = process.env.TEST_DATABASE;
|
||||
const appId = process.env.APP_ID;
|
||||
const appId = process.env.APP_ID || process.env.AZURE_CLIENT_ID;
|
||||
const appKey = process.env.APP_KEY;
|
||||
const tenantId = process.env.TENANT_ID;
|
||||
const tenantId = process.env.TENANT_ID || process.env.AZURE_TENANT_ID;
|
||||
|
||||
const main = (): void => {
|
||||
if (!databaseName || !appId || !appKey || !tenantId) {
|
||||
if (!databaseName || !process.env.ENGINE_CONNECTION_STRING) {
|
||||
process.stdout.write("Skip E2E test - Missing env variables");
|
||||
return;
|
||||
}
|
||||
|
||||
const engineKcsb = ConnectionStringBuilder.withAadApplicationKeyAuthentication(process.env.ENGINE_CONNECTION_STRING ?? "", appId, appKey, tenantId);
|
||||
const ecs = process.env.ENGINE_CONNECTION_STRING;
|
||||
const dcs = process.env.DM_CONNECTION_STRING ?? ecs;
|
||||
const cred = new AzureCliCredential({});
|
||||
|
||||
const engineKcsb =
|
||||
appId && appKey && tenantId
|
||||
? ConnectionStringBuilder.withAadApplicationKeyAuthentication(ecs, appId, appKey, tenantId)
|
||||
: ConnectionStringBuilder.withTokenCredential(ecs, cred);
|
||||
const dmKcsb =
|
||||
appId && appKey && tenantId
|
||||
? ConnectionStringBuilder.withAadApplicationKeyAuthentication(dcs, appId, appKey, tenantId)
|
||||
: ConnectionStringBuilder.withTokenCredential(dcs, cred);
|
||||
|
||||
engineKcsb.applicationNameForTracing = "NodeE2ETest_ø";
|
||||
|
||||
const queryClient = new Client(engineKcsb);
|
||||
const streamingIngestClient = new StreamingIngestClient(engineKcsb);
|
||||
const dmKcsb = ConnectionStringBuilder.withAadApplicationKeyAuthentication(process.env.DM_CONNECTION_STRING ?? "", appId, appKey, tenantId);
|
||||
const ingestClient = new IngestClient(dmKcsb);
|
||||
const dmKustoClient = new Client(dmKcsb);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче