Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] prevent unkeyed literal initialization #38385

Merged
merged 3 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extension/ackextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ type Config struct {
MaxNumPartition uint64 `mapstructure:"max_number_of_partition"`
// MaxNumPendingAcksPerPartition Specifies the maximum number of ackIDs and their corresponding status information that are waiting to be queried in each partition.
MaxNumPendingAcksPerPartition uint64 `mapstructure:"max_number_of_pending_acks_per_partition"`
// prevent unkeyed literal initialization
_ struct{}
}
2 changes: 2 additions & 0 deletions extension/asapauthextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type Config struct {
Audience []string `mapstructure:"audience"`

PrivateKey configopaque.String `mapstructure:"private_key"`
// prevent unkeyed literal initialization
_ struct{}
}

func (c *Config) Validate() error {
Expand Down
2 changes: 2 additions & 0 deletions extension/awsproxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ import (
type Config struct {
// ProxyServer defines configurations related to the local TCP proxy server.
ProxyConfig proxy.Config `mapstructure:",squash"`
// prevent unkeyed literal initialization
_ struct{}
}
6 changes: 6 additions & 0 deletions extension/basicauthextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,26 @@ type HtpasswdSettings struct {
File string `mapstructure:"file"`
// Inline contents of the htpasswd file.
Inline string `mapstructure:"inline"`
// prevent unkeyed literal initialization
_ struct{}
}

type ClientAuthSettings struct {
// Username holds the username to use for client authentication.
Username string `mapstructure:"username"`
// Password holds the password to use for client authentication.
Password configopaque.String `mapstructure:"password"`
// prevent unkeyed literal initialization
_ struct{}
}
type Config struct {
// Htpasswd settings.
Htpasswd *HtpasswdSettings `mapstructure:"htpasswd,omitempty"`

// ClientAuth settings
ClientAuth *ClientAuthSettings `mapstructure:"client_auth,omitempty"`
// prevent unkeyed literal initialization
_ struct{}
}

func (cfg *Config) Validate() error {
Expand Down
3 changes: 3 additions & 0 deletions extension/bearertokenauthextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ type Config struct {

// Filename points to a file that contains the bearer token(s) to use for every RPC.
Filename string `mapstructure:"filename,omitempty"`

// prevent unkeyed literal initialization
_ struct{}
}

var (
Expand Down
6 changes: 6 additions & 0 deletions extension/cgroupruntimeextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ import "errors" // Config contains the configuration for the cgroup runtime exte
type Config struct {
GoMaxProcs GoMaxProcsConfig `mapstructure:"gomaxprocs"`
GoMemLimit GoMemLimitConfig `mapstructure:"gomemlimit"`
// prevent unkeyed literal initialization
_ struct{}
}

type GoMaxProcsConfig struct {
Enabled bool `mapstructure:"enabled"`
// prevent unkeyed literal initialization
_ struct{}
}

type GoMemLimitConfig struct {
Enabled bool `mapstructure:"enabled"`
Ratio float64 `mapstructure:"ratio"`
// prevent unkeyed literal initialization
_ struct{}
}

// Validate checks if the extension configuration is valid
Expand Down
Loading