@@ -329,7 +329,7 @@ export class NodeCommand extends BaseCommand {
329
329
* @return a list of subtasks
330
330
* @private
331
331
*/
332
- // TODO: move to KeyManager and remove List2 functionality
332
+ // TODO: move to KeyManager
333
333
taskGenerateGossipKeys ( keyFormat , nodeIds , keysDir , curDate = new Date ( ) , allNodeIds = null ) {
334
334
allNodeIds = allNodeIds || nodeIds
335
335
if ( ! Array . isArray ( nodeIds ) || ! nodeIds . every ( ( nodeId ) => typeof nodeId === 'string' ) ) {
@@ -434,8 +434,8 @@ export class NodeCommand extends BaseCommand {
434
434
* @return return a list of subtasks
435
435
* @private
436
436
*/
437
- // TODO move to KeyManager and remove List2 functionality
438
- _nodeTlsKeyTaskList ( nodeIds , keysDir , curDate = new Date ( ) ) {
437
+ // TODO move to KeyManager
438
+ taskGenerateTLSKeys ( nodeIds , keysDir , curDate = new Date ( ) ) {
439
439
// check if nodeIds is an array of strings
440
440
if ( ! Array . isArray ( nodeIds ) || ! nodeIds . every ( ( nodeId ) => typeof nodeId === 'string' ) ) {
441
441
throw new FullstackTestingError ( 'nodeIds must be an array of strings' )
@@ -466,8 +466,8 @@ export class NodeCommand extends BaseCommand {
466
466
return subTasks
467
467
}
468
468
469
- // TODO: move to KeyManager, rename copyNodeKeysToStaging
470
- async _copyNodeKeys ( nodeKey , destDir ) {
469
+ // TODO: move to KeyManager
470
+ async copyNodeKeysToStaging ( nodeKey , destDir ) {
471
471
for ( const keyFile of [ nodeKey . privateKeyFile , nodeKey . certificateFile ] ) {
472
472
if ( ! fs . existsSync ( keyFile ) ) {
473
473
throw new FullstackTestingError ( `file (${ keyFile } ) is missing` )
@@ -781,7 +781,7 @@ export class NodeCommand extends BaseCommand {
781
781
title : 'Generate gRPC TLS keys' ,
782
782
task : async ( ctx , parentTask ) => {
783
783
const config = ctx . config
784
- const subTasks = self . _nodeTlsKeyTaskList ( config . nodeIds , config . keysDir , config . curDate )
784
+ const subTasks = self . taskGenerateTLSKeys ( config . nodeIds , config . keysDir , config . curDate )
785
785
// set up the sub-tasks
786
786
return parentTask . newListr ( subTasks , {
787
787
concurrent : false ,
@@ -811,7 +811,7 @@ export class NodeCommand extends BaseCommand {
811
811
for ( const nodeId of ctx . config . nodeIds ) {
812
812
const config = /** @type {NodeSetupConfigClass } **/ ctx . config
813
813
const tlsKeyFiles = self . keyManager . prepareTLSKeyFilePaths ( nodeId , config . keysDir )
814
- await self . _copyNodeKeys ( tlsKeyFiles , config . stagingKeysDir )
814
+ await self . copyNodeKeysToStaging ( tlsKeyFiles , config . stagingKeysDir )
815
815
}
816
816
}
817
817
}
@@ -1157,7 +1157,7 @@ export class NodeCommand extends BaseCommand {
1157
1157
title : 'Generate gRPC TLS keys' ,
1158
1158
task : async ( ctx , parentTask ) => {
1159
1159
const config = ctx . config
1160
- const subTasks = self . _nodeTlsKeyTaskList ( config . nodeIds , config . keysDir , config . curDate )
1160
+ const subTasks = self . taskGenerateTLSKeys ( config . nodeIds , config . keysDir , config . curDate )
1161
1161
// set up the sub-tasks
1162
1162
return parentTask . newListr ( subTasks , {
1163
1163
concurrent : true ,
@@ -1621,7 +1621,7 @@ export class NodeCommand extends BaseCommand {
1621
1621
title : 'Generate gRPC TLS key' ,
1622
1622
task : async ( ctx , parentTask ) => {
1623
1623
const config = /** @type {NodeAddConfigClass } **/ ctx . config
1624
- const subTasks = self . _nodeTlsKeyTaskList ( [ config . nodeId ] , config . keysDir , config . curDate )
1624
+ const subTasks = self . taskGenerateTLSKeys ( [ config . nodeId ] , config . keysDir , config . curDate )
1625
1625
// set up the sub-tasks
1626
1626
return parentTask . newListr ( subTasks , {
1627
1627
concurrent : false ,
@@ -1898,7 +1898,7 @@ export class NodeCommand extends BaseCommand {
1898
1898
const config = /** @type {NodeAddConfigClass } **/ ctx . config
1899
1899
for ( const nodeId of config . allNodeIds ) {
1900
1900
const tlsKeyFiles = self . keyManager . prepareTLSKeyFilePaths ( nodeId , config . keysDir )
1901
- await self . _copyNodeKeys ( tlsKeyFiles , config . stagingKeysDir )
1901
+ await self . copyNodeKeysToStaging ( tlsKeyFiles , config . stagingKeysDir )
1902
1902
}
1903
1903
}
1904
1904
}
@@ -2161,11 +2161,11 @@ export class NodeCommand extends BaseCommand {
2161
2161
switch ( keyFormat ) {
2162
2162
case constants . KEY_FORMAT_PEM : {
2163
2163
const signingKeyFiles = this . keyManager . prepareNodeKeyFilePaths ( nodeId , keysDir , constants . SIGNING_KEY_PREFIX )
2164
- await this . _copyNodeKeys ( signingKeyFiles , stagingKeysDir )
2164
+ await this . copyNodeKeysToStaging ( signingKeyFiles , stagingKeysDir )
2165
2165
2166
2166
// generate missing agreement keys
2167
2167
const agreementKeyFiles = this . keyManager . prepareNodeKeyFilePaths ( nodeId , keysDir , constants . AGREEMENT_KEY_PREFIX )
2168
- await this . _copyNodeKeys ( agreementKeyFiles , stagingKeysDir )
2168
+ await this . copyNodeKeysToStaging ( agreementKeyFiles , stagingKeysDir )
2169
2169
break
2170
2170
}
2171
2171
0 commit comments