From 0b2fbf31f0e2c21d9e1a4e51e698188fae258cb2 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Tue, 18 Nov 2025 11:24:01 +0100 Subject: [PATCH 1/3] chore: clean up golangci-lint configuration (#782) * chore: clean up golangci-lint configuration Signed-off-by: Matthieu MOREL * Update .golangci.yml to remove unused linters Signed-off-by: Matthieu MOREL * Update .golangci.yml to remove excluded paths Removed specific paths from the golangci-lint configuration. Signed-off-by: Matthieu MOREL --------- Signed-off-by: Matthieu MOREL Signed-off-by: Ben Kochie Co-authored-by: Ben Kochie --- .golangci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index db2ad414..110b428f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -162,6 +162,4 @@ formatters: extra-rules: true goimports: local-prefixes: - - github.com/prometheus/common - exclusions: - generated: lax + - github.com/prometheus/common \ No newline at end of file From 04686b2cfc6804598d99b86070135f9266998c59 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 20 Nov 2025 09:17:00 +0100 Subject: [PATCH 2/3] chore: 'omitempty' to Oauth2 fields with type Secret to avoid requiring them (#864) Signed-off-by: Jorge Turrado --- config/http_config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/http_config.go b/config/http_config.go index bc906bc6..7dce315d 100644 --- a/config/http_config.go +++ b/config/http_config.go @@ -239,13 +239,13 @@ func (u URL) MarshalJSON() ([]byte, error) { // OAuth2 is the oauth2 client configuration. type OAuth2 struct { ClientID string `yaml:"client_id" json:"client_id"` - ClientSecret Secret `yaml:"client_secret" json:"client_secret"` + ClientSecret Secret `yaml:"client_secret,omitempty" json:"client_secret,omitempty"` ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"` // ClientSecretRef is the name of the secret within the secret manager to use as the client // secret. ClientSecretRef string `yaml:"client_secret_ref" json:"client_secret_ref"` ClientCertificateKeyID string `yaml:"client_certificate_key_id" json:"client_certificate_key_id"` - ClientCertificateKey Secret `yaml:"client_certificate_key" json:"client_certificate_key"` + ClientCertificateKey Secret `yaml:"client_certificate_key,omitempty" json:"client_certificate_key,omitempty"` ClientCertificateKeyFile string `yaml:"client_certificate_key_file" json:"client_certificate_key_file"` // ClientCertificateKeyRef is the name of the secret within the secret manager to use as the client // secret. From d80d8544703e59a080a204b6f7429ac6561fb24f Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Fri, 21 Nov 2025 14:28:44 +0100 Subject: [PATCH 3/3] chore: Add omitempty tag to all config fields (#865) * chore: Add omitempty tag to all config fields Signed-off-by: Jorge Turrado * chore: Add omitempty tag to all config fields Signed-off-by: Jorge Turrado * chore: Add omitempty tag to all config fields Signed-off-by: Jorge Turrado --------- Signed-off-by: Jorge Turrado --- config/http_config.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/http_config.go b/config/http_config.go index 7dce315d..55cc5b07 100644 --- a/config/http_config.go +++ b/config/http_config.go @@ -136,7 +136,7 @@ func (tv *TLSVersion) String() string { // BasicAuth contains basic HTTP authentication credentials. type BasicAuth struct { - Username string `yaml:"username" json:"username"` + Username string `yaml:"username,omitempty" json:"username,omitempty"` UsernameFile string `yaml:"username_file,omitempty" json:"username_file,omitempty"` // UsernameRef is the name of the secret within the secret manager to use as the username. UsernameRef string `yaml:"username_ref,omitempty" json:"username_ref,omitempty"` @@ -238,22 +238,22 @@ func (u URL) MarshalJSON() ([]byte, error) { // OAuth2 is the oauth2 client configuration. type OAuth2 struct { - ClientID string `yaml:"client_id" json:"client_id"` + ClientID string `yaml:"client_id,omitempty" json:"client_id,omitempty"` ClientSecret Secret `yaml:"client_secret,omitempty" json:"client_secret,omitempty"` - ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"` + ClientSecretFile string `yaml:"client_secret_file,omitempty" json:"client_secret_file,omitempty"` // ClientSecretRef is the name of the secret within the secret manager to use as the client // secret. - ClientSecretRef string `yaml:"client_secret_ref" json:"client_secret_ref"` - ClientCertificateKeyID string `yaml:"client_certificate_key_id" json:"client_certificate_key_id"` + ClientSecretRef string `yaml:"client_secret_ref,omitempty" json:"client_secret_ref,omitempty"` + ClientCertificateKeyID string `yaml:"client_certificate_key_id,omitempty" json:"client_certificate_key_id,omitempty"` ClientCertificateKey Secret `yaml:"client_certificate_key,omitempty" json:"client_certificate_key,omitempty"` - ClientCertificateKeyFile string `yaml:"client_certificate_key_file" json:"client_certificate_key_file"` + ClientCertificateKeyFile string `yaml:"client_certificate_key_file,omitempty" json:"client_certificate_key_file,omitempty"` // ClientCertificateKeyRef is the name of the secret within the secret manager to use as the client // secret. - ClientCertificateKeyRef string `yaml:"client_certificate_key_ref" json:"client_certificate_key_ref"` + ClientCertificateKeyRef string `yaml:"client_certificate_key_ref,omitempty" json:"client_certificate_key_ref,omitempty"` // GrantType is the OAuth2 grant type to use. It can be one of // "client_credentials" or "urn:ietf:params:oauth:grant-type:jwt-bearer" (RFC 7523). // Default value is "client_credentials" - GrantType string `yaml:"grant_type" json:"grant_type"` + GrantType string `yaml:"grant_type,omitempty" json:"grant_type,omitempty"` // SignatureAlgorithm is the RSA algorithm used to sign JWT token. Only used if // GrantType is set to "urn:ietf:params:oauth:grant-type:jwt-bearer". // Default value is RS256 and valid values RS256, RS384, RS512 @@ -271,7 +271,7 @@ type OAuth2 struct { // GrantType is set to "urn:ietf:params:oauth:grant-type:jwt-bearer". Claims map[string]interface{} `yaml:"claims,omitempty" json:"claims,omitempty"` Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"` - TokenURL string `yaml:"token_url" json:"token_url"` + TokenURL string `yaml:"token_url,omitempty" json:"token_url,omitempty"` EndpointParams map[string]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty"` TLSConfig TLSConfig `yaml:"tls_config,omitempty"` ProxyConfig `yaml:",inline"`