Skip to content

Commit bcc57fe

Browse files
cloudant-sdks-automationricellis
authored andcommitted
docs(generated): update auth information
Generated SDK source code using: - Generator version 3.105.1 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version 0e9362b
1 parent 759308e commit bcc57fe

1 file changed

Lines changed: 36 additions & 24 deletions

File tree

README.md

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ to avoid surprises.
2929
- [IAM API key authentication](#iam-api-key-authentication)
3030
- [IAM Trusted profile (container) authentication](#iam-trusted-profile-container-authentication)
3131
- [IAM Trusted profile (VPC) authentication](#iam-trusted-profile-vpc-authentication)
32+
- [IAM Trusted profile (assume identity) authentication](#iam-trusted-profile-assume-identity-authentication)
3233
- [Session cookie authentication](#session-cookie-authentication)
3334
+ [Authentication with external configuration](#authentication-with-external-configuration)
3435
+ [Programmatic authentication](#programmatic-authentication)
@@ -141,47 +142,41 @@ Examples for other configuration methods are available by following the provided
141142

142143

143144
This library requires credentials to authenticate with IBM Cloudant. These credentials may be:
144-
* IBM Cloud IAM credentials (can be used with authentication types `CONTAINER`, `VPC` and `IAM`)
145+
* IBM Cloud IAM credentials (with authentication types `CONTAINER`, `VPC`, `IAMASSUME` and `IAM`)
145146
* [IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai) user, service ID or trusted profile credentials
146-
that have been granted access to the IBM Cloud Cloudant resource instance.
147+
that have access granted to the IBM Cloud Cloudant resource instance.
147148
* [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated by the IBM Cloud Cloudant resource instance.
148-
* Username and password credentials (can be used with authentication types `COUCHDB_SESSION` and `BASIC`)
149+
* Username and password credentials (with authentication types `COUCHDB_SESSION` and `BASIC`)
149150
* [IBM Cloudant service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials) generated for an IBM Cloud Cloudant resource instance not configured as `IAM only`.
150-
* IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (i.e. username and password) for instances not in IBM Cloud.
151+
* IBM Cloudant [legacy credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication) (username and password) for instances not in IBM Cloud.
151152
* IBM Cloudant [legacy API keys](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#api-keys).
152153

153-
For other compatible APIs that are not Cloudant accounts (e.g. Apache CouchDB) non-IAM based authentication types
154-
must be used.
155-
156-
This table summarizes the available authentication types.
157-
The authentication types are listed in order of recommendation, preferably use the authentication type
158-
from the first row in the table that is compatible with your environment.
159-
160154
| Authentication type | Recommended for | `AUTH_TYPE` | Description |
161155
| --- | --- | --- | --- |
162-
| IAM Trusted Profiles compute resource ([container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant<BR>(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.<BR>Exchanges the CR token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
163-
| IAM Trusted Profiles compute resource ([VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant<BR>(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.<BR>Exchanges the identity token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
164-
| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
156+
| IAM Trusted Profiles (compute resource [container](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#container-authentication)) | Cloudant<BR>(SDK running in IBM Cloud IKS) | `CONTAINER` | Obtains a compute resource (CR) token from the container.<BR>Exchanges the CR token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
157+
| IAM Trusted Profiles (compute resource [VPC](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#vpc-instance-authentication)) | Cloudant<BR>(SDK running in IBM Cloud VPC) | `VPC` | Obtains an identity token from the VPC instance metadata.<BR>Exchanges the identity token for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
158+
| IAM Trusted Profiles ([assume identity](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-assume)) | Cloudant | `IAMASSUME` | Exchanges an IAM API key for an IAM `access_token` (same as `IAM` auth type).<BR>Uses that initial token to obtain a second `access_token` from IAM with the assumed identity information.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
159+
| [IAM API key](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#identity-and-access-management-iam-authentication-grant-type-apikey) | Cloudant | `IAM` | Exchanges an IAM API key for an IAM `access_token`.<BR>Adds an `Authorization: Bearer <access_token>` header to each HTTP request.<BR>Automatically renews the access token when needed. |
165160
| [Session cookie](#session-cookie-authentication) | [Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication)<BR>(legacy credentials & instances without IAM)<BR><BR>[Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication) | `COUCHDB_SESSION` | Exchanges credentials with `/_session` endpoint to retrieve a cookie.<BR>Adds `Cookie` header and content to each HTTP request.<BR>Automatically renews session when needed. |
166161
| [Bearer token](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#bearer-token-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#jwt-authentication)<BR>(using JWT authentication) | `BEARERTOKEN` | Adds an `Authorization: Bearer <token>` to each HTTP request.<BR>No token management or renewal.<BR>Also compatible with IAM access tokens managed independently of the SDK. |
167162
| [Basic](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#basic-authentication) | [Apache CouchDB](https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication)<BR>(if cookies are not enabled) | `BASIC` | Adds an `Authorization: Basic <encoded username and password>` header to each HTTP request. |
168163
| [None](https://github.com/IBM/python-sdk-core/blob/main/Authentication.md#no-auth-authentication) | - | `NOAUTH` | Note that this authentication type only works for operations against a database allowing access for unauthenticated users. |
169164

170-
The default authentication type for the SDK is `CONTAINER` unless `APIKEY` configuration is supplied, which changes the default authentication type to `IAM`.
165+
The default authentication type for the SDK is `CONTAINER` unless supplying `APIKEY` configuration, which changes the default authentication type to `IAM`.
171166

172167
#### Authentication with environment variables
173168

174-
The default service name is `CLOUDANT` so `CLOUDANT_` prefixed names are used in these examples.
169+
The default service name is `CLOUDANT` so these examples use `CLOUDANT_` prefixed names.
175170

176-
Any custom service name prefix can be used as long as the matching name is used to instantiate the SDK client
177-
and the same prefix is used for all configuration options.
171+
Any custom service name prefix is valid, provided it matches the name used to instantiate the SDK client
172+
and applied to all configuration options.
178173

179174
##### IAM API key authentication
180175

181176
For Cloudant *IAM API key authentication*, set the following environmental variables by
182177
replacing the `<url>` and `<apikey>` with your proper
183178
[service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials). There is no need to set
184-
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when an `APIKEY` is set.
179+
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`.
185180

186181
```bash
187182
CLOUDANT_URL=<url>
@@ -199,7 +194,8 @@ CLOUDANT_URL=<url>
199194
CLOUDANT_IAM_PROFILE_ID=<id>
200195
```
201196

202-
Alternatively a profile name may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_NAME`.
197+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
198+
* `CLOUDANT_IAM_PROFILE_NAME`
203199

204200
##### IAM Trusted profile (VPC) authentication
205201

@@ -212,7 +208,24 @@ CLOUDANT_URL=<url>
212208
CLOUDANT_IAM_PROFILE_ID=<id>
213209
```
214210

215-
Alternatively a profile CRN may be used instead of an ID by replacing `CLOUDANT_IAM_PROFILE_ID` with `CLOUDANT_IAM_PROFILE_CRN`.
211+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
212+
* `CLOUDANT_IAM_PROFILE_CRN`
213+
* No profile information (uses the default trusted profile linked to the compute resource)
214+
215+
##### IAM Trusted profile (assume identity) authentication
216+
217+
For Cloudant *IAM Trusted profile assume authentication*, set the following environmental variables by
218+
replacing the `<url>` and `<id>` with your values.
219+
220+
```bash
221+
CLOUDANT_AUTH_TYPE=IAMASSUME
222+
CLOUDANT_URL=<url>
223+
CLOUDANT_IAM_PROFILE_ID=<id>
224+
```
225+
226+
Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
227+
* `CLOUDANT_IAM_PROFILE_CRN`
228+
* `CLOUDANT_IAM_PROFILE_NAME` *and* `CLOUDANT_IAM_ACCOUNT_ID` (ID of the account that contains the named trusted profile)
216229

217230
##### Session cookie authentication
218231

@@ -229,11 +242,10 @@ CLOUDANT_PASSWORD=<password>
229242

230243
#### Authentication with external configuration
231244

232-
To use an external configuration file, the
245+
For more information about using an external configuration file, see the related documentation in
233246
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=python#authentication-with-external-configuration),
234247
or the
235-
[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration)
236-
will guide you.
248+
[general SDK usage information](https://github.com/IBM/ibm-cloud-sdk-common#using-external-configuration).
237249

238250
#### Programmatic authentication
239251

0 commit comments

Comments
 (0)