Skip to content

Commit

Permalink
Use k6-utils' uuidv4 function in SecretsManagerClient
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Jul 29, 2024
1 parent d1c99a2 commit f2b00ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/internal/secrets-manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JSONArray, JSONObject } from 'k6'
import http, { RefinedResponse, ResponseType } from 'k6/http'
import { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'

import { v4 as uuidv4 } from 'uuid'
import { AWSClient } from './client'
import { AWSConfig } from './config'
import { AMZ_TARGET_HEADER } from './constants'
Expand Down Expand Up @@ -133,7 +133,7 @@ export class SecretsManagerClient extends AWSClient {
versionID?: string,
tags?: Array<object>
): Promise<Secret> {
versionID = versionID || uuidv4()
versionID = versionID ?? uuidv4(true)

const signedRequest = this.signature.sign(
{
Expand Down Expand Up @@ -179,7 +179,7 @@ export class SecretsManagerClient extends AWSClient {
* @throws {InvalidSignatureError}
*/
async putSecretValue(id: string, secret: string, versionID?: string): Promise<Secret> {
versionID = versionID || uuidv4()
versionID = versionID ?? uuidv4(true)

const signedRequest = this.signature.sign(
{
Expand Down

0 comments on commit f2b00ee

Please sign in to comment.