mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -08:00
Add overflow check in TLS config
This commit is contained in:
parent
1b206efdb9
commit
180da1ba65
|
@ -314,6 +314,18 @@ type TLSConfig struct {
|
||||||
KeyFile string `yaml:"key_file,omitempty"`
|
KeyFile string `yaml:"key_file,omitempty"`
|
||||||
// Disable target certificate validation.
|
// Disable target certificate validation.
|
||||||
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
|
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
|
||||||
|
|
||||||
|
// Catches all undefined fields and must be empty after parsing.
|
||||||
|
XXX map[string]interface{} `yaml:",inline"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalYAML implements the yaml.Unmarshaler interface.
|
||||||
|
func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
|
type plain TLSConfig
|
||||||
|
if err := unmarshal((*plain)(c)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return checkOverflow(c.XXX, "TLS config")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrapeConfig configures a scraping unit for Prometheus.
|
// ScrapeConfig configures a scraping unit for Prometheus.
|
||||||
|
|
Loading…
Reference in a new issue