Skip to content

Commit

Permalink
Merge pull request #48 from DavidTanner/addressKmsIssue
Browse files Browse the repository at this point in the history
fix: Use shared KMS client.
  • Loading branch information
DavidTanner authored Oct 17, 2023
2 parents 32f5329 + 76bb527 commit 4c33213
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class CredStash {
}: PutSecret,
) {
const version = sanitizeVersion(origVersion, 1);
const keyService = new KeyService(new KMSClient({}), kmsKey, context);
const keyService = new KeyService(this.#kmsClient, kmsKey, context);
const sealed = await sealAesCtrLegacy(keyService, secret, digest);
const data: SecretRecord = Object.assign({ name, version }, sealed);
try {
Expand Down Expand Up @@ -160,7 +160,7 @@ export class CredStash {
}: GetSecret,
) {
const version = sanitizeVersion(origVersion);
const keyService = new KeyService(new KMSClient({}), kmsKey, context);
const keyService = new KeyService(this.#kmsClient, kmsKey, context);

let record: SecretRecord;
if (version) {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/dynamoDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import debugFn from 'debug';
import { pause } from './utils';
import {
NameAndVersionOpts,
NameOpts, Opts,
NameOpts,
Opts,
QueryOpts,
SecretRecord,
} from '../types';
Expand Down

0 comments on commit 4c33213

Please sign in to comment.