@@ -136,7 +136,7 @@ func (tv *TLSVersion) String() string {
136136
137137// BasicAuth contains basic HTTP authentication credentials.
138138type BasicAuth struct {
139- Username string `yaml:"username" json:"username"`
139+ Username string `yaml:"username,omitempty " json:"username,omitempty "`
140140 UsernameFile string `yaml:"username_file,omitempty" json:"username_file,omitempty"`
141141 // UsernameRef is the name of the secret within the secret manager to use as the username.
142142 UsernameRef string `yaml:"username_ref,omitempty" json:"username_ref,omitempty"`
@@ -238,22 +238,22 @@ func (u URL) MarshalJSON() ([]byte, error) {
238238
239239// OAuth2 is the oauth2 client configuration.
240240type OAuth2 struct {
241- ClientID string `yaml:"client_id" json:"client_id"`
241+ ClientID string `yaml:"client_id,omitempty " json:"client_id,omitempty "`
242242 ClientSecret Secret `yaml:"client_secret,omitempty" json:"client_secret,omitempty"`
243- ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"`
243+ ClientSecretFile string `yaml:"client_secret_file,omitempty " json:"client_secret_file,omitempty "`
244244 // ClientSecretRef is the name of the secret within the secret manager to use as the client
245245 // secret.
246- ClientSecretRef string `yaml:"client_secret_ref" json:"client_secret_ref"`
247- ClientCertificateKeyID string `yaml:"client_certificate_key_id" json:"client_certificate_key_id"`
246+ ClientSecretRef string `yaml:"client_secret_ref,omitempty " json:"client_secret_ref,omitempty "`
247+ ClientCertificateKeyID string `yaml:"client_certificate_key_id,omitempty " json:"client_certificate_key_id,omitempty "`
248248 ClientCertificateKey Secret `yaml:"client_certificate_key,omitempty" json:"client_certificate_key,omitempty"`
249- ClientCertificateKeyFile string `yaml:"client_certificate_key_file" json:"client_certificate_key_file"`
249+ ClientCertificateKeyFile string `yaml:"client_certificate_key_file,omitempty " json:"client_certificate_key_file,omitempty "`
250250 // ClientCertificateKeyRef is the name of the secret within the secret manager to use as the client
251251 // secret.
252- ClientCertificateKeyRef string `yaml:"client_certificate_key_ref" json:"client_certificate_key_ref"`
252+ ClientCertificateKeyRef string `yaml:"client_certificate_key_ref,omitempty " json:"client_certificate_key_ref,omitempty "`
253253 // GrantType is the OAuth2 grant type to use. It can be one of
254254 // "client_credentials" or "urn:ietf:params:oauth:grant-type:jwt-bearer" (RFC 7523).
255255 // Default value is "client_credentials"
256- GrantType string `yaml:"grant_type" json:"grant_type"`
256+ GrantType string `yaml:"grant_type,omitempty " json:"grant_type,omitempty "`
257257 // SignatureAlgorithm is the RSA algorithm used to sign JWT token. Only used if
258258 // GrantType is set to "urn:ietf:params:oauth:grant-type:jwt-bearer".
259259 // Default value is RS256 and valid values RS256, RS384, RS512
@@ -271,7 +271,7 @@ type OAuth2 struct {
271271 // GrantType is set to "urn:ietf:params:oauth:grant-type:jwt-bearer".
272272 Claims map [string ]interface {} `yaml:"claims,omitempty" json:"claims,omitempty"`
273273 Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
274- TokenURL string `yaml:"token_url" json:"token_url"`
274+ TokenURL string `yaml:"token_url,omitempty " json:"token_url,omitempty "`
275275 EndpointParams map [string ]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty"`
276276 TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
277277 ProxyConfig `yaml:",inline"`
0 commit comments