Skip to content

Commit

Permalink
Rename enable_broker to allow_broker
Browse files Browse the repository at this point in the history
  • Loading branch information
rayluo committed May 12, 2022
1 parent ef7107f commit 15c194d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions msal/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(
# when we would eventually want to add this feature to PCA in future.
exclude_scopes=None,
http_cache=None,
enable_broker=None,
allow_broker=None,
):
"""Create an instance of application.
Expand Down Expand Up @@ -414,7 +414,7 @@ def __init__(
New in version 1.16.0.
:param boolean enable_broker:
:param boolean allow_broker:
Brokers provide Single-Sign-On, device identification,
and application identification verification.
If this parameter is set to True,
Expand Down Expand Up @@ -501,9 +501,9 @@ def __init__(
raise
is_confidential_app = bool(
isinstance(self, ConfidentialClientApplication) or self.client_credential)
if is_confidential_app and enable_broker:
raise ValueError("enable_broker=True is only supported in PublicClientApplication")
self._enable_broker = (enable_broker and not is_confidential_app
if is_confidential_app and allow_broker:
raise ValueError("allow_broker=True is only supported in PublicClientApplication")
self._enable_broker = (allow_broker and not is_confidential_app
and sys.platform == "win32"
and not self.authority.is_adfs and not self.authority._is_b2c)

Expand Down
2 changes: 1 addition & 1 deletion tests/msaltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def main():
header="Input authority (Note that MSA-PT apps would NOT use the /common authority)",
accept_nonempty_string=True,
),
enable_broker=_input_boolean("Enable broker? (Azure CLI currently only supports @microsoft.com accounts when enabling broker)"),
allow_broker=_input_boolean("Allow broker? (Azure CLI currently only supports @microsoft.com accounts when enabling broker)"),
)
if _input_boolean("Enable MSAL Python's DEBUG log?"):
logging.basicConfig(level=logging.DEBUG)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _build_app(cls,
authority=authority,
azure_region=azure_region,
http_client=http_client or MinimalHttpClient(),
enable_broker=broker_available # This way, we reuse same test cases, by run them with and without broker
allow_broker=broker_available # This way, we reuse same test cases, by run them with and without broker
and not client_credential,
)

Expand Down

0 comments on commit 15c194d

Please sign in to comment.