File tree 4 files changed +41
-5
lines changed
cactus-api-client/src/main/typescript
typescript/generated/openapi/typescript-axios
cactus-plugin-consortium-manual/src/main/typescript
4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -130,9 +130,18 @@ export class ApiClient extends BaseAPI {
130
130
131
131
const randomNode = nodes [ randomIdx ] ;
132
132
133
- const configuration = new Configuration ( {
134
- basePath : randomNode . nodeApiHost ,
135
- } ) ;
133
+ const nodeToken = randomNode . token ;
134
+ let configuration : Configuration ;
135
+ if ( nodeToken ) {
136
+ configuration = new Configuration ( {
137
+ basePath : randomNode . nodeApiHost ,
138
+ baseOptions : { headers : { Authorization : `Bearer ${ nodeToken } ` } } ,
139
+ } ) ;
140
+ } else {
141
+ configuration = new Configuration ( {
142
+ basePath : randomNode . nodeApiHost ,
143
+ } ) ;
144
+ }
136
145
137
146
return new ApiClient ( configuration ) . extendWith ( ctor ) ;
138
147
}
Original file line number Diff line number Diff line change 344
344
"items" : {
345
345
"$ref" : " #/components/schemas/PluginInstanceId"
346
346
}
347
+ },
348
+ "token" : {
349
+ "type" : " string"
347
350
}
348
351
}
349
352
}
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ export interface CactusNode {
69
69
* @memberof CactusNode
70
70
*/
71
71
pluginInstanceIds : Array < string > ;
72
+ /**
73
+ *
74
+ * @type {string }
75
+ * @memberof CactusNode
76
+ */
77
+ token ?: string ;
72
78
}
73
79
/**
74
80
*
@@ -106,6 +112,12 @@ export interface CactusNodeAllOf {
106
112
* @memberof CactusNodeAllOf
107
113
*/
108
114
pluginInstanceIds : Array < string > ;
115
+ /**
116
+ *
117
+ * @type {string }
118
+ * @memberof CactusNodeAllOf
119
+ */
120
+ token ?: string ;
109
121
}
110
122
/**
111
123
* A Cactus node meta information
Original file line number Diff line number Diff line change @@ -218,8 +218,20 @@ export class PluginConsortiumManual
218
218
const nodes = this . repo . allNodes ;
219
219
220
220
const requests = nodes
221
- . map ( ( cnm ) => cnm . nodeApiHost )
222
- . map ( ( host ) => new Configuration ( { basePath : host } ) )
221
+ . map ( ( cnm ) => [ cnm . nodeApiHost , cnm . token ] )
222
+ . map ( function ( nodeData ) {
223
+ // if node has token, add to the configuration
224
+ if ( nodeData [ 1 ] ) {
225
+ return new Configuration ( {
226
+ basePath : nodeData [ 0 ] ,
227
+ baseOptions : {
228
+ headers : { Authorization : `Bearer ${ nodeData [ 1 ] } ` } ,
229
+ } ,
230
+ } ) ;
231
+ } else {
232
+ return new Configuration ( { basePath : nodeData [ 0 ] } ) ;
233
+ }
234
+ } )
223
235
. map ( ( configuration ) => new DefaultApi ( configuration ) )
224
236
. map ( ( apiClient ) => apiClient . getNodeJwsV1 ( ) ) ;
225
237
You can’t perform that action at this time.
0 commit comments