delegatedauth

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package delegatedauth manages cloud-based delegated authentication for the agent.

It fetches and refreshes Datadog API keys from cloud providers (e.g., AWS IAM) and automatically updates the agent's configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	// AddInstance configures a specific API key instance.
	// On the first call, it detects the cloud provider and initializes the component.
	// Fetches the initial API key, writes it to config, and starts a background refresh goroutine.
	// Can be called multiple times with different APIKeyConfigKey values.
	// The context is used for the initial API key fetch and cloud provider detection;
	// background refresh goroutines use their own cancellable context.
	// Returns an error if Config or OrgUUID is empty.
	AddInstance(ctx context.Context, params InstanceParams) error
}

Component manages cloud-based delegated authentication.

Usage: Call AddInstance() for each API key to manage. The first call auto-detects the cloud provider and initializes the component. Each instance starts a background goroutine that periodically refreshes the API key and writes it to the config. Thread-safe.

type InstanceParams

type InstanceParams struct {
	// Config is used to read settings and write API keys. Required.
	// IMPORTANT: Only the Config from the FIRST AddInstance call is used.
	// Subsequent calls must pass the same config instance; passing a different
	// config will be ignored and a warning will be logged.
	Config pkgconfigmodel.ReaderWriter

	// OrgUUID is the Datadog organization UUID. Required.
	OrgUUID string

	// RefreshInterval in minutes. Defaults to 60 if not specified.
	RefreshInterval int

	// APIKeyConfigKey is where to write the API key (e.g., "api_key", "logs_config.api_key").
	// Required.
	APIKeyConfigKey string

	// ProviderConfig contains provider-specific configuration.
	// Use cloudauth.AWSProviderConfig for AWS, etc.
	// If nil, auto-detects from the environment (only used on first call).
	ProviderConfig common.ProviderConfig
}

InstanceParams configures a single API key instance.

Jump to

Keyboard shortcuts

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