Skip to content

Commit b0239ae

Browse files
committed
fix: fixed up bootstrap options
[ci skip]
1 parent 2bdad81 commit b0239ae

File tree

2 files changed

+20
-38
lines changed

2 files changed

+20
-38
lines changed

src/PolykeyAgent.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import * as workersUtils from './workers/utils';
4141
import TaskManager from './tasks/TaskManager';
4242
import { serverManifest as clientServerManifest } from './client/handlers';
4343
import agentServerManifest from './nodes/agent/handlers';
44-
import {NodeAddress} from "./nodes/types";
4544

4645
/**
4746
* Optional configuration for `PolykeyAgent`.

src/bootstrap/utils.ts

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
11
import type { DeepPartial, FileSystem } from '../types';
2-
import type { RecoveryCode, Key, PrivateKey } from '../keys/types';
3-
import type { PasswordMemLimit, PasswordOpsLimit } from '../keys/types';
2+
import type { RecoveryCode, Key, KeysOptions } from '../keys/types';
43
import path from 'path';
54
import Logger from '@matrixai/logger';
65
import { DB } from '@matrixai/db';
7-
import * as bootstrapErrors from './errors';
86
import TaskManager from '../tasks/TaskManager';
9-
import { IdentitiesManager } from '../identities';
10-
import { SessionManager } from '../sessions';
11-
import { Status } from '../status';
12-
import { Schema } from '../schema';
13-
import { Sigchain } from '../sigchain';
14-
import { ACL } from '../acl';
15-
import { GestaltGraph } from '../gestalts';
16-
import { KeyRing, CertManager } from '../keys';
17-
import { NodeGraph, NodeManager } from '../nodes';
18-
import { VaultManager } from '../vaults';
19-
import { NotificationsManager } from '../notifications';
20-
import { mkdirExists } from '../utils';
7+
import IdentitiesManager from '../identities/IdentitiesManager';
8+
import SessionManager from '../sessions/SessionManager';
9+
import Status from '../status/Status';
10+
import Schema from '../schema/Schema';
11+
import Sigchain from '../sigchain/Sigchain';
12+
import ACL from '../acl/ACL';
13+
import GestaltGraph from '../gestalts/GestaltGraph';
14+
import KeyRing from '../keys/KeyRing';
15+
import CertManager from '../keys/CertManager';
16+
import * as keysUtils from '../keys/utils';
17+
import NodeGraph from '../nodes/NodeGraph';
18+
import NodeManager from '../nodes/NodeManager';
19+
import VaultManager from '../vaults/VaultManager';
20+
import NotificationsManager from '../notifications/NotificationsManager';
2121
import config from '../config';
2222
import * as utils from '../utils';
23-
import * as keysUtils from '../keys/utils';
2423
import * as errors from '../errors';
24+
import * as bootstrapErrors from './errors';
2525

2626
type BootstrapOptions = {
2727
nodePath: string;
28-
keys: {
29-
recoveryCode: RecoveryCode;
30-
privateKey: PrivateKey;
31-
privateKeyPath: string;
32-
passwordOpsLimit: PasswordOpsLimit;
33-
passwordMemLimit: PasswordMemLimit;
34-
strictMemoryLock: boolean;
35-
certDuration: number;
36-
};
28+
keys: KeysOptions;
3729
};
3830

3931
/**
@@ -68,7 +60,7 @@ async function bootstrapState({
6860
if (optionsDefaulted.nodePath == null) {
6961
throw new errors.ErrorUtilsNodePath();
7062
}
71-
await mkdirExists(fs, optionsDefaulted.nodePath);
63+
await utils.mkdirExists(fs, optionsDefaulted.nodePath);
7264
// Setup node path and sub paths
7365
const statusPath = path.join(
7466
optionsDefaulted.nodePath,
@@ -112,14 +104,7 @@ async function bootstrapState({
112104
const keyRing = await KeyRing.createKeyRing({
113105
keysPath,
114106
password,
115-
options: {
116-
recoveryCode: optionsDefaulted.recoveryCode,
117-
privateKey: optionsDefaulted.privateKey,
118-
privateKeyPath: optionsDefaulted.privateKeyPath,
119-
passwordOpsLimit: optionsDefaulted.passwordOpsLimit,
120-
passwordMemLimit: optionsDefaulted.passwordMemLimit,
121-
strictMemoryLock: optionsDefaulted.strictMemoryLock,
122-
},
107+
options: optionsDefaulted.keys,
123108
fs,
124109
logger: logger.getChild(KeyRing.name),
125110
fresh,
@@ -156,9 +141,7 @@ async function bootstrapState({
156141
keyRing,
157142
db,
158143
taskManager,
159-
options: {
160-
certDuration: optionsDefaulted.certDuration,
161-
},
144+
options: optionsDefaulted.keys,
162145
fresh,
163146
logger,
164147
});

0 commit comments

Comments
 (0)