config

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ConfigFileNameBase   = "code-security.datadog"
	LegacyConfigFileName = "dd-iac-scan.config"
)

Variables

This section is empty.

Functions

func UnparseConfig added in v1.1.1

func UnparseConfig(cfg *IacConfig) ([]byte, error)

UnparseConfig turns a parsed configuration into a YAML file. It ignores the LegacyExcludeResults field, since it's not representable in YAML. You will need to handle it externally if you need to.

Types

type IacConfig

type IacConfig struct {
	IgnoreRules      []string
	OnlyRules        []string
	IgnorePaths      []string
	OnlyPaths        []string
	IgnoreSeverities []string
	OnlySeverities   []string
	IgnoreCategories []string
	OnlyCategories   []string

	LegacyExcludeResults []string
}

func ParseConfig

func ParseConfig(cfgBytes []byte) (*IacConfig, error)

ParseConfig turns a YAML configuration file into a parsed configuration

func ReadConfiguration

func ReadConfiguration(ctx context.Context, rootPath string, options ...ReadConfigurationOption) (*IacConfig, []byte, error)

ReadConfiguration reads and parses the configuration file in the local repository. It returns the parsed configuration and the YAML file (or a YAML conversion, in the case of legacy configurations).

type InvalidLocalConfigError added in v1.2.0

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

InvalidLocalConfigError is returned when the local IaC configuration file cannot be read or parsed. It does NOT cover errors from remote config sources such as Datadog API calls via WithDatadog.

func (*InvalidLocalConfigError) Error added in v1.2.0

func (e *InvalidLocalConfigError) Error() string

func (*InvalidLocalConfigError) Unwrap added in v1.2.0

func (e *InvalidLocalConfigError) Unwrap() error

type ReadConfigurationOption added in v1.1.1

type ReadConfigurationOption func(context.Context, []byte) ([]byte, error)

func WithDatadog added in v1.1.1

func WithDatadog(client datadog.Client, repoUrl string) ReadConfigurationOption

WithDatadog calls the Datadog backend to append server-side customizations to the local repo config

Jump to

Keyboard shortcuts

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