@@ -54,9 +54,9 @@ type closeIdler interface {
54
54
55
55
// BasicAuth contains basic HTTP authentication credentials.
56
56
type BasicAuth struct {
57
- Username string `yaml:"username"`
58
- Password Secret `yaml:"password,omitempty"`
59
- PasswordFile string `yaml:"password_file,omitempty"`
57
+ Username string `yaml:"username" json:"username" `
58
+ Password Secret `yaml:"password,omitempty" json:"password,omitempty" `
59
+ PasswordFile string `yaml:"password_file,omitempty" json:"password_file,omitempty" `
60
60
}
61
61
62
62
// SetDirectory joins any relative file paths with dir.
@@ -69,9 +69,9 @@ func (a *BasicAuth) SetDirectory(dir string) {
69
69
70
70
// Authorization contains HTTP authorization credentials.
71
71
type Authorization struct {
72
- Type string `yaml:"type,omitempty"`
73
- Credentials Secret `yaml:"credentials,omitempty"`
74
- CredentialsFile string `yaml:"credentials_file,omitempty"`
72
+ Type string `yaml:"type,omitempty" json:"type,omitempty" `
73
+ Credentials Secret `yaml:"credentials,omitempty" json:"credentials,omitempty" `
74
+ CredentialsFile string `yaml:"credentials_file,omitempty" json:"credentials_file,omitempty" `
75
75
}
76
76
77
77
// SetDirectory joins any relative file paths with dir.
@@ -112,12 +112,12 @@ func (u URL) MarshalYAML() (interface{}, error) {
112
112
113
113
// OAuth2 is the oauth2 client configuration.
114
114
type OAuth2 struct {
115
- ClientID string `yaml:"client_id"`
116
- ClientSecret Secret `yaml:"client_secret"`
117
- ClientSecretFile string `yaml:"client_secret_file"`
118
- Scopes []string `yaml:"scopes,omitempty"`
119
- TokenURL string `yaml:"token_url"`
120
- EndpointParams map [string ]string `yaml:"endpoint_params,omitempty"`
115
+ ClientID string `yaml:"client_id" json:"client_id" `
116
+ ClientSecret Secret `yaml:"client_secret" json:"client_secret" `
117
+ ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file" `
118
+ Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty" `
119
+ TokenURL string `yaml:"token_url" json:"token_url" `
120
+ EndpointParams map [string ]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty" `
121
121
}
122
122
123
123
// SetDirectory joins any relative file paths with dir.
@@ -131,25 +131,25 @@ func (a *OAuth2) SetDirectory(dir string) {
131
131
// HTTPClientConfig configures an HTTP client.
132
132
type HTTPClientConfig struct {
133
133
// The HTTP basic authentication credentials for the targets.
134
- BasicAuth * BasicAuth `yaml:"basic_auth,omitempty"`
134
+ BasicAuth * BasicAuth `yaml:"basic_auth,omitempty" json:"basic_auth,omitempty" `
135
135
// The HTTP authorization credentials for the targets.
136
- Authorization * Authorization `yaml:"authorization,omitempty"`
136
+ Authorization * Authorization `yaml:"authorization,omitempty" json:"authorization,omitempty" `
137
137
// The OAuth2 client credentials used to fetch a token for the targets.
138
- OAuth2 * OAuth2 `yaml:"oauth2,omitempty"`
138
+ OAuth2 * OAuth2 `yaml:"oauth2,omitempty" json:"oauth2,omitempty" `
139
139
// The bearer token for the targets. Deprecated in favour of
140
140
// Authorization.Credentials.
141
- BearerToken Secret `yaml:"bearer_token,omitempty"`
141
+ BearerToken Secret `yaml:"bearer_token,omitempty" json:"bearer_token,omitempty" `
142
142
// The bearer token file for the targets. Deprecated in favour of
143
143
// Authorization.CredentialsFile.
144
- BearerTokenFile string `yaml:"bearer_token_file,omitempty"`
144
+ BearerTokenFile string `yaml:"bearer_token_file,omitempty" json:"bearer_token_file,omitempty" `
145
145
// HTTP proxy server to use to connect to the targets.
146
- ProxyURL URL `yaml:"proxy_url,omitempty"`
146
+ ProxyURL URL `yaml:"proxy_url,omitempty" json:"proxy_url,omitempty" `
147
147
// TLSConfig to use to connect to the targets.
148
- TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
148
+ TLSConfig TLSConfig `yaml:"tls_config,omitempty" json:"tls_config,omitempty" `
149
149
// FollowRedirects specifies whether the client should follow HTTP 3xx redirects.
150
150
// The omitempty flag is not set, because it would be hidden from the
151
151
// marshalled configuration when set to false.
152
- FollowRedirects bool `yaml:"follow_redirects"`
152
+ FollowRedirects bool `yaml:"follow_redirects" json:"follow_redirects" `
153
153
}
154
154
155
155
// SetDirectory joins any relative file paths with dir.
@@ -616,15 +616,15 @@ func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
616
616
// TLSConfig configures the options for TLS connections.
617
617
type TLSConfig struct {
618
618
// The CA cert to use for the targets.
619
- CAFile string `yaml:"ca_file,omitempty"`
619
+ CAFile string `yaml:"ca_file,omitempty" json:"ca_file,omitempty" `
620
620
// The client cert file for the targets.
621
- CertFile string `yaml:"cert_file,omitempty"`
621
+ CertFile string `yaml:"cert_file,omitempty" json:"cert_file,omitempty" `
622
622
// The client key file for the targets.
623
- KeyFile string `yaml:"key_file,omitempty"`
623
+ KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty" `
624
624
// Used to verify the hostname for the targets.
625
- ServerName string `yaml:"server_name,omitempty"`
625
+ ServerName string `yaml:"server_name,omitempty" json:"server_name,omitempty" `
626
626
// Disable target certificate validation.
627
- InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
627
+ InsecureSkipVerify bool `yaml:"insecure_skip_verify" json:"insecure_skip_verify" `
628
628
}
629
629
630
630
// SetDirectory joins any relative file paths with dir.
0 commit comments