File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
lib/interface/cli/helpers Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,23 @@ const wrapHandler = (handler, requiresAuthentication) => {
26
26
}
27
27
28
28
if ( process . env . NODE_ENV !== 'test' ) {
29
- const { url, token : apiKey } = currentContext || { } ;
30
- sdk . configure ( {
29
+ const { url, token } = currentContext || { } ;
30
+ const sdkConfig = {
31
31
url,
32
- apiKey,
33
32
cache : {
34
33
disableCache : ! ! ( process . env . DISABLE_SDK_CACHE || process . argv . includes ( '--disable-cache' ) ) ,
35
34
forceRefresh : ! ! ( process . env . FORCE_REFRESH_SDK_CACHE || process . argv . includes ( '--force-refresh-cache' ) ) ,
36
35
} ,
37
36
request : {
38
37
...config . request ,
39
38
} ,
40
- } ) ;
39
+ } ;
40
+
41
+ // todo: move to openapi.json
42
+ const tokenKey = currentContext . type === 'APIKey' ? 'apiKey' : 'accessToken' ;
43
+ sdkConfig [ tokenKey ] = token ;
44
+
45
+ sdk . configure ( sdkConfig ) ;
41
46
}
42
47
43
48
if ( ! argv . watch ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.15.0 " ,
3
+ "version" : " 0.15.1 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
34
34
"cf-errors" : " ^0.1.11" ,
35
35
"chalk" : " ^1.1.3" ,
36
36
"cli-progress" : " ^1.6.1" ,
37
- "codefresh-sdk" : " ^0.2.6 " ,
37
+ "codefresh-sdk" : " ^0.2.7 " ,
38
38
"colors" : " ^1.1.2" ,
39
39
"columnify" : " ^1.5.4" ,
40
40
"compare-versions" : " ^3.4.0" ,
Original file line number Diff line number Diff line change @@ -911,10 +911,10 @@ code-point-at@^1.0.0:
911
911
version "1.1.0"
912
912
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
913
913
914
- codefresh-sdk@^0.2.6 :
915
- version "0.2.6 "
916
- resolved "https://registry.yarnpkg.com/codefresh-sdk/-/codefresh-sdk-0.2.6 .tgz#3dbf2f95f55938fbb37f1556f1cc7c454e771db1 "
917
- integrity sha512-LJsj0U03PNX/S9o40J0cy8HoCMNSmHByMXnWu/GiJYOCTQqIdZVkyH7jFfF1G8rzAgWYuoTsneETXaZHZ+81qg ==
914
+ codefresh-sdk@^0.2.7 :
915
+ version "0.2.7 "
916
+ resolved "https://registry.yarnpkg.com/codefresh-sdk/-/codefresh-sdk-0.2.7 .tgz#03ac2eb890e213866527550792be77f7ebb2a34d "
917
+ integrity sha512-/My5NDlEQscg2GG6HDj+71ELeh6cdZOM/mc1Cn98tOKVyDJ4C4Jmh+/o3sXA+E29WcN+bCIqfGK/VUH5+eDrIQ ==
918
918
dependencies :
919
919
bluebird "^3.5.3"
920
920
cf-errors "^0.1.11"
You can’t perform that action at this time.
0 commit comments