config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides configuration management for the msgraph CLI.

Index

Constants

View Source
const (
	// DefaultClientID is the Microsoft Graph Command Line Tools app ID.
	// This is a first-party Microsoft app pre-registered in most M365 tenants.
	DefaultClientID = "14d82eec-204b-4c2f-b7e8-296a70dab67e"

	// DefaultTenantID uses the "common" endpoint for multi-tenant sign-in.
	DefaultTenantID = "common"

	// DefaultAPIVersion is the default Graph API version.
	DefaultAPIVersion = "beta"

	// DefaultAuthority is the base URL for the Microsoft identity platform.
	DefaultAuthority = "https://login.microsoftonline.com/"

	// GraphBaseURL is the base URL for Microsoft Graph API.
	GraphBaseURL = "https://graph.microsoft.com"

	// DefaultScopes are the minimum scopes requested at sign-in.
	DefaultScope = "User.Read"

	// RedirectURL is the localhost redirect used for interactive browser auth.
	RedirectURL = "http://localhost"
)

Variables

View Source
var Version = "dev"

Version is set at build time via ldflags.

Functions

func ValidAPIVersion

func ValidAPIVersion(v string) bool

ValidAPIVersion checks if the given version string is valid.

Types

type Config

type Config struct {
	ClientID   string
	TenantID   string
	APIVersion string
	Authority  string
}

Config holds the runtime configuration.

func Load

func Load() *Config

Load reads configuration from environment variables with sensible defaults.

func (*Config) AuthorityURL

func (c *Config) AuthorityURL() string

AuthorityURL returns the full authority URL for the configured tenant.

func (*Config) GraphURL

func (c *Config) GraphURL(apiVersion string) string

GraphURL returns the full Graph API base URL for the given API version. If apiVersion is empty, the configured default is used.

Jump to

Keyboard shortcuts

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