44 * ------------------------------------------------------------------------------------------ */
55'use strict' ;
66
7- import exhort from '@trustification/exhort-javascript-api' ;
7+
8+ import exhort , { Options } from '@trustification/exhort-javascript-api' ;
89import { AnalysisReport } from '@trustification/exhort-api-spec/model/v4/AnalysisReport' ;
910
1011import { globalConfig } from '../config' ;
@@ -15,6 +16,7 @@ import { notifications, outputChannelDep } from '../extension';
1516import { Source } from '@trustification/exhort-api-spec/model/v4/Source' ;
1617import { DependencyReport } from '@trustification/exhort-api-spec/model/v4/DependencyReport' ;
1718import { Issue } from '@trustification/exhort-api-spec/model/v4/Issue' ;
19+ import { TokenProvider } from '../tokenProvider' ;
1820
1921/**
2022 * Represents a source object with an ID and dependencies array.
@@ -146,11 +148,12 @@ class AnalysisResponse implements IAnalysisResponse {
146148 * @param provider - The dependency provider of the corresponding ecosystem.
147149 * @returns A Promise resolving to an AnalysisResponse object.
148150 */
149- async function executeComponentAnalysis ( diagnosticFilePath : Uri , provider : IDependencyProvider ) : Promise < AnalysisResponse > {
151+ async function executeComponentAnalysis ( tokenProvider : TokenProvider , diagnosticFilePath : Uri , provider : IDependencyProvider ) : Promise < AnalysisResponse > {
150152
151153 // Define configuration options for the component analysis request
152- const options = {
153- 'RHDA_TOKEN' : globalConfig . telemetryId ,
154+ const options : Options = {
155+ 'RHDA_TOKEN' : await tokenProvider . getToken ( ) ?? '' ,
156+ 'RHDA_TELEMETRY_ID' : globalConfig . telemetryId ,
154157 'RHDA_SOURCE' : globalConfig . utmSource ,
155158 'MATCH_MANIFEST_VERSIONS' : globalConfig . matchManifestVersions ,
156159 'EXHORT_PROXY_URL' : globalConfig . exhortProxyUrl ,
0 commit comments