-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform named import of Credentials (#778)
- Loading branch information
Showing
23 changed files
with
114 additions
and
13 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 | ||
--- | ||
|
||
Transform named import of Credentials |
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/credentials/chain.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import AWS from "aws-sdk"; | ||
import { CredentialProviderChain } from "aws-sdk"; | ||
|
||
new AWS.CredentialProviderChain(providers); | ||
new CredentialProviderChain(providers); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/cognito-identity.input.ts
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,3 @@ | ||
import { CognitoIdentityCredentials } from "aws-sdk"; | ||
|
||
new CognitoIdentityCredentials(); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/cognito-identity.output.ts
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,6 @@ | ||
import { fromCognitoIdentity } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromCognitoIdentity(); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/ec2-metadata.input.ts
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,3 @@ | ||
import { EC2MetadataCredentials } from "aws-sdk"; | ||
|
||
new EC2MetadataCredentials(); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/ec2-metadata.output.ts
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,6 @@ | ||
import { fromInstanceMetadata } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromInstanceMetadata(); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/ecs.input.ts
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,3 @@ | ||
import { ECSCredentials } from "aws-sdk"; | ||
|
||
new ECSCredentials(); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/ecs.output.ts
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,6 @@ | ||
import { fromContainerMetadata } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromContainerMetadata(); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/env.input.ts
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,3 @@ | ||
import { EnvironmentCredentials } from "aws-sdk"; | ||
|
||
new EnvironmentCredentials("AWS"); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/env.output.ts
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,6 @@ | ||
import { fromEnv } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromEnv("AWS"); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/ini.input.ts
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,3 @@ | ||
import { SharedIniFileCredentials } from "aws-sdk"; | ||
|
||
new SharedIniFileCredentials({ profile: "profile-name" }); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/ini.output.ts
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,6 @@ | ||
import { fromIni } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromIni({ profile: "profile-name" }); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/process.input.ts
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,3 @@ | ||
import { ProcessCredentials } from "aws-sdk"; | ||
|
||
new ProcessCredentials({ profile: "profile-name" }); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/process.output.ts
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,6 @@ | ||
import { fromProcess } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromProcess({ profile: "profile-name" }); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/remote.input.ts
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,3 @@ | ||
import { RemoteCredentials } from "aws-sdk"; | ||
|
||
new RemoteCredentials(); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/remote.output.ts
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,6 @@ | ||
import { fromContainerMetadata } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromContainerMetadata(); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/sso.input.ts
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,3 @@ | ||
import { SsoCredentials } from "aws-sdk"; | ||
|
||
new SsoCredentials({ profile: "profile-name" }); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/sso.output.ts
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,6 @@ | ||
import { fromSSO } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromSSO({ profile: "profile-name" }); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/token-file.input.ts
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,3 @@ | ||
import { TokenFileWebIdentityCredentials } from "aws-sdk"; | ||
|
||
new TokenFileWebIdentityCredentials(); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/token-file.output.ts
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,6 @@ | ||
import { fromTokenFile } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromTokenFile(); |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/credentials/token-web.input.ts
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,3 @@ | ||
import { WebIdentityCredentials } from "aws-sdk"; | ||
|
||
new WebIdentityCredentials(); |
6 changes: 6 additions & 0 deletions
6
src/transforms/v2-to-v3/__fixtures__/credentials/token-web.output.ts
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,6 @@ | ||
import { fromWebToken } from "@aws-sdk/credential-providers"; | ||
|
||
// JS SDK v3 switched credential providers from classes to functions. | ||
// This is the closest approximation from codemod of what your application needs. | ||
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers | ||
fromWebToken(); |
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