Documentation ¶
Index ¶
- Constants
- Variables
- type APMSamplingConfig
- type CachedFile
- type ConfigASMDD
- type ConfigCWSDD
- type ConfigState
- type FeaturesConfig
- type FeaturesData
- type Metadata
- type Repository
- func (r *Repository) APMConfigs() map[string]APMSamplingConfig
- func (r *Repository) ASMDDConfigs() map[string]ConfigASMDD
- func (r *Repository) CWSDDConfigs() map[string]ConfigCWSDD
- func (r *Repository) CurrentState() (RepositoryState, error)
- func (r *Repository) FeaturesConfigs() map[string]FeaturesConfig
- func (r *Repository) Update(update Update) ([]string, error)
- type RepositoryState
- type Update
Constants ¶
const ( // ProductAPMSampling is the apm sampling product ProductAPMSampling = "APM_SAMPLING" // ProductCWSDD is the cloud workload security product managed by datadog employees ProductCWSDD = "CWS_DD" // ProductFeatures is a pseudo-product that lists whether or not a product should be enabled in a tracer ProductFeatures = "FEATURES" // ProductASMDD is the application security monitoring product managed by datadog employees ProductASMDD = "ASM_DD" )
Variables ¶
var ( // ErrMalformedEmbeddedRoot occurs when the TUF root provided is invalid ErrMalformedEmbeddedRoot = errors.New("malformed embedded TUF root file provided") )
var ErrNoConfigVersion = errors.New("version missing in custom file meta")
ErrNoConfigVersion occurs when a target file's custom meta is missing the config version
Functions ¶
This section is empty.
Types ¶
type APMSamplingConfig ¶
type APMSamplingConfig struct { Config apmsampling.APMSampling Metadata Metadata }
APMSamplingConfig is a deserialized APM Sampling configuration file along with its associated remote config metadata.
type CachedFile ¶
CachedFile describes a cached file stored by the agent client
Note: You may be wondering why this exists when `ConfigState` exists as well. The API for requesting updates does not mandate that a client cache config files. This implementation just happens to do so.
type ConfigASMDD ¶
ConfigASMDD is a deserialized ASM DD configuration file along with its associated remote config metadata
type ConfigCWSDD ¶
ConfigCWSDD is a deserialized CWS DD configuration file along with its associated remote config metadata
type ConfigState ¶
ConfigState describes an applied config by the agent client.
type FeaturesConfig ¶
type FeaturesConfig struct { Config FeaturesData Metadata Metadata }
FeaturesConfig is a deserialized configuration file that indicates what features should be enabled within a tracer, along with its associated remote config metadata.
type FeaturesData ¶
type FeaturesData struct { ASM struct { Enabled bool `json:"enabled"` } `json:"asm"` }
FeaturesData describes the enabled state of features
type Metadata ¶
type Metadata struct { Product string ID string Name string Version uint64 RawLength uint64 Hashes map[string][]byte }
Metadata stores remote config metadata for a given configuration
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is a remote config client used in a downstream process to retrieve remote config updates from an Agent.
func NewRepository ¶
func NewRepository(embeddedRoot []byte) (*Repository, error)
NewRepository creates a new remote config repository that will track both TUF metadata and raw config files for a client.
func (*Repository) APMConfigs ¶
func (r *Repository) APMConfigs() map[string]APMSamplingConfig
APMConfigs returns the currently active APM configs
func (*Repository) ASMDDConfigs ¶
func (r *Repository) ASMDDConfigs() map[string]ConfigASMDD
ASMDDConfigs returns the currently active ASMDD configs
func (*Repository) CWSDDConfigs ¶
func (r *Repository) CWSDDConfigs() map[string]ConfigCWSDD
CWSDDConfigs returns the currently active CWSDD config files
func (*Repository) CurrentState ¶
func (r *Repository) CurrentState() (RepositoryState, error)
CurrentState returns all of the information needed to make an update for new configurations.
func (*Repository) FeaturesConfigs ¶
func (r *Repository) FeaturesConfigs() map[string]FeaturesConfig
FeaturesConfigs returns the currently active Features configs
type RepositoryState ¶
type RepositoryState struct { Configs []ConfigState CachedFiles []CachedFile TargetsVersion int64 RootsVersion int64 OpaqueBackendState []byte }
RepositoryState contains all of the information about the current config files stored by the client to be able to make an update request to an Agent
type Update ¶
type Update struct { // TUFRoots contains, in order, updated roots that this repository needs to keep up with TUF validation TUFRoots [][]byte // TUFTargets is the latest TUF Targets file and is used to validate raw config files TUFTargets []byte // TargetFiles stores the raw config files by their full TUF path TargetFiles map[string][]byte // ClientcConfigs is a list of TUF path's corresponding to config files designated for this repository ClientConfigs []string }
An Update contains all the data needed to update a client's remote config repository state