Skip to content

Commit 2259e92

Browse files
authored
docs(credential-providers): remove unnecessary STS header documentation (#7299)
1 parent 6681c80 commit 2259e92

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

packages/credential-providers/README.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -948,35 +948,6 @@ new S3({
948948
});
949949
```
950950

951-
## Add Custom Headers to STS assume-role calls
952-
953-
You can specify the plugins--groups of middleware, to inject to the STS client.
954-
For example, you can inject custom headers to each STS assume-role calls. It's
955-
available in [`fromTemporaryCredentials()`](#fromtemporarycredentials),
956-
[`fromWebToken()`](#fromwebtoken), [`fromTokenFile()`](#fromtokenfile), [`fromIni()`](#fromini).
957-
958-
Code example:
959-
960-
```javascript
961-
const addConfusedDeputyMiddleware = (next) => (args) => {
962-
args.request.headers["x-amz-source-account"] = account;
963-
args.request.headers["x-amz-source-arn"] = sourceArn;
964-
return next(args);
965-
};
966-
const confusedDeputyPlugin = {
967-
applyToStack: (stack) => {
968-
stack.add(addConfusedDeputyMiddleware, { step: "finalizeRequest" });
969-
},
970-
};
971-
const provider = fromTemporaryCredentials({
972-
// Required. Options passed to STS AssumeRole operation.
973-
params: {
974-
RoleArn: "arn:aws:iam::1234567890:role/Role",
975-
},
976-
clientPlugins: [confusedDeputyPlugin],
977-
});
978-
```
979-
980951
[getcredentialsforidentity_api]: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html
981952
[getid_api]: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetId.html
982953
[assumerole_api]: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html

0 commit comments

Comments
 (0)