Skip to content

Commit ec803c7

Browse files
committed
Merge branch 'sku' into dev
2 parents e0653fb + 49f4b1b commit ec803c7

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

msal/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
#
2626
#------------------------------------------------------------------------------
2727

28-
# pylint: disable=wrong-import-position
29-
30-
__version__ = '0.1.0'
28+
from .application import (
29+
__version__,
30+
ClientApplication,
31+
ConfidentialClientApplication,
32+
PublicClientApplication,
33+
)
34+
from .token_cache import TokenCache
3135

msal/application.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from urllib.parse import urljoin
66
import logging
77
from base64 import b64encode
8+
import sys
89

910
from oauth2cli import Client
1011
from .authority import Authority
@@ -15,6 +16,9 @@
1516
from .token_cache import TokenCache
1617

1718

19+
# The __init__.py will import this. Not the other way around.
20+
__version__ = "0.1.0"
21+
1822
logger = logging.getLogger(__name__)
1923

2024
def decorate_scope(
@@ -90,6 +94,11 @@ def _build_client(self, client_credential, authority):
9094
return Client(
9195
server_configuration,
9296
self.client_id,
97+
default_headers={
98+
"x-client-sku": "MSAL.Python", "x-client-ver": __version__,
99+
"x-client-os": sys.platform,
100+
"x-client-cpu": "x64" if sys.maxsize > 2 ** 32 else "x86",
101+
},
93102
default_body=default_body,
94103
client_assertion=client_assertion,
95104
on_obtaining_tokens=self.token_cache.add,

0 commit comments

Comments
 (0)