From 8a8445b2b0c15be31a3615aaaddb16246d015820 Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Mon, 21 Aug 2023 12:08:17 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9D=20Add=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ms_python_client/utils/event_generator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ms_python_client/utils/event_generator.py b/ms_python_client/utils/event_generator.py index 1306d22..5804e77 100644 --- a/ms_python_client/utils/event_generator.py +++ b/ms_python_client/utils/event_generator.py @@ -42,6 +42,7 @@ class PartialEventParameters(OptionalTimezone, TypedDict, total=False): end_time: str +# This has been set arbitrarily ZOOM_ID_EXTENDED_PROPERTY_ID = ( "String {d3123b00-8eb5-4f10-ae88-1269fe4cbaf0} Name ZoomId" ) From 9615a9effdeb6e4f918272b8ef358b236541151c Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Mon, 21 Aug 2023 12:09:29 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bug=20for=20dev=20toke?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ms_python_client/ms_api_client.py | 11 ++++++++--- tests/ms_python_client/test_ms_api_client.py | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ms_python_client/ms_api_client.py b/ms_python_client/ms_api_client.py index e82259a..8bffef0 100644 --- a/ms_python_client/ms_api_client.py +++ b/ms_python_client/ms_api_client.py @@ -44,13 +44,18 @@ def __init__( config: Config, api_endpoint: str = "https://graph.microsoft.com/v1.0", ): + if "MS_ACCESS_TOKEN" in os.environ and os.getenv("MS_ACCESS_TOKEN") != "": + self.dev_token = os.environ["MS_ACCESS_TOKEN"] + else: + self.dev_token = None + self.oauth = Oauth2Flow(config) + self.api_client = ApiClient(api_base_url=api_endpoint) - self.oauth = Oauth2Flow(config) self.init_components() def build_headers(self, extra_headers: Optional[_Headers] = None) -> _Headers: - if "MS_ACCESS_TOKEN" in os.environ and os.getenv("MS_ACCESS_TOKEN") != "": - token = os.environ["MS_ACCESS_TOKEN"] + if self.dev_token: + token = self.dev_token else: token = self.oauth.get_access_token()[0] diff --git a/tests/ms_python_client/test_ms_api_client.py b/tests/ms_python_client/test_ms_api_client.py index 63a0bd9..0105f79 100644 --- a/tests/ms_python_client/test_ms_api_client.py +++ b/tests/ms_python_client/test_ms_api_client.py @@ -51,7 +51,6 @@ def test_build_headers_with_extra_headers(self): assert headers["Authorization"] == f"Bearer {MOCK_TOKEN}" assert headers["test"] == "test" - @mock_msal() def test_with_token(self): os.environ["MS_ACCESS_TOKEN"] = "test_token" client = MSApiClient.init_from_dotenv(custom_dotenv=self.env_file) From 367fe9aad2b2fcb2fd29ae4e7f2fd9eff68ecbdb Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Mon, 21 Aug 2023 12:10:01 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9A=80=20RELEASE:=20Bump=20to=202.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5825607..88cef4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ms-python-client" -version = "2.0.1" +version = "2.0.2" exclude = ["tests*", "example*", ".github*", ".git*", ".vscode*"] description = "This package is used to interact with the microsoft graph API" authors = ["Samuel Guillemet "]