-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Insert credentials at the first occurrence of a security credential k…
…ey (#701)
- Loading branch information
Showing
4 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"aws-sdk-js-codemod": patch | ||
--- | ||
|
||
Insert credentials at the first occurrence of a security credential key |
36 changes: 36 additions & 0 deletions
36
src/transforms/v2-to-v3/__fixtures__/config/credentials.order.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
const credsAfter = new AWS.Config({ | ||
logger: console, | ||
region: "us-east-1", | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET" | ||
}); | ||
|
||
const credsBefore = new AWS.Config({ | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET", | ||
logger: console, | ||
region: "us-east-1", | ||
}); | ||
|
||
const credsInBetween = new AWS.Config({ | ||
logger: console, | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET", | ||
region: "us-east-1", | ||
}); | ||
|
||
const credsDispersedBefore = new AWS.Config({ | ||
accessKeyId: "KEY", | ||
logger: console, | ||
secretAccessKey: "SECRET", | ||
region: "us-east-1" | ||
}); | ||
|
||
const credsDispersedAfter = new AWS.Config({ | ||
logger: console, | ||
accessKeyId: "KEY", | ||
region: "us-east-1", | ||
secretAccessKey: "SECRET", | ||
}); |
51 changes: 51 additions & 0 deletions
51
src/transforms/v2-to-v3/__fixtures__/config/credentials.order.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const credsAfter = { | ||
logger: console, | ||
region: "us-east-1", | ||
|
||
credentials: { | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET" | ||
} | ||
}; | ||
|
||
const credsBefore = { | ||
credentials: { | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET" | ||
}, | ||
|
||
logger: console, | ||
region: "us-east-1" | ||
}; | ||
|
||
const credsInBetween = { | ||
logger: console, | ||
|
||
credentials: { | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET" | ||
}, | ||
|
||
region: "us-east-1" | ||
}; | ||
|
||
const credsDispersedBefore = { | ||
credentials: { | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET" | ||
}, | ||
|
||
logger: console, | ||
region: "us-east-1" | ||
}; | ||
|
||
const credsDispersedAfter = { | ||
logger: console, | ||
|
||
credentials: { | ||
accessKeyId: "KEY", | ||
secretAccessKey: "SECRET" | ||
}, | ||
|
||
region: "us-east-1" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters