cloud

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cloud holds the per-cloud endpoint bases PLAN.md's `cloud` setting selects (global, usgov, china). Everything else that needs a URL takes it from here, so a sovereign cloud is a config value and never a code path.

Index

Constants

This section is empty.

Variables

View Source
var ErrGraphBaseUndocumented = errors.New("the docs mirror does not document this cloud's Graph service root; set graph_base_url in the profile")

ErrGraphBaseUndocumented is returned when a cloud's Graph service root is not in the docs mirror and the profile did not supply one.

Functions

func Names

func Names() []string

Names lists the supported cloud names, sorted.

Types

type Endpoints

type Endpoints struct {
	// Name is the config value: global, usgov or china.
	Name string
	// Graph is the Microsoft Graph base URL, without a trailing slash. An empty
	// value means the docs mirror does not state it for this cloud, so the
	// profile must supply graph_base_url rather than us guessing a host.
	Graph string
	// AuthorityHost is the Entra authority base, without a tenant segment.
	AuthorityHost string
	// KeyVaultSuffix is appended to a vault name to form its DNS name.
	KeyVaultSuffix string
	// Documented is the refs/ path that states these values, or "" when the
	// mirror does not state them (then the value is marked unverified below).
	Documented string
}

Endpoints is one Microsoft cloud.

func Lookup

func Lookup(name string) (Endpoints, bool)

Lookup returns the endpoints for a cloud name.

func MustLookup

func MustLookup(name string) Endpoints

MustLookup panics on an unknown cloud; used for the compiled-in default.

func (Endpoints) Authority

func (e Endpoints) Authority(tenant string) string

Authority returns the MSAL authority for a tenant. The tenant path segment is mandatory: MSAL rejects an authority without one (refs/msal-go/apps/internal/oauth/ops/authority/authority.go:533-536).

func (Endpoints) DocumentedGraphBase

func (e Endpoints) DocumentedGraphBase() bool

DocumentedGraphBase reports whether the mirror states the Graph base URL.

func (Endpoints) GraphURL

func (e Endpoints) GraphURL(path string) string

GraphURL joins a path onto the cloud's Graph base URL.

func (Endpoints) KeyVaultURL

func (e Endpoints) KeyVaultURL(vault string) string

KeyVaultURL returns the vault URL for a vault name in this cloud.

Jump to

Keyboard shortcuts

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