Skip to content

Commit

Permalink
fix: proxyConfig options and defaults
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tegefaulkes committed Mar 29, 2022
1 parent 4402287 commit db3b913
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/PolykeyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ class PolykeyAgent {
proxyConfig?: {
authToken?: string;
connConnectTime?: number;
connTimeoutTime?: number;
connPingIntervalTime?: number;
connKeepAliveTimeoutTime?: number;
connEndTime?: number;
connPunchIntervalTime?: number;
connKeepAliveIntervalTime?: number;
};
nodeConnectionManagerConfig?: {
connConnectTime?: number;
Expand Down
4 changes: 2 additions & 2 deletions src/bin/agent/CommandStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CommandStart extends CommandPolykey {
this.addOption(binOptions.clientPort);
this.addOption(binOptions.proxyHost);
this.addOption(binOptions.proxyPort);
this.addOption(binOptions.connTimeoutTime);
this.addOption(binOptions.connConnectTime);
this.addOption(binOptions.seedNodes);
this.addOption(binOptions.network);
this.addOption(binOptions.workers);
Expand Down Expand Up @@ -96,7 +96,7 @@ class CommandStart extends CommandPolykey {
recoveryCode: recoveryCodeIn,
},
proxyConfig: {
connTimeoutTime: options.connTimeoutTime,
connConnectTime: options.connectionTimeout,
},
networkConfig: {
clientHost: options.clientHost,
Expand Down
6 changes: 3 additions & 3 deletions src/bin/utils/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ const proxyPort = new commander.Option('-pp, --proxy-port <port>', 'Proxy Port')
.argParser(binParsers.parsePort)
.default(config.defaults.networkConfig.proxyPort);

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

const passwordFile = new commander.Option(
'-pf, --password-file <path>',
Expand Down Expand Up @@ -164,7 +164,7 @@ export {
clientPort,
proxyHost,
proxyPort,
connTimeoutTime,
connConnectTime,
recoveryCodeFile,
passwordFile,
passwordNewFile,
Expand Down
6 changes: 4 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ const config = {
},
proxyConfig: {
connConnectTime: 20000,
connTimeoutTime: 20000,
connPingIntervalTime: 1000,
connKeepAliveTimeoutTime: 20000,
connEndTime: 1000,
connPunchIntervalTime: 1000,
connKeepAliveIntervalTime: 1000,
},
nodeConnectionManagerConfig: {
connConnectTime: 20000,
Expand Down
2 changes: 1 addition & 1 deletion tests/bin/keys/certchain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ describe('certchain', () => {
));
expect(exitCode).toBe(0);
const certChainStatus = JSON.parse(stdout).rootCertChainPem;
expect(certChainCommand).toBe(certChainStatus);
expect(certChainCommand.rootPublicKeyPem).toBe(certChainStatus);
});
});

0 comments on commit db3b913

Please sign in to comment.