types

package
v0.0.0-...-3ec880f Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractInputs

func ExtractInputs[T any](task *Task) (T, error)

Types

type Action

type Action interface {
	Run(
		ctx context.Context,
		task *Task,
		credential *privateconnection.PrivateCredentials,
	) (interface{}, error)
}

type Attributes

type Attributes struct {
	Name                  string                                          `json:"name"`
	BundleID              string                                          `json:"bundle_id"`
	SecDatadogHeaderValue string                                          `json:"sec_datadog_header_value"`
	Inputs                map[string]interface{}                          `json:"inputs"`
	Client                actionsclientpb.Client                          `json:"client"`
	OrgId                 int64                                           `json:"org_id"`
	JobId                 string                                          `json:"job_id"`
	SignedEnvelope        *privateactionspb.RemoteConfigSignatureEnvelope `json:"signed_envelope"`
	ConnectionInfo        *privateactionspb.ConnectionInfo                `json:"connection_info"`
	TraceId               uint64                                          `json:"trace_id,omitempty"`
	SpanId                uint64                                          `json:"span_id,omitempty"`
}

type Bundle

type Bundle interface {
	GetAction(actionName string) Action
}

type DecodedKey

type DecodedKey interface {
	GetKeyType() KeyType
	Verify(data, signature []byte) error
}

type ED25519Key

type ED25519Key struct {
	KeyType KeyType
	Key     ed25519.PublicKey
}

func (ED25519Key) GetKeyType

func (key ED25519Key) GetKeyType() KeyType

func (ED25519Key) Verify

func (key ED25519Key) Verify(data, signature []byte) error

type EnrollmentData

type EnrollmentData struct {
	DDBaseURL        string   `json:"ddBaseUrl"`
	OrgID            int64    `json:"orgId"`
	RunnerID         string   `json:"runnerId"`
	RunnerModes      []string `json:"runnerModes"`
	ActionsAllowlist []string `json:"actionsAllowlist"`
	PrivateKey       []byte   `json:"privateKey"`
}

EnrollmentData represents the unified enrollment information needed to create a runner configuration

type EnrollmentOptions

type EnrollmentOptions struct {
	EnrollOnly   bool   // Enrolls and exits (replaces --enroll-and-print-config)
	ResultFormat string // Output format: "config", "helm-values", "env" (default: "config")
	ResultOutput string // File path to save enrollment result (default: stdout)
	UseAPIKey    bool   // Use API key authentication instead of enrollment token
}

EnrollmentOptions represents options for the enrollment process

type KeyType

type KeyType string
const (
	KeyTypeX509RSA KeyType = "X509_RSA"
	KeyTypeED25519 KeyType = "ED25519"
)

func (KeyType) ToPbKeyType

func (k KeyType) ToPbKeyType() privateactionspb.KeyType

type RawKey

type RawKey struct {
	KeyType KeyType `json:"keyType"`
	Key     []byte  `json:"key"`
}

raw key type used only for initial json unmarshalling

type Task

type Task struct {
	Data struct {
		ID         string      `json:"id,omitempty"`
		Type       string      `json:"type,omitempty"`
		Attributes *Attributes `json:"attributes,omitempty"`
	} `json:"data,omitempty"`
	Raw []byte `json:"-"`
}

func (*Task) GetFQN

func (task *Task) GetFQN() string

func (*Task) TimeoutSeconds

func (task *Task) TimeoutSeconds() *int32

TimeoutSeconds returns the timeout from the task inputs if present, positive, and within int32 range. Returns nil (fall back to config) for missing, non-integer, non-positive, or out-of-range values.

func (*Task) Validate

func (task *Task) Validate() error

type X509RSAKey

type X509RSAKey struct {
	KeyType KeyType
	Key     *rsa.PublicKey
}

we support x509RSA and ED25519 keys

func (X509RSAKey) GetKeyType

func (key X509RSAKey) GetKeyType() KeyType

func (X509RSAKey) Verify

func (key X509RSAKey) Verify(data, signature []byte) error

Jump to

Keyboard shortcuts

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