Skip to content

Commit 25ef3a0

Browse files
committed
test
1 parent a421b70 commit 25ef3a0

File tree

8 files changed

+20
-5
lines changed

8 files changed

+20
-5
lines changed

=1.20,

Whitespace-only changes.

msal/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
)
2222

2323
_AZURE_CLI = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"
24+
# _AZURE_CLI = "4b0db8c2-9f26-4417-8bde-3f0e3656f8e0"
2425
_VISUAL_STUDIO = "04f0c124-f2bc-4f59-8241-bf6df9866bbd"
26+
2527
placeholder_auth_scheme = msal.PopAuthScheme(
2628
http_method=msal.PopAuthScheme.HTTP_GET,
2729
url="https://example.com/endpoint",
@@ -300,6 +302,7 @@ def _main():
300302
instance_discovery=instance_discovery,
301303
enable_broker_on_windows=enable_broker,
302304
enable_broker_on_mac=enable_broker,
305+
enable_broker_on_linux=enable_broker,
303306
enable_pii_log=enable_pii_log,
304307
token_cache=global_cache,
305308
) if not is_cca else msal.ConfidentialClientApplication(

msal/application.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ def _decide_broker(self, allow_broker, enable_pii_log):
647647
"allow_broker is deprecated. "
648648
"Please use PublicClientApplication(..., "
649649
"enable_broker_on_windows=True, "
650+
"enable_broker_on_linux=True, "
650651
"enable_broker_on_mac=...)",
651652
DeprecationWarning)
652653
opted_in_for_broker = (
@@ -1894,7 +1895,7 @@ def __init__(self, client_id, client_credential=None, **kwargs):
18941895
18951896
.. note::
18961897
1897-
You may set enable_broker_on_windows and/or enable_broker_on_mac to True.
1898+
You may set enable_broker_on_windows and/or enable_broker_on_mac and/or enable_broker_on_linux to True.
18981899
18991900
**What is a broker, and why use it?**
19001901
@@ -1962,15 +1963,23 @@ def __init__(self, client_id, client_credential=None, **kwargs):
19621963
This parameter defaults to None, which means MSAL will not utilize a broker.
19631964
19641965
New in MSAL Python 1.31.0.
1966+
1967+
:param boolean enable_broker_on_linux:
1968+
This setting is only effective if your app is running on Linux.
1969+
This parameter defaults to None, which means MSAL will not utilize a broker.
1970+
1971+
New in MSAL Python 1.x.z.
19651972
"""
19661973
if client_credential is not None:
19671974
raise ValueError("Public Client should not possess credentials")
19681975
# Using kwargs notation for now. We will switch to keyword-only arguments.
19691976
enable_broker_on_windows = kwargs.pop("enable_broker_on_windows", False)
19701977
enable_broker_on_mac = kwargs.pop("enable_broker_on_mac", False)
1978+
enable_broker_on_linux = kwargs.pop("enable_broker_on_linux", False)
19711979
self._enable_broker = bool(
19721980
enable_broker_on_windows and sys.platform == "win32"
1973-
or enable_broker_on_mac and sys.platform == "darwin")
1981+
or enable_broker_on_mac and sys.platform == "darwin"
1982+
or enable_broker_on_linux and sys.platform == "linux")
19741983
super(PublicClientApplication, self).__init__(
19751984
client_id, client_credential=None, **kwargs)
19761985

msal/broker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TokenTypeError(ValueError):
4141
# Besides, the homebrew-installed Pythons have no team_id
4242
# so they have to use a generic placeholder anyway.
4343
# The v-team chose to combine two situations into using same placeholder.
44-
44+
#
4545

4646
def _convert_error(error, client_id):
4747
context = error.get_context() # Available since pymsalruntime 0.0.4

sample/interactive_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
oidc_authority=os.getenv('OIDC_AUTHORITY'), # For External ID with custom domain
4848
#enable_broker_on_windows=True, # Opted in. You will be guided to meet the prerequisites, if your app hasn't already
4949
#enable_broker_on_mac=True, # Opted in. You will be guided to meet the prerequisites, if your app hasn't already
50-
50+
#enable_broker_on_linux=True, # Opted in. You will be guided to meet the prerequisites, if your app hasn't already
5151
token_cache=global_token_cache, # Let this app (re)use an existing token cache.
5252
# If absent, ClientApplication will create its own empty token cache
5353
)

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ broker =
6565
pymsalruntime>=0.14,<0.18; python_version>='3.6' and platform_system=='Windows'
6666
# On Mac, PyMsalRuntime 0.17+ is expected to support SSH cert and ROPC
6767
pymsalruntime>=0.17,<0.18; python_version>='3.8' and platform_system=='Darwin'
68+
pymsalruntime>=0.17,<0.18; python_version>='3.8' and platform_system=='Linux'
6869

6970
[options.packages.find]
7071
exclude =

tests/broker-test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
_AZURE_CLI,
4040
authority="https://login.microsoftonline.com/organizations",
4141
enable_broker_on_mac=True,
42-
enable_broker_on_windows=True)
42+
enable_broker_on_windows=True,
43+
enable_broker_on_linux=True)
4344

4445
def interactive_and_silent(scopes, auth_scheme, data, expected_token_type):
4546
print("An account picker shall be pop up, possibly behind this console. Continue from there.")

tests/test_e2e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def _build_app(cls,
200200
http_client=http_client or MinimalHttpClient(),
201201
enable_broker_on_windows=broker_available,
202202
enable_broker_on_mac=broker_available,
203+
enable_broker_on_linux=broker_available,
203204
)
204205

205206
def _test_username_password(self,

0 commit comments

Comments
 (0)