azuread

package
v0.53.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 13 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"`

	// OAuth is the oauth config that is being used to authenticate.
	OAuth *OAuthConfig `yaml:"oauth,omitempty"`

	// SDK is the SDK config that is being used to authenticate.
	SDK *SDKConfig `yaml:"sdk,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.

type OAuthConfig added in v0.48.0

type OAuthConfig struct {
	// ClientID is the clientId of the azure active directory application that is being used to authenticate.
	ClientID string `yaml:"client_id,omitempty"`

	// ClientSecret is the clientSecret of the azure active directory application that is being used to authenticate.
	ClientSecret string `yaml:"client_secret,omitempty"`

	// TenantID is the tenantId of the azure active directory application that is being used to authenticate.
	TenantID string `yaml:"tenant_id,omitempty"`
}

OAuthConfig is used to store azure oauth config values.

type SDKConfig added in v0.52.0

type SDKConfig struct {
	// TenantID is the tenantId of the azure active directory application that is being used to authenticate.
	TenantID string `yaml:"tenant_id,omitempty"`
}

SDKConfig is used to store azure SDK config values.

Jump to

Keyboard shortcuts

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