Add internal telemetry (#36)
We are cleared to enrich internal telemetry.
This commit is contained in:
Родитель
1f530c61dd
Коммит
8087a3239f
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "build:dev",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"label": "npm: build:dev",
|
||||
"detail": "webpack --mode development"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -44,19 +44,17 @@ addEventListener('unhandledrejection', e => appInsights.trackException({
|
|||
const organization = SDK.getHost().name
|
||||
const accessToken = await SDK.getAccessToken();
|
||||
const identitiesUri = `https://vssps.dev.azure.com/${organization}/_apis/identities?searchFilter=General&filterValue=${user.name}&queryMembership=None&api-version=7.0`
|
||||
const headers = new Headers();
|
||||
headers.append("Accept", "application/json");
|
||||
headers.append("Authorization", "Bearer " + accessToken);
|
||||
headers.append("X-VSS-ReauthenticationAction", "Suppress");
|
||||
|
||||
const options: RequestInit = {
|
||||
method: "GET",
|
||||
mode: "cors",
|
||||
headers: headers
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(identitiesUri, options)
|
||||
const response = await fetch(identitiesUri, {
|
||||
method: "GET",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Accept": "application/json",
|
||||
"Authorization": `Bearer ${accessToken}`,
|
||||
"X-VSS-ReauthenticationAction": "Suppress",
|
||||
}
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
const json = await response.json()
|
||||
|
@ -71,6 +69,10 @@ addEventListener('unhandledrejection', e => appInsights.trackException({
|
|||
appInsights.trackException({ exception: e })
|
||||
}
|
||||
|
||||
if (this.tenant === '72f988bf-86f1-41af-91ab-2d7cd011db47') {
|
||||
appInsights.setAuthenticatedUserContext(user.name, organization)
|
||||
}
|
||||
|
||||
const projectService = await SDK.getService<IProjectPageService>(CommonServiceIds.ProjectPageService)
|
||||
const project = await projectService.getProject()
|
||||
|
||||
|
@ -170,6 +172,7 @@ addEventListener('unhandledrejection', e => appInsights.trackException({
|
|||
})
|
||||
})()
|
||||
}
|
||||
|
||||
render() {
|
||||
const { logs, toolNames, user } = this
|
||||
const numberOfScans = toolNames?.size ?? 0
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"id": "scans-dev",
|
||||
"name": "SARIF SAST Scans Tab DEV",
|
||||
"public": false,
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"contributions": [
|
||||
{
|
||||
"id": "build-tab",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"publisher": "sariftools",
|
||||
"id": "scans",
|
||||
"name": "SARIF SAST Scans Tab",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"public": true,
|
||||
"contributions": [
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче