Skip to content

Commit a3c2812

Browse files
authored
Fix identity doc issues (Azure#41324)
1 parent e760add commit a3c2812

File tree

10 files changed

+18
-3
lines changed

10 files changed

+18
-3
lines changed

sdk/identity/azure-identity/azure/identity/_auth_record.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self, tenant_id: str, client_id: str, authority: str, home_account_
3434
def authority(self) -> str:
3535
"""The authority host used to authenticate the account.
3636
37+
:return: The authority host used to authenticate the account.
3738
:rtype: str
3839
"""
3940
return self._authority
@@ -42,6 +43,7 @@ def authority(self) -> str:
4243
def client_id(self) -> str:
4344
"""The client ID of the application which performed the original authentication.
4445
46+
:return: The client ID of the application which performed the original authentication.
4547
:rtype: str
4648
"""
4749
return self._client_id
@@ -50,6 +52,7 @@ def client_id(self) -> str:
5052
def home_account_id(self) -> str:
5153
"""A unique identifier of the account.
5254
55+
:return: A unique identifier of the account.
5356
:rtype: str
5457
"""
5558
return self._home_account_id
@@ -58,6 +61,7 @@ def home_account_id(self) -> str:
5861
def tenant_id(self) -> str:
5962
"""The tenant the account should authenticate in.
6063
64+
:return: The tenant the account should authenticate in.
6165
:rtype: str
6266
"""
6367
return self._tenant_id
@@ -66,6 +70,7 @@ def tenant_id(self) -> str:
6670
def username(self) -> str:
6771
"""The user principal or service principal name of the account.
6872
73+
:return: The user principal or service principal name of the account.
6974
:rtype: str
7075
"""
7176
return self._username

sdk/identity/azure-identity/azure/identity/_constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def __getattr__(cls, name):
2727

2828

2929
class AzureAuthorityHosts(metaclass=AzureAuthorityHostsMeta):
30+
"""Constants for Microsoft Entra ID authority hosts.
31+
These are used to construct authority URLs for various Azure environments.
32+
"""
33+
3034
AZURE_CHINA = "login.chinacloudapi.cn"
3135
AZURE_GOVERNMENT = "login.microsoftonline.us"
3236
AZURE_PUBLIC_CLOUD = "login.microsoftonline.com"

sdk/identity/azure-identity/azure/identity/_credentials/client_assertion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def __exit__(self, *args: Any) -> None:
6666
self._client.__exit__(*args)
6767

6868
def close(self) -> None:
69+
"""Close the credential's underlying HTTP client and release resources."""
6970
self.__exit__()
7071

7172
def _acquire_token_silently(self, *scopes: str, **kwargs: Any) -> Optional[AccessTokenInfo]:

sdk/identity/azure-identity/azure/identity/_exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(
3737
def scopes(self) -> Iterable[str]:
3838
"""Scopes requested during the failed authentication.
3939
40+
:return: Scopes requested during the failed authentication.
4041
:rtype: ~typing.Iterable[str]
4142
"""
4243
return self._scopes
@@ -45,6 +46,7 @@ def scopes(self) -> Iterable[str]:
4546
def claims(self) -> Optional[str]:
4647
"""Additional claims required in the next authentication.
4748
49+
:return: Additional claims required in the next authentication, or None if no additional claims are required.
4850
:rtype: str or None
4951
"""
5052
return self._claims

sdk/identity/azure-identity/azure/identity/_internal/get_token_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_token_info(self, *scopes: str, options: Optional[TokenRequestOptions] =
104104
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
105105
:paramtype options: ~azure.core.credentials.TokenRequestOptions
106106
107-
:rtype: AccessTokenInfo
107+
:rtype: ~azure.core.credentials.AccessTokenInfo
108108
:return: An AccessTokenInfo instance containing information about the token.
109109
:raises CredentialUnavailableError: the credential is unable to attempt authentication because it lacks
110110
required data, state, or platform support

sdk/identity/azure-identity/azure/identity/_internal/interactive.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def authenticate(
253253
for these scopes.
254254
:keyword str claims: additional claims required in the token, such as those provided by
255255
:func:`AuthenticationRequiredError.claims`
256+
:return: An AuthenticationRecord containing the authenticated user's information.
256257
:rtype: ~azure.identity.AuthenticationRecord
257258
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The error's ``message``
258259
attribute gives a reason.

sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def __exit__(self, *args: Any) -> None:
6868
self._client.__exit__(*args)
6969

7070
def close(self) -> None:
71+
"""Close the credential's underlying HTTP client and release resources."""
7172
self.__exit__()
7273

7374
def _initialize_cache(self, is_cae: bool = False) -> msal.TokenCache:

sdk/identity/azure-identity/azure/identity/aio/_credentials/chained.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ChainedTokenCredential(AsyncContextManager):
2525
https://aka.ms/azsdk/python/identity/credential-chains#chainedtokencredential-overview.
2626
2727
:param credentials: credential instances to form the chain
28-
:type credentials: ~azure.core.credentials.AsyncTokenCredential
28+
:type credentials: ~azure.core.credentials_async.AsyncTokenCredential
2929
3030
.. admonition:: Example:
3131

sdk/identity/azure-identity/azure/identity/aio/_credentials/on_behalf_of.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ async def __aenter__(self) -> "OnBehalfOfCredential":
109109
return self
110110

111111
async def close(self) -> None:
112+
"""Close the credential's underlying HTTP client."""
112113
await self._client.close()
113114

114115
async def _acquire_token_silently(self, *scopes: str, **kwargs: Any) -> Optional[AccessTokenInfo]:

sdk/identity/azure-identity/azure/identity/aio/_internal/get_token_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async def get_token_info(self, *scopes: str, options: Optional[TokenRequestOptio
104104
:keyword options: A dictionary of options for the token request. Unknown options will be ignored. Optional.
105105
:paramtype options: ~azure.core.credentials.TokenRequestOptions
106106
107-
:rtype: AccessTokenInfo
107+
:rtype: ~azure.core.credentials.AccessTokenInfo
108108
:return: An AccessTokenInfo instance containing information about the token.
109109
:raises CredentialUnavailableError: the credential is unable to attempt authentication because it lacks
110110
required data, state, or platform support

0 commit comments

Comments
 (0)