Improve API docs for DAC and ChainedTokenCredential (#31454)

Drive traffic to the new credential chains doc on Learn. Also, eliminate
duplication in the `DefaultAzureCredential` API docs.

---------

Co-authored-by: Karishma Ghiya <kaghiya@microsoft.com>
This commit is contained in:
Scott Addie 2024-10-19 09:34:54 -05:00 коммит произвёл GitHub
Родитель 1f4c88c136
Коммит 276c94b6d4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 21 добавлений и 52 удалений

Просмотреть файл

@ -12,8 +12,9 @@ import { tracingClient } from "../util/tracing";
export const logger = credentialLogger("ChainedTokenCredential");
/**
* Enables multiple `TokenCredential` implementations to be tried in order
* until one of the getToken methods returns an access token.
* Enables multiple `TokenCredential` implementations to be tried in order until
* one of the getToken methods returns an access token. For more information, see
* [ChainedTokenCredential overview](https://aka.ms/azsdk/js/identity/credential-chains#use-chainedtokencredential-for-granularity).
*/
export class ChainedTokenCredential implements TokenCredential {
private _sources: TokenCredential[] = [];

Просмотреть файл

@ -194,71 +194,39 @@ export class UnavailableDefaultCredential implements TokenCredential {
}
/**
* Provides a default {@link ChainedTokenCredential} configuration that should
* work for most applications that use the Azure SDK.
* Provides a default {@link ChainedTokenCredential} configuration that works for most
* applications that use Azure SDK client libraries. For more information, see
* [DefaultAzureCredential overview](https://aka.ms/azsdk/js/identity/credential-chains#use-defaultazurecredential-for-flexibility).
*
* The following credential types will be tried, in order:
*
* - {@link EnvironmentCredential}
* - {@link WorkloadIdentityCredential}
* - {@link ManagedIdentityCredential}
* - {@link AzureCliCredential}
* - {@link AzurePowerShellCredential}
* - {@link AzureDeveloperCliCredential}
*
* Consult the documentation of these credential types for more information
* on how they attempt authentication.
*/
export class DefaultAzureCredential extends ChainedTokenCredential {
/**
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialClientIdOptions}
*
* This credential provides a default {@link ChainedTokenCredential} configuration that should
* work for most applications that use the Azure SDK.
*
* The following credential types will be tried, in order:
*
* - {@link EnvironmentCredential}
* - {@link WorkloadIdentityCredential}
* - {@link ManagedIdentityCredential}
* - {@link AzureCliCredential}
* - {@link AzurePowerShellCredential}
* - {@link AzureDeveloperCliCredential}
*
* Consult the documentation of these credential types for more information
* on how they attempt authentication.
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialClientIdOptions}.
*
* @param options - Optional parameters. See {@link DefaultAzureCredentialClientIdOptions}.
*/
constructor(options?: DefaultAzureCredentialClientIdOptions);
/**
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialResourceIdOptions}
*
* This credential provides a default {@link ChainedTokenCredential} configuration that should
* work for most applications that use the Azure SDK.
*
* The following credential types will be tried, in order:
*
* - {@link EnvironmentCredential}
* - {@link WorkloadIdentityCredential}
* - {@link ManagedIdentityCredential}
* - {@link AzureCliCredential}
* - {@link AzurePowerShellCredential}
* - {@link AzureDeveloperCliCredential}
*
* Consult the documentation of these credential types for more information
* on how they attempt authentication.
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialResourceIdOptions}.
*
* @param options - Optional parameters. See {@link DefaultAzureCredentialResourceIdOptions}.
*/
constructor(options?: DefaultAzureCredentialResourceIdOptions);
/**
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialOptions}
*
* This credential provides a default {@link ChainedTokenCredential} configuration that should
* work for most applications that use the Azure SDK.
*
* The following credential types will be tried, in order:
*
* - {@link EnvironmentCredential}
* - {@link WorkloadIdentityCredential}
* - {@link ManagedIdentityCredential}
* - {@link AzureCliCredential}
* - {@link AzurePowerShellCredential}
* - {@link AzureDeveloperCliCredential}
*
* Consult the documentation of these credential types for more information
* on how they attempt authentication.
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialOptions}.
*
* @param options - Optional parameters. See {@link DefaultAzureCredentialOptions}.
*/