-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding privateKeyPath back to PolykeyAgent #600
Conversation
b02eac1
to
6109fa6
Compare
@addievo I don't think you lintfixed this? |
|
privateKeyPath: string; | ||
privateKey: PrivateKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The privateKey: PrivateKey
should be using a more open type, instead the opaque type because of PolykeyAgent
taking parameters from outside world.
So if you want to keep this then you should be using privateKey: Buffer
.
Also privateKey
should be moved up top.
privateKey: Buffer;
privateKeyPath: string;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 options aren't even being used, if these 2 options are to be used, they should be passed to the KeyRing.createKeyRing
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addievo link the new PR to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PolykeyAgent.start
should be taking DeepPartial
of options, and the options need to keys: { recoveryCode; privateKey; privateKeyPath; }
.
And also in the KeyRing.createKeyRing
and KeyRing.start
methods, these need to receive those options if you want to make them useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the PolykeyAgentOptions
needs to match:
} & ( // eslint-disable-next-line @typescript-eslint/ban-types
| {}
| {
recoveryCode: RecoveryCode;
}
| {
privateKey: PrivateKey;
}
| {
privateKeyPath: string;
}
Which ensures mutually independent options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So:
keys: ({} | { recoveryCode: string; } | { privateKey: Buffer } | { privateKeyPath: string })
And PolykeyAgent.start
should take this.
Description
In
#582
Changes were made to
PolykeyAgentOptions
and it was flattened to remove dependency on types, this resulted inprivateKeyPath
being removed fromPolykeyAgentOptions
which is causing issues inPolykey-CLI
.This PR aims to add it back to PolykeyAgentOptions.
Tasks
privateKey
andprivateKeyPath
back toPolykeyAgentOptions
.Final checklist