azuread

package
v0.45.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

README

azuread package

azuread provides an http.RoundTripper that attaches an Azure AD accessToken to remote write requests.

This module is considered internal to Prometheus, without any stability guarantees for external usage.

Documentation

Index

Constants

View Source
const (
	// Clouds.
	AzureChina      = "AzureChina"
	AzureGovernment = "AzureGovernment"
	AzurePublic     = "AzurePublic"

	// Audiences.
	IngestionChinaAudience      = "https://monitor.azure.cn//.default"
	IngestionGovernmentAudience = "https://monitor.azure.us//.default"
	IngestionPublicAudience     = "https://monitor.azure.com//.default"
)

Variables

This section is empty.

Functions

func NewAzureADRoundTripper

func NewAzureADRoundTripper(cfg *AzureADConfig, next http.RoundTripper) (http.RoundTripper, error)

NewAzureADRoundTripper creates round tripper adding Azure AD authorization to calls.

Types

type AzureADConfig

type AzureADConfig struct {
	// ManagedIdentity is the managed identity that is being used to authenticate.
	ManagedIdentity *ManagedIdentityConfig `yaml:"managed_identity,omitempty"`

	// Cloud is the Azure cloud in which the service is running. Example: AzurePublic/AzureGovernment/AzureChina.
	Cloud string `yaml:"cloud,omitempty"`
}

AzureADConfig is used to store the config values.

func (*AzureADConfig) UnmarshalYAML

func (c *AzureADConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshal the Azure AD config yaml.

func (*AzureADConfig) Validate

func (c *AzureADConfig) Validate() error

Validate validates config values provided.

type ManagedIdentityConfig

type ManagedIdentityConfig struct {
	// ClientID is the clientId of the managed identity that is being used to authenticate.
	ClientID string `yaml:"client_id,omitempty"`
}

ManagedIdentityConfig is used to store managed identity config values

Jump to

Keyboard shortcuts

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