-
Notifications
You must be signed in to change notification settings - Fork 63
initial commit kms-keyring #9
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
Conversation
# Conflicts: # modules/kms-keyring-node/package.json # modules/kms-keyring-node/src/index.ts
kms-keyring tests kms-keyring lint kms-keyring lint
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.
I see no obvious cryptographic problems.
a55afd3
|
||
constructor ({ clientProvider, generatorKeyId, keyIds = [], grantTokens, discovery }: KmsKeyringInput<Client>) { | ||
super() | ||
/* Precondition: This is an abstract class. (But TypeScript does not have a clean way to model 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.
NP/commenting: this is no longer an abstract class
/* Precondition: This is an abstract class. (But TypeScript does not have a clean way to model this) */ | ||
needs(this.constructor !== KmsKeyring, 'new KmsKeyring is not allowed') | ||
/* Precondition: A noop KmsKeyring is not allowed. You must explicitly set discovery or keyIds. */ | ||
needs(!!discovery !== !!(generatorKeyId || keyIds.length), 'Noop keyring is not allowed: Set a keyId or discovery') |
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.
This is a confusing error message if I make the inverse: not a no-op, but instead a discovery and also key IDs.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.