Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGraphClient ¶
func NewGraphClient(accessToken string, expiresOn time.Time, ipv4Only bool) (*msgraphsdk.GraphServiceClient, error)
NewGraphClient creates an authenticated msgraph-sdk-go client from a raw access token. The caller is responsible for loading and validating the token.
IMPORTANT: The HTTP client MUST include the Graph SDK middleware pipeline (telemetry, URL replacement for /me, retry, redirect). Without it, calls to client.Me() resolve to "/users/me-token-to-replace" which Graph rejects.
func NewIPv4HTTPClient ¶
NewIPv4HTTPClient returns an *http.Client with IPv4-only transport. This satisfies azcore's policy.Transporter interface (has Do method) and can be used as azcore.ClientOptions.Transport.
func NewIPv4Transport ¶
NewIPv4Transport returns an http.Transport that only resolves IPv4 addresses. Useful for cloud regions with broken IPv6 egress (e.g. some Azure regions).
Types ¶
type StaticTokenCredential ¶
type StaticTokenCredential struct {
// contains filtered or unexported fields
}
StaticTokenCredential wraps a pre-acquired access token as an azcore.TokenCredential. SECURITY: The token is only held in memory and never logged.
func (*StaticTokenCredential) GetToken ¶
func (s *StaticTokenCredential) GetToken(_ context.Context, _ policy.TokenRequestOptions) (azcore.AccessToken, error)
GetToken returns the stored access token.