Skip to content

Commit

Permalink
Rename SecretManager's secretID and secretString args to id and secret
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Apr 25, 2022
1 parent 37b30c7 commit 8ec8155
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/internal/secrets-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export class SecretsManagerClient extends AWSClient {
/**
* Retrieves a secret from Amazon Sercets Manager
*
* @param {string} secretID - The ARN or name of the secret to retrieve.
* @param {string} id - The ARN or name of the secret to retrieve.
* @returns {Secret} - returns the content of the fetched Secret object.
* @throws {SecretsManagerServiceError}
* @throws {InvalidSignatureError}
*/
getSecret(secretID: string): Secret | undefined {
const body = JSON.stringify({ SecretId: secretID })
getSecret(id: string): Secret | undefined {
const body = JSON.stringify({ SecretId: id })

// Ensure to include the desired 'Action' in the X-Amz-Target
// header field, as documented by the AWS API docs.
Expand Down Expand Up @@ -109,7 +109,7 @@ export class SecretsManagerClient extends AWSClient {
*
* @param {string} name - The name of the new secret.
* The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@
* @param {string} secretString - The text data to encrypt and store in this new version of the secret.
* @param {string} secret - The text data to encrypt and store in this new version of the secret.
* @param {string} description - The description of the secret.
* @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.
* As a default, if no versionID is provided, one will be created for you using the UUID v4
Expand All @@ -122,7 +122,7 @@ export class SecretsManagerClient extends AWSClient {
*/
createSecret(
name: string,
secretString: string,
secret: string,
description: string,
versionID?: string,
tags?: Array<Object>
Expand All @@ -132,7 +132,7 @@ export class SecretsManagerClient extends AWSClient {
const body = JSON.stringify({
Name: name,
Description: description,
SecretString: secretString,
SecretString: secret,
ClientRequestToken: versionID,
Tags: tags,
})
Expand Down Expand Up @@ -165,19 +165,19 @@ export class SecretsManagerClient extends AWSClient {
*
* Note that this method only support string-based values at the moment.
*
* @param {string} secretID - The ARN or name of the secret to update.
* @param {string} secretString - The text data to encrypt and store in this new version of the secret.
* @param {string} id - The ARN or name of the secret to update.
* @param {string} secret - The text data to encrypt and store in this new version of the secret.
* @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.
* As a default, if no versionID is provided, one will be created for you using the UUID v4
* @throws {SecretsManagerServiceError}
* @throws {InvalidSignatureError}
*/
putSecretValue(secretID: string, secretString: string, versionID?: string): Secret {
putSecretValue(id: string, secret: string, versionID?: string): Secret {
versionID = versionID || uuidv4()

const body = JSON.stringify({
SecretId: secretID,
SecretString: secretString,
SecretId: id,
SecretString: secret,
ClientRequestToken: versionID,
})

Expand Down Expand Up @@ -216,11 +216,11 @@ export class SecretsManagerClient extends AWSClient {
* @throws {InvalidSignatureError}
*/
deleteSecret(
secretID: string,
id: string,
{ recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }
) {
const payload: { [key: string]: string | boolean | number } = {
SecretId: secretID,
SecretId: id,
}

// noRecovery and recoveryWindow are exclusive parameters
Expand Down

0 comments on commit 8ec8155

Please sign in to comment.