-
Notifications
You must be signed in to change notification settings - Fork 208
Warning when obsolete msal-extensions is detected #752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,6 +194,21 @@ def obtain_token_by_username_password(self, username, password, **kwargs): | |
| username, password, headers=headers, **kwargs) | ||
|
|
||
|
|
||
| def _msal_extension_check(): | ||
| # Can't run this in module or class level otherwise you'll get circular import error | ||
| try: | ||
| from msal_extensions import __version__ as v | ||
| major, minor, _ = v.split(".", maxsplit=3) | ||
|
||
| if not (int(major) >= 1 and int(minor) >= 2): | ||
| warnings.warn( | ||
| "Please upgrade msal-extensions. " | ||
| "Only msal-extensions 1.2+ can work with msal 1.30+") | ||
| except ImportError: | ||
| pass # The optional msal_extensions is not installed. Business as usual. | ||
| except ValueError: | ||
| logger.exception(f"msal_extensions version {v} not in major.minor.patch format") | ||
|
|
||
|
|
||
| class ClientApplication(object): | ||
| """You do not usually directly use this class. Use its subclasses instead: | ||
| :class:`PublicClientApplication` and :class:`ConfidentialClientApplication`. | ||
|
|
@@ -635,6 +650,8 @@ def __init__( | |
| self.authority_groups = None | ||
| self._telemetry_buffer = {} | ||
| self._telemetry_lock = Lock() | ||
| _msal_extension_check() | ||
|
|
||
|
|
||
| def _decide_broker(self, allow_broker, enable_pii_log): | ||
| is_confidential_app = self.client_credential or isinstance( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice comment! Makes things clear.