Skip to content

Commit 1b62bf3

Browse files
committed
docs(credential-providers): add terminology section
1 parent ca728e0 commit 1b62bf3

File tree

1 file changed

+47
-21
lines changed

1 file changed

+47
-21
lines changed

packages/credential-providers/README.md

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,34 @@
33
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-providers/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-providers)
44
[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-providers.svg)](https://www.npmjs.com/package/@aws-sdk/credential-providers)
55

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
734

835
An `AwsCredentialIdentityProvider` is any function that matches the signature:
936

@@ -32,27 +59,26 @@ An `AwsCredentialIdentityProvider` is any function that matches the signature:
3259
}>;
3360
```
3461

35-
# Table of Contents
62+
#### Outer and inner clients
3663

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.
5682

5783
## `fromCognitoIdentity()`
5884

0 commit comments

Comments
 (0)