Skip to content

Commit 10c8dd5

Browse files
committed
Remove many Sphinx warnings
1 parent 1b7db8d commit 10c8dd5

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

docs/index.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,20 @@ MSAL proposes a clean separation between
9191
They are implemented as two separated classes,
9292
with different methods for different authentication scenarios.
9393

94+
ClientApplication
95+
=================
9496

97+
.. autoclass:: msal.ClientApplication
98+
:members:
99+
:inherited-members:
100+
101+
.. automethod:: __init__
95102

96103
PublicClientApplication
97104
=======================
98105

99106
.. autoclass:: msal.PublicClientApplication
100107
:members:
101-
:inherited-members:
102108

103109
.. automethod:: __init__
104110

@@ -107,9 +113,7 @@ ConfidentialClientApplication
107113

108114
.. autoclass:: msal.ConfidentialClientApplication
109115
:members:
110-
:inherited-members:
111116

112-
.. automethod:: __init__
113117

114118
TokenCache
115119
==========

msal/application.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def obtain_token_by_username_password(self, username, password, **kwargs):
156156

157157

158158
class ClientApplication(object):
159+
"""You do not usually directly use this class. Use its subclasses instead:
160+
:class:`PublicClientApplication` and :class:`ConfidentialClientApplication`.
161+
"""
159162
ACQUIRE_TOKEN_SILENT_ID = "84"
160163
ACQUIRE_TOKEN_BY_REFRESH_TOKEN = "85"
161164
ACQUIRE_TOKEN_BY_USERNAME_PASSWORD_ID = "301"
@@ -319,7 +322,7 @@ def __init__(
319322
to keep their traffic remain inside that region.
320323
321324
As of 2021 May, regional service is only available for
322-
``acquire_token_for_client()`` sent by any of the following scenarios::
325+
``acquire_token_for_client()`` sent by any of the following scenarios:
323326
324327
1. An app powered by a capable MSAL
325328
(MSAL Python 1.12+ will be provisioned)
@@ -764,9 +767,9 @@ def initiate_auth_code_flow(
764767
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
765768
If included, it will skip the email-based discovery process that user goes
766769
through on the sign-in page, leading to a slightly more streamlined user experience.
767-
More information on possible values
768-
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
769-
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
770+
More information on possible values available in
771+
`Auth Code Flow doc <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
772+
`domain_hint doc <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
770773
771774
:param int max_age:
772775
OPTIONAL. Maximum Authentication Age.
@@ -804,7 +807,7 @@ def initiate_auth_code_flow(
804807
"...": "...", // Everything else are reserved and internal
805808
}
806809
807-
The caller is expected to::
810+
The caller is expected to:
808811
809812
1. somehow store this content, typically inside the current session,
810813
2. guide the end user (i.e. resource owner) to visit that auth_uri,
@@ -868,9 +871,9 @@ def get_authorization_request_url(
868871
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
869872
If included, it will skip the email-based discovery process that user goes
870873
through on the sign-in page, leading to a slightly more streamlined user experience.
871-
More information on possible values
872-
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
873-
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
874+
More information on possible values available in
875+
`Auth Code Flow doc <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
876+
`domain_hint doc <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
874877
:param claims_challenge:
875878
The claims_challenge parameter requests specific claims requested by the resource provider
876879
in the form of a claims_challenge directive in the www-authenticate header to be
@@ -1682,6 +1685,9 @@ class PublicClientApplication(ClientApplication): # browser app or mobile app
16821685
CONSOLE_WINDOW_HANDLE = object()
16831686

16841687
def __init__(self, client_id, client_credential=None, **kwargs):
1688+
"""Same as :func:`ClientApplication.__init__`,
1689+
except that ``client_credential`` parameter shall remain ``None``.
1690+
"""
16851691
if client_credential is not None:
16861692
raise ValueError("Public Client should not possess credentials")
16871693
super(PublicClientApplication, self).__init__(
@@ -1722,9 +1728,9 @@ def acquire_token_interactive(
17221728
Can be one of "consumers" or "organizations" or your tenant domain "contoso.com".
17231729
If included, it will skip the email-based discovery process that user goes
17241730
through on the sign-in page, leading to a slightly more streamlined user experience.
1725-
More information on possible values
1726-
`here <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
1727-
`here <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
1731+
More information on possible values available in
1732+
`Auth Code Flow doc <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code>`_ and
1733+
`domain_hint doc <https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oapx/86fb452d-e34a-494e-ac61-e526e263b6d8>`_.
17281734
17291735
:param claims_challenge:
17301736
The claims_challenge parameter requests specific claims requested by the resource provider
@@ -1994,6 +2000,9 @@ def acquire_token_by_device_flow(self, flow, claims_challenge=None, **kwargs):
19942000

19952001

19962002
class ConfidentialClientApplication(ClientApplication): # server-side web app
2003+
"""Same as :func:`ClientApplication.__init__`,
2004+
except that ``allow_broker`` parameter shall remain ``None``.
2005+
"""
19972006

19982007
def acquire_token_for_client(self, scopes, claims_challenge=None, **kwargs):
19992008
"""Acquires token for the current confidential client, not for an end user.

msal/token_cache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def find(self, credential_type, target=None, query=None):
102102
]
103103

104104
def add(self, event, now=None):
105-
# type: (dict) -> None
106105
"""Handle a token obtaining event, and add tokens into cache."""
107106
def make_clean_copy(dictionary, sensitive_fields): # Masks sensitive info
108107
return {

0 commit comments

Comments
 (0)