Skip to content

Commit 2ae7f90

Browse files
authored
add support for KMS Alias ARN (#19)
1 parent 8bfdc3c commit 2ae7f90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/decode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ async function getAwsSessionForEntry(entry: {
310310
}): Promise<KMSClient> {
311311
// extract the region from the ARN
312312
// arn:aws:kms:{REGION}:...
313-
const res = entry.arn.match(/^arn:aws:kms:(.+):([0-9]+):key\/(.+)$/);
313+
const res = entry.arn.match(/^arn:aws:kms:(.+):([0-9]+):(key|alias)\/(.+)$/);
314314

315-
if (!res || res.length < 4) {
315+
if (!res || res.length < 5) {
316316
throw new SopsError(`Invalid ARN ${entry.arn} insufficent components`);
317317
}
318318

0 commit comments

Comments
 (0)