fix linting errors

This commit is contained in:
Ishaan Jaff 2025-04-09 15:59:33 -07:00
parent 8e554f52e3
commit 2f419ba384

View file

@ -957,18 +957,26 @@ class MicrosoftSSOHandler:
) )
all_group_ids = [] all_group_ids = []
next_link = MicrosoftSSOHandler.graph_api_user_groups_endpoint next_link: Optional[str] = (
MicrosoftSSOHandler.graph_api_user_groups_endpoint
)
auth_headers = {"Authorization": f"Bearer {access_token}"} auth_headers = {"Authorization": f"Bearer {access_token}"}
page_count = 0 page_count = 0
while next_link and page_count < MicrosoftSSOHandler.MAX_GRAPH_API_PAGES: while (
next_link is not None
and page_count < MicrosoftSSOHandler.MAX_GRAPH_API_PAGES
):
group_ids, next_link = await MicrosoftSSOHandler.fetch_and_parse_groups( group_ids, next_link = await MicrosoftSSOHandler.fetch_and_parse_groups(
url=next_link, headers=auth_headers, async_client=async_client url=next_link, headers=auth_headers, async_client=async_client
) )
all_group_ids.extend(group_ids) all_group_ids.extend(group_ids)
page_count += 1 page_count += 1
if next_link and page_count >= MicrosoftSSOHandler.MAX_GRAPH_API_PAGES: if (
next_link is not None
and page_count >= MicrosoftSSOHandler.MAX_GRAPH_API_PAGES
):
verbose_proxy_logger.warning( verbose_proxy_logger.warning(
f"Reached maximum page limit of {MicrosoftSSOHandler.MAX_GRAPH_API_PAGES}. Some groups may not be included." f"Reached maximum page limit of {MicrosoftSSOHandler.MAX_GRAPH_API_PAGES}. Some groups may not be included."
) )