diff --git a/src/internal/secrets-manager.ts b/src/internal/secrets-manager.ts index b84a24d..5f6abae 100644 --- a/src/internal/secrets-manager.ts +++ b/src/internal/secrets-manager.ts @@ -1,7 +1,7 @@ import { JSONArray, JSONObject } from 'k6' import http, { RefinedResponse, ResponseType } from 'k6/http' +import { crypto } from 'k6/experimental/webcrypto' -import { v4 as uuidv4 } from 'uuid' import { AWSClient } from './client' import { AWSConfig } from './config' import { AMZ_TARGET_HEADER } from './constants' @@ -133,7 +133,7 @@ export class SecretsManagerClient extends AWSClient { versionID?: string, tags?: Array ): Promise { - versionID = versionID || uuidv4() + versionID = versionID ?? crypto.randomUUID() const signedRequest = this.signature.sign( { @@ -179,7 +179,7 @@ export class SecretsManagerClient extends AWSClient { * @throws {InvalidSignatureError} */ async putSecretValue(id: string, secret: string, versionID?: string): Promise { - versionID = versionID || uuidv4() + versionID = versionID ?? crypto.randomUUID() const signedRequest = this.signature.sign( {