Documentation
¶
Index ¶
Constants ¶
const ( // Public Cloud PUBLIC_OAUTH_AUTHORITY_URL = "https://login.microsoftonline.com/" PUBLIC_GRAPH_API_SCOPE = "https://graph.microsoft.com/.default" PUBLIC_GRAPH_API_SERVICE_ROOT = "https://graph.microsoft.com/v1.0" PUBLIC_GRAPH_BETA_API_SERVICE_ROOT = "https://graph.microsoft.com/beta" // US Department of Defense (DoD) Cloud USDOD_OAUTH_AUTHORITY_URL = "https://login.microsoftonline.us/" USDOD_GRAPH_API_SCOPE = "https://graph.microsoft.us/.default" USDOD_GRAPH_API_SERVICE_ROOT = "https://dod-graph.microsoft.us/v1.0" USDOD_GRAPH_BETA_API_SERVICE_ROOT = "https://dod-graph.microsoft.us/beta" // US Government Cloud USGOV_OAUTH_AUTHORITY_URL = "https://login.microsoftonline.com/" USGOV_GRAPH_API_SCOPE = "https://graph.microsoft.us/.default" USGOV_GRAPH_API_SERVICE_ROOT = "https://graph.microsoft.us/v1.0" USGOV_GRAPH_BETA_API_SERVICE_ROOT = "https://graph.microsoft.us/beta" // US Government High Cloud USGOVHIGH_OAUTH_AUTHORITY_URL = "https://login.microsoftonline.us/" USGOVHIGH_GRAPH_API_SCOPE = "https://graph.microsoft.us/.default" USGOVHIGH_GRAPH_API_SERVICE_ROOT = "https://graph.microsoft.us/v1.0" USGOVHIGH_GRAPH_BETA_API_SERVICE_ROOT = "https://graph.microsoft.us/beta" // China Cloud (aka mooncake) - https://learn.microsoft.com/en-us/previous-versions/office/office-365-api/api/o365-china-endpoints CHINA_OAUTH_AUTHORITY_URL = "https://login.chinacloudapi.cn/" CHINA_GRAPH_API_SCOPE = "https://microsoftgraph.chinacloudapi.cn/.default" CHINA_GRAPH_API_SERVICE_ROOT = "https://microsoftgraph.chinacloudapi.cn/v1.0" CHINA_GRAPH_BETA_API_SERVICE_ROOT = "https://microsoftgraph.chinacloudapi.cn/beta" // EagleX Cloud EX_OAUTH_AUTHORITY_URL = "https://login.microsoftonline.eaglex.ic.gov/" EX_GRAPH_API_SCOPE = "https://graph.eaglex.ic.gov/.default" EX_GRAPH_API_SERVICE_ROOT = "https://graph.eaglex.ic.gov/v1.0" EX_GRAPH_BETA_API_SERVICE_ROOT = "https://graph.eaglex.ic.gov/beta" // Secure Cloud (RX) RX_OAUTH_AUTHORITY_URL = "https://login.microsoftonline.microsoft.scloud/" RX_GRAPH_API_SCOPE = "https://graph.microsoft.scloud/.default" RX_GRAPH_API_SERVICE_ROOT = "https://graph.microsoft.scloud/v1.0" RX_GRAPH_BETA_API_SERVICE_ROOT = "https://graph.microsoft.scloud/beta" )
Variables ¶
var GraphSDKMutex sync.Mutex
GraphSDKMutex is a global lock used to serialize Microsoft Graph SDK (Kiota) API calls.
Reason: Kiota's middleware (e.g., HeadersInspectionHandler) modifies shared header maps during HTTP request processing. In Go, maps are not concurrency-safe — concurrent writes cause immediate fatal runtime panics ("concurrent map writes").
Terraform executes Read operations across multiple resources in parallel, leading to multiple Graph API calls at the same time. Without locking, simultaneous mutation of the shared headers map causes the plugin to crash.
By acquiring this mutex around Graph API calls (Get, Post, Patch, Delete), we ensure only one request is processed at a time through the Kiota pipeline, preventing concurrency issues and plugin crashes.
You cannot set a mutex as a constant in go.
Functions ¶
This section is empty.
Types ¶
This section is empty.