azsettings

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AzurePublic       = "AzureCloud"
	AzureChina        = "AzureChinaCloud"
	AzureUSGovernment = "AzureUSGovernment"
	AzureCustomized   = "AzureCustomizedCloud"
)
View Source
const (
	AzureCloud              = "GFAZPL_AZURE_CLOUD"
	AzureCustomCloudsConfig = "GFAZPL_AZURE_CLOUDS_CONFIG"

	AzureAuthEnabled = "GFAZPL_AZURE_AUTH_ENABLED"

	ManagedIdentityEnabled  = "GFAZPL_MANAGED_IDENTITY_ENABLED"
	ManagedIdentityClientID = "GFAZPL_MANAGED_IDENTITY_CLIENT_ID"

	WorkloadIdentityEnabled   = "GFAZPL_WORKLOAD_IDENTITY_ENABLED"
	WorkloadIdentityTenantID  = "GFAZPL_WORKLOAD_IDENTITY_TENANT_ID"
	WorkloadIdentityClientID  = "GFAZPL_WORKLOAD_IDENTITY_CLIENT_ID"
	WorkloadIdentityTokenFile = "GFAZPL_WORKLOAD_IDENTITY_TOKEN_FILE"

	UserIdentityEnabled                    = "GFAZPL_USER_IDENTITY_ENABLED"
	UserIdentityTokenURL                   = "GFAZPL_USER_IDENTITY_TOKEN_URL"
	UserIdentityClientID                   = "GFAZPL_USER_IDENTITY_CLIENT_ID"
	UserIdentityClientSecret               = "GFAZPL_USER_IDENTITY_CLIENT_SECRET"
	UserIdentityAssertion                  = "GFAZPL_USER_IDENTITY_ASSERTION"
	UserIdentityFallbackCredentialsEnabled = "GFAZPL_USER_IDENTITY_FALLBACK_SERVICE_CREDENTIALS_ENABLED"

	AzureEntraPasswordCredentialsEnabled = "GFAZPL_AZURE_ENTRA_PASSWORD_CREDENTIALS_ENABLED"
)

Variables

This section is empty.

Functions

func NormalizeAzureCloud

func NormalizeAzureCloud(cloudName string) string

func WriteToEnvStr

func WriteToEnvStr(azureSettings *AzureSettings) []string

Types

type AzureCloudInfo

type AzureCloudInfo struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
}

type AzureCloudSettings

type AzureCloudSettings struct {
	Name         string            `json:"name"`
	DisplayName  string            `json:"displayName"`
	AadAuthority string            `json:"aadAuthority"`
	Properties   map[string]string `json:"properties"`
}

type AzureSettings

type AzureSettings struct {
	AzureAuthEnabled        bool
	Cloud                   string
	ManagedIdentityEnabled  bool
	ManagedIdentityClientId string

	WorkloadIdentityEnabled  bool
	WorkloadIdentitySettings *WorkloadIdentitySettings

	UserIdentityEnabled                    bool
	UserIdentityTokenEndpoint              *TokenEndpointSettings
	UserIdentityFallbackCredentialsEnabled bool

	// This field determines which plugins will receive the settings via plugin context
	ForwardSettingsPlugins []string

	CustomCloudList     []*AzureCloudSettings
	CustomCloudListJSON string

	AzureEntraPasswordCredentialsEnabled bool
}

func ReadFromEnv

func ReadFromEnv() (*AzureSettings, error)

func ReadSettings

func ReadSettings(ctx context.Context) (*AzureSettings, error)

func (*AzureSettings) Clouds

func (settings *AzureSettings) Clouds() []AzureCloudInfo

Returns all clouds configured on the instance, including custom clouds if any

func (*AzureSettings) CustomClouds

func (settings *AzureSettings) CustomClouds() []AzureCloudInfo

Returns only the custom clouds configured on the instance

func (*AzureSettings) GetCloud

func (settings *AzureSettings) GetCloud(cloudName string) (*AzureCloudSettings, error)

func (*AzureSettings) GetDefaultCloud

func (settings *AzureSettings) GetDefaultCloud() string

func (*AzureSettings) SetCustomClouds

func (settings *AzureSettings) SetCustomClouds(customCloudsJSON string) error

Parses the JSON list of custom clouds passed in, then stores the list on the instance

type TokenEndpointSettings

type TokenEndpointSettings struct {
	TokenUrl     string
	ClientId     string
	ClientSecret string

	// UsernameAssertion allows to use a custom token request assertion when Grafana is behind auth proxy
	UsernameAssertion bool
}

type WorkloadIdentitySettings

type WorkloadIdentitySettings struct {
	TenantId  string
	ClientId  string
	TokenFile string
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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