|
3 | 3 | [](https://www.npmjs.com/package/@aws-sdk/credential-providers) |
4 | 4 | [](https://www.npmjs.com/package/@aws-sdk/credential-providers) |
5 | 5 |
|
6 | | -A collection of all credential providers, with default clients. |
| 6 | +A collection of all credential providers. |
| 7 | + |
| 8 | +# Table of Contents |
| 9 | + |
| 10 | +1. [Terminology](#terminology) |
| 11 | +1. [From Cognito Identity](#fromcognitoidentity) |
| 12 | +1. [From Cognito Identity Pool](#fromcognitoidentitypool) |
| 13 | +1. [From Temporary Credentials](#fromtemporarycredentials) |
| 14 | +1. [From Web Token](#fromwebtoken) |
| 15 | + 1. [Examples](#examples) |
| 16 | +1. [From Token File](#fromtokenfile) |
| 17 | +1. [From Instance and Container Metadata Service](#fromcontainermetadata-and-frominstancemetadata) |
| 18 | +1. [From HTTP(S)](#fromhttp) |
| 19 | +1. [From Shared INI files](#fromini) |
| 20 | + 1. [Sample Files](#sample-files) |
| 21 | +1. [From Environmental Variables](#fromenv) |
| 22 | +1. [From Credential Process](#fromprocess) |
| 23 | + 1. [Sample files](#sample-files-1) |
| 24 | +1. [From Single Sign-On Service](#fromsso) |
| 25 | + 1. [Supported Configuration](#supported-configuration) |
| 26 | + 1. [SSO login with AWS CLI](#sso-login-with-the-aws-cli) |
| 27 | + 1. [Sample Files](#sample-files-2) |
| 28 | +1. [From Node.js default credentials provider chain](#fromNodeProviderChain) |
| 29 | +1. [Creating a custom credentials chain](#createCredentialChain) |
| 30 | + |
| 31 | +## Terminology |
| 32 | + |
| 33 | +#### Credentials Provider |
7 | 34 |
|
8 | 35 | An `AwsCredentialIdentityProvider` is any function that matches the signature: |
9 | 36 |
|
@@ -32,27 +59,26 @@ An `AwsCredentialIdentityProvider` is any function that matches the signature: |
32 | 59 | }>; |
33 | 60 | ``` |
34 | 61 |
|
35 | | -# Table of Contents |
| 62 | +#### Outer and inner clients |
36 | 63 |
|
37 | | -1. [From Cognito Identity](#fromcognitoidentity) |
38 | | -1. [From Cognito Identity Pool](#fromcognitoidentitypool) |
39 | | -1. [From Temporary Credentials](#fromtemporarycredentials) |
40 | | -1. [From Web Token](#fromwebtoken) |
41 | | - 1. [Examples](#examples) |
42 | | -1. [From Token File](#fromtokenfile) |
43 | | -1. [From Instance and Container Metadata Service](#fromcontainermetadata-and-frominstancemetadata) |
44 | | -1. [From HTTP(S)](#fromhttp) |
45 | | -1. [From Shared INI files](#fromini) |
46 | | - 1. [Sample Files](#sample-files) |
47 | | -1. [From Environmental Variables](#fromenv) |
48 | | -1. [From Credential Process](#fromprocess) |
49 | | - 1. [Sample files](#sample-files-1) |
50 | | -1. [From Single Sign-On Service](#fromsso) |
51 | | - 1. [Supported Configuration](#supported-configuration) |
52 | | - 1. [SSO login with AWS CLI](#sso-login-with-the-aws-cli) |
53 | | - 1. [Sample Files](#sample-files-2) |
54 | | -1. [From Node.js default credentials provider chain](#fromNodeProviderChain) |
55 | | -1. [Creating a custom credentials chain](#createCredentialChain) |
| 64 | +A "parent/outer/upper/caller" (position), or "data" (purpose) client refers |
| 65 | +to a client being initialized explicitly by the SDK user. |
| 66 | + |
| 67 | +An "inner" (position), or "credentials" (purpose) client |
| 68 | +refers to a client being initialized by the SDK in the course |
| 69 | +of retrieving credentials. Several AWS SDK credentials providers |
| 70 | +make use of inner clients such as Cognito, SSO, STS, and SSO-OIDC. |
| 71 | + |
| 72 | +```ts |
| 73 | +// Example: outer client and inner client |
| 74 | +const s3 = new S3Client({ |
| 75 | + credentials: fromIni(), |
| 76 | +}); |
| 77 | +``` |
| 78 | + |
| 79 | +In the above example, `S3Client` is the outer client, and |
| 80 | +if the `fromIni` credentials provider uses STS::AssumeRole, the |
| 81 | +`STSClient` initialized by the SDK is the inner client. |
56 | 82 |
|
57 | 83 | ## `fromCognitoIdentity()` |
58 | 84 |
|
|
0 commit comments