Skip to content

Commit 0af18e9

Browse files
committed
kms-keyring-node
1 parent 542cc0f commit 0af18e9

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

modules/kms-keyring-node/src/kms_keyring_node.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*/
1515

1616
import {
17-
KmsKeyring,
17+
KmsKeyringClass,
18+
KeyRingConstructible, // eslint-disable-line no-unused-vars
1819
KmsKeyringInput, // eslint-disable-line no-unused-vars
1920
KMSConstructible, // eslint-disable-line no-unused-vars
2021
KmsClientSupplier, // eslint-disable-line no-unused-vars
@@ -25,7 +26,7 @@ import {
2526
} from '@aws-crypto/kms-keyring'
2627
import {
2728
NodeAlgorithmSuite, // eslint-disable-line no-unused-vars
28-
immutableClass, NodeKeyring
29+
immutableClass, KeyringNode
2930
} from '@aws-crypto/material-management-node'
3031
import { KMS, KMSConfiguration } from '@aws-sdk/client-kms-node' // eslint-disable-line no-unused-vars
3132
const getKmsClient = getClient(KMS)
@@ -35,19 +36,14 @@ export type KmsKeyringNodeInput = Partial<KmsKeyringInput<KMS>>
3536
export type KMSNodeConstructible = KMSConstructible<KMS, KMSConfiguration>
3637
export type KmsNodeClientSupplier = KmsClientSupplier<KMS>
3738

38-
export class KmsKeyringNode extends KmsKeyring<NodeAlgorithmSuite, KMS> {
39+
export class KmsKeyringNode extends KmsKeyringClass(KeyringNode as KeyRingConstructible<NodeAlgorithmSuite>) {
3940
constructor ({
4041
clientProvider = cacheKmsClients,
41-
kmsKeys,
42-
generatorKmsKey,
42+
keyIds,
43+
generatorKeyId,
4344
grantTokens
4445
}: KmsKeyringNodeInput = {}) {
45-
super({ clientProvider, kmsKeys, generatorKmsKey, grantTokens })
46-
}
47-
48-
[Symbol.hasInstance] (obj: any) {
49-
return obj instanceof NodeKeyring ||
50-
Function.prototype[Symbol.hasInstance].call(this, obj)
46+
super({ clientProvider, keyIds, generatorKeyId, grantTokens })
5147
}
5248
}
5349
immutableClass(KmsKeyringNode)

modules/kms-keyring-node/test/kms_keyring_node.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
import { expect } from 'chai'
1919
import 'mocha'
2020
import { KmsKeyringNode } from '../src/kms_keyring_node'
21-
import { NodeKeyring } from '@aws-crypto/material-management-node'
21+
import { KeyringNode } from '@aws-crypto/material-management-node'
2222

2323
describe('KmsKeyringNode', () => {
2424
it('instanceof NodeKeyring', () => {
2525
const test = new KmsKeyringNode()
26-
expect(test instanceof NodeKeyring).to.equal(true)
26+
expect(test instanceof KeyringNode).to.equal(true)
2727
})
2828
})

0 commit comments

Comments
 (0)