policyweaver.core.api.microsoftgraph

policyweaver.core.api.microsoftgraph

class policyweaver.core.api.microsoftgraph.MicrosoftGraphClient

Bases: object

A class to interact with the Microsoft Graph API for user management. This class provides methods to look up user IDs by email addresses. Attributes:

logger (logging.Logger): Logger instance for logging API interactions. graph_client (GraphServiceClient): Client for making requests to the Microsoft Graph API.

async get_service_principal_by_id(id: str) str

Looks up a service principal by its ID. Args:

id (str): The ID of the service principal to look up.

Returns:

str: The service principal ID if found, None otherwise.

async get_user_by_email(email: str) str

Looks up a user ID by their email address. Args:

email (str): The email address of the user to look up.

Returns:

str: The user ID if found, None otherwise.