Skip to content

Commit db3b913

Browse files
committed
fix: proxyConfig options and defaults
Fixed up `PolykeyAgent`'s proxyConfig to align with the `Proxy`'s parameters. Updated config defaults to align as well. Fixed up failing test in `certchain.test.st` as well.
1 parent 4402287 commit db3b913

5 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/PolykeyAgent.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ class PolykeyAgent {
103103
proxyConfig?: {
104104
authToken?: string;
105105
connConnectTime?: number;
106-
connTimeoutTime?: number;
107-
connPingIntervalTime?: number;
106+
connKeepAliveTimeoutTime?: number;
107+
connEndTime?: number;
108+
connPunchIntervalTime?: number;
109+
connKeepAliveIntervalTime?: number;
108110
};
109111
nodeConnectionManagerConfig?: {
110112
connConnectTime?: number;

src/bin/agent/CommandStart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CommandStart extends CommandPolykey {
2929
this.addOption(binOptions.clientPort);
3030
this.addOption(binOptions.proxyHost);
3131
this.addOption(binOptions.proxyPort);
32-
this.addOption(binOptions.connTimeoutTime);
32+
this.addOption(binOptions.connConnectTime);
3333
this.addOption(binOptions.seedNodes);
3434
this.addOption(binOptions.network);
3535
this.addOption(binOptions.workers);
@@ -96,7 +96,7 @@ class CommandStart extends CommandPolykey {
9696
recoveryCode: recoveryCodeIn,
9797
},
9898
proxyConfig: {
99-
connTimeoutTime: options.connTimeoutTime,
99+
connConnectTime: options.connectionTimeout,
100100
},
101101
networkConfig: {
102102
clientHost: options.clientHost,

src/bin/utils/options.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ const proxyPort = new commander.Option('-pp, --proxy-port <port>', 'Proxy Port')
8484
.argParser(binParsers.parsePort)
8585
.default(config.defaults.networkConfig.proxyPort);
8686

87-
const connTimeoutTime = new commander.Option(
87+
const connConnectTime = new commander.Option(
8888
'--connection-timeout <ms>',
8989
'Timeout value for connection establishment between nodes',
9090
)
9191
.argParser(binParsers.parseInteger)
92-
.default(config.defaults.proxyConfig.connTimeoutTime);
92+
.default(config.defaults.proxyConfig.connConnectTime);
9393

9494
const passwordFile = new commander.Option(
9595
'-pf, --password-file <path>',
@@ -164,7 +164,7 @@ export {
164164
clientPort,
165165
proxyHost,
166166
proxyPort,
167-
connTimeoutTime,
167+
connConnectTime,
168168
recoveryCodeFile,
169169
passwordFile,
170170
passwordNewFile,

src/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ const config = {
8484
},
8585
proxyConfig: {
8686
connConnectTime: 20000,
87-
connTimeoutTime: 20000,
88-
connPingIntervalTime: 1000,
87+
connKeepAliveTimeoutTime: 20000,
88+
connEndTime: 1000,
89+
connPunchIntervalTime: 1000,
90+
connKeepAliveIntervalTime: 1000,
8991
},
9092
nodeConnectionManagerConfig: {
9193
connConnectTime: 20000,

tests/bin/keys/certchain.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ describe('certchain', () => {
4040
));
4141
expect(exitCode).toBe(0);
4242
const certChainStatus = JSON.parse(stdout).rootCertChainPem;
43-
expect(certChainCommand).toBe(certChainStatus);
43+
expect(certChainCommand.rootPublicKeyPem).toBe(certChainStatus);
4444
});
4545
});

0 commit comments

Comments
 (0)