Skip to content

Commit 89746d3

Browse files
committed
Minor cleanup to prepare upcoming major revamp
1 parent d512539 commit 89746d3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

msal/application.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from . import oauth2
1+
from .oauth2 import Client
22
from .authority import Authority
33
from .request import decorate_scope
44
from .assertion import create_jwt_assertion
@@ -36,7 +36,7 @@ def acquire_token_silent(
3636
**kwargs):
3737
the_authority = Authority(authority) if authority else self.authority
3838
refresh_token = kwargs.get('refresh_token') # For testing purpose
39-
response = oauth2.Client(
39+
response = Client(
4040
self.client_id, token_endpoint=the_authority.token_endpoint,
4141
default_body=self._build_auth_parameters(
4242
self.client_credential,
@@ -98,7 +98,7 @@ def __init__(
9898

9999
def acquire_token_for_client(self, scope, policy=None):
100100
token_endpoint = self.authority.token_endpoint
101-
return oauth2.Client(
101+
return Client(
102102
self.client_id, token_endpoint=token_endpoint,
103103
default_body=self._build_auth_parameters(
104104
self.client_credential, token_endpoint, self.client_id)
@@ -131,7 +131,7 @@ def get_authorization_request_url(
131131
:param str state: Recommended by OAuth2 for CSRF protection.
132132
"""
133133
the_authority = Authority(authority) if authority else self.authority
134-
client = oauth2.Client(
134+
client = Client(
135135
self.client_id,
136136
authorization_endpoint=the_authority.authorization_endpoint)
137137
return client.authorization_url(
@@ -174,7 +174,7 @@ def acquire_token_with_authorization_code(
174174
# So in theory, you can omit scope here when you were working with only
175175
# one scope. But, MSAL decorates your scope anyway, so they are never
176176
# really empty.
177-
return oauth2.Client(
177+
return Client(
178178
self.client_id, token_endpoint=self.authority.token_endpoint,
179179
default_body=self._build_auth_parameters(
180180
self.client_credential,

tests/test_application.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def test_get_authorization_request_url(self):
6161
# After user consent, your redirect endpoint will be hit like this:
6262
# http://localhost:8000/?code=blahblah&other_param=foo
6363

64-
def beautify(self, json_payload):
64+
@classmethod
65+
def beautify(cls, json_payload):
6566
return json.dumps(json_payload, indent=2)
6667

6768
def test_acquire_token_with_authorization_code(self):

0 commit comments

Comments
 (0)