autoconnections

package
v0.0.0-...-e70f483 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateConnectionName

func GenerateConnectionName(definition ConnectionDefinition, runnerName string) string

Types

type ConnectionDefinition

type ConnectionDefinition struct {
	// FQNPrefix is the identifier used in allowlist matching
	// Example: "com.datadoghq.script"
	FQNPrefix string

	// IntegrationType is the integration type sent to the API
	// Example: "Kubernetes", "Script"
	IntegrationType string

	Credentials CredentialConfig
}

ConnectionDefinition defines all metadata needed to create a connection

func DetermineConnectionsToCreate

func DetermineConnectionsToCreate(actionsAllowlist []string) []ConnectionDefinition

type ConnectionRequest

type ConnectionRequest struct {
	ID          string            `jsonapi:"primary,action_connection"`
	Name        string            `jsonapi:"attribute" json:"name" validate:"required"`
	RunnerID    string            `jsonapi:"attribute" json:"runner_id" validate:"required"`
	Tags        []string          `jsonapi:"attribute" json:"tags"`
	Integration IntegrationConfig `jsonapi:"attribute" json:"integration" validate:"required"`
}

type ConnectionsClient

type ConnectionsClient struct {
	// contains filtered or unexported fields
}

ConnectionsClient is an HTTP client for creating connections via the Datadog API.

func NewConnectionsAPIClient

func NewConnectionsAPIClient(cfg model.Reader, ddSite, apiKey, appKey string) (*ConnectionsClient, error)

func (*ConnectionsClient) CreateConnection

func (c *ConnectionsClient) CreateConnection(ctx context.Context, definition ConnectionDefinition, runnerID, runnerName string, tags []string) error

type ConnectionsCreator

type ConnectionsCreator struct {
	// contains filtered or unexported fields
}

func NewConnectionsCreator

func NewConnectionsCreator(client ConnectionsClient, provider TagsProvider) ConnectionsCreator

func (ConnectionsCreator) AutoCreateConnections

func (c ConnectionsCreator) AutoCreateConnections(ctx context.Context, runnerID string, enrollmentResult *enrollment.Result, actionsAllowlist []string) error

type CredentialConfig

type CredentialConfig struct {
	// Example: "KubernetesServiceAccount", "Script"
	Type string

	// AdditionalFields contains any extra fields needed in the credentials object
	// Example: {"configFileLocation": "/path/to/file"}
	AdditionalFields map[string]interface{}
}

type IntegrationConfig

type IntegrationConfig struct {
	Type        string                 `json:"type" validate:"required"`
	Credentials map[string]interface{} `json:"credentials" validate:"required"`
}

type TagsProvider

type TagsProvider interface {
	GetTags(ctx context.Context, runnerID, hostname string) []string
}

TagsProvider builds connection tags

func NewTagsProvider

func NewTagsProvider(tagger tagger.Component) TagsProvider

NewTagsProvider creates a TagsProvider that uses the tagger component to get cluster tags

Jump to

Keyboard shortcuts

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