graph

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 11 Imported by: 0

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

func NewIPv4HTTPClient() *http.Client

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

func NewIPv4Transport() *http.Transport

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

GetToken returns the stored access token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL