Skip to content

Commit a521bff

Browse files
committed
suggestion edits
1 parent 43507ff commit a521bff

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

msal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
#------------------------------------------------------------------------------
2727

2828
from .application import (
29-
__version__,
3029
ClientApplication,
3130
ConfidentialClientApplication,
3231
PublicClientApplication,
3332
)
3433
from .oauth2cli.oidc import Prompt, IdTokenError
34+
from .sku import __version__
3535
from .token_cache import TokenCache, SerializableTokenCache
3636
from .auth_scheme import PopAuthScheme
3737
from .managed_identity import (

msal/application.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
from .region import _detect_region
2020
from .throttled_http_client import ThrottledHttpClient
2121
from .cloudshell import _is_running_in_cloud_shell
22+
from .sku import SKU, __version__
2223

2324

24-
# The __init__.py will import this. Not the other way around.
25-
__version__ = "1.31.1" # When releasing, also check and bump our dependencies's versions if needed
2625

2726
logger = logging.getLogger(__name__)
2827
_AUTHORITY_TYPE_CLOUDSHELL = "CLOUDSHELL"
@@ -770,7 +769,7 @@ def _build_client(self, client_credential, authority, skip_regional_client=False
770769
client_assertion = None
771770
client_assertion_type = None
772771
default_headers = {
773-
"x-client-sku": "MSAL.Python", "x-client-ver": __version__,
772+
"x-client-sku": SKU, "x-client-ver": __version__,
774773
"x-client-os": sys.platform,
775774
"x-ms-lib-capability": "retry-after, h429",
776775
}

msal/broker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
import uuid
99

10-
from .application import __version__
10+
from .sku import __version__, SKU
1111

1212

1313
logger = logging.getLogger(__name__)
@@ -141,7 +141,7 @@ def _enable_msa_pt(params):
141141

142142
def _build_msal_runtime_auth_params(client_id, authority):
143143
params = pymsalruntime.MSALRuntimeAuthParameters(client_id, authority)
144-
params.set_additional_parameter("msal_client_sku", "MSAL.Python")
144+
params.set_additional_parameter("msal_client_sku", SKU)
145145
params.set_additional_parameter("msal_client_ver", __version__)
146146
return params
147147

msal/sku.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""This module is from where we recieve the client sku name and version.
2+
"""
3+
4+
# The __init__.py will import this. Not the other way around.
5+
__version__ = "1.31.1" # When releasing, also check and bump our dependencies's versions if needed
6+
SKU = "MSAL.Python"

0 commit comments

Comments
 (0)