@@ -6,6 +6,7 @@ import constants from './constants.js';
66import type { Logger } from 'winston'
77import pkgJSON from './../../package.json'
88import https from 'https' ;
9+ import logger from './logger.js' ;
910
1011export default class httpClient {
1112 axiosInstance : AxiosInstance ;
@@ -142,7 +143,12 @@ export default class httpClient {
142143 const response = await this . request ( {
143144 url : '/token/verify' ,
144145 method : 'GET' ,
146+ headers :{
147+ userName : env . LT_USERNAME ,
148+ accessKey : env . LT_ACCESS_KEY
149+ }
145150 } , log ) ;
151+ logger . debug ( `Response from auth is ${ JSON . stringify ( response ) } ` ) ;
146152 if ( response && response . projectToken ) {
147153 this . projectToken = response . projectToken ;
148154 env . PROJECT_TOKEN = response . projectToken ;
@@ -157,8 +163,8 @@ export default class httpClient {
157163
158164 async authExec ( ctx : Context , log : Logger , env : Env ) : Promise < { authResult : number , orgId : number , userId : number } > {
159165 let authResult = 1 ;
160- let userName = '' ;
161- let passWord = '' ;
166+ let userName = ctx . env . LT_USERNAME ;
167+ let passWord = ctx . env . LT_ACCESS_KEY ;
162168 if ( ctx . config . tunnel ) {
163169 if ( ctx . config . tunnel ?. user && ctx . config . tunnel ?. key ) {
164170 userName = ctx . config . tunnel . user
@@ -179,6 +185,7 @@ export default class httpClient {
179185 accessKey : passWord
180186 }
181187 } , log ) ;
188+ ctx . log . debug ( `Response from authExec is ${ JSON . stringify ( response ) } ` ) ;
182189 if ( response && response . projectToken ) {
183190 let orgId = 0 ;
184191 let userId = 0 ;
@@ -202,7 +209,7 @@ export default class httpClient {
202209 }
203210 }
204211
205- createBuild ( git : Git , config : any , log : Logger , buildName : string , isStartExec : boolean , smartGit : boolean , markBaseline : boolean , baselineBuild : string , scheduled ?: string ) {
212+ createBuild ( git : Git , config : any , log : Logger , buildName : string , isStartExec : boolean , smartGit : boolean , markBaseline : boolean , baselineBuild : string , scheduled ?: string , userName ?: string , accessKey ?: string ) {
206213 return this . request ( {
207214 url : '/build' ,
208215 method : 'POST' ,
@@ -215,7 +222,9 @@ export default class httpClient {
215222 smartGit,
216223 markBaseline,
217224 baselineBuild,
218- scheduled
225+ scheduled,
226+ userName,
227+ accessKey
219228 }
220229 } , log )
221230 }
0 commit comments