Skip to content

Commit

Permalink
🍱 fix variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlerebourg committed Aug 20, 2023
1 parent aab886e commit e95d44f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Only one instance of the plugin is *possible*.
- string
- default: ""
- Database selection for the Redis service
- DefaultTimeoutSeconds
- HttpTimeoutSeconds
- int64
- default: 10
- Default timeout in seconds for contacting Crowdsec LAPI
Expand Down Expand Up @@ -177,7 +177,7 @@ http:
logLevel: DEBUG
updateIntervalSeconds: 60
defaultDecisionSeconds: 60
defaultTimeoutSeconds: 10
httpTimeoutSeconds: 10
crowdsecMode: live
crowdsecLapiKey: privateKey-foo
crowdsecLapiKeyFile: /etc/traefik/cs-privateKey-foo
Expand Down
2 changes: 1 addition & 1 deletion bouncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func New(ctx context.Context, next http.Handler, config *configuration.Config, n
IdleConnTimeout: 30 * time.Second,
TLSClientConfig: tlsConfig,
},
Timeout: time.Duration(config.DefaultTimeoutSeconds) * time.Second,
Timeout: time.Duration(config.HttpTimeoutSeconds) * time.Second,
},
cacheClient: &cache.Client{},
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type Config struct {
CrowdsecCapiScenarios []string `json:"crowdsecCapiScenarios,omitempty"`
UpdateIntervalSeconds int64 `json:"updateIntervalSeconds,omitempty"`
DefaultDecisionSeconds int64 `json:"defaultDecisionSeconds,omitempty"`
DefaultTimeoutSeconds int64 `json:"defaultTimeoutSeconds,omitempty"`
HttpTimeoutSeconds int64 `json:"httpTimeoutSeconds,omitempty"`
ForwardedHeadersCustomName string `json:"forwardedheaderscustomheader,omitempty"`
ForwardedHeadersTrustedIPs []string `json:"forwardedHeadersTrustedIps,omitempty"`
ClientTrustedIPs []string `json:"clientTrustedIps,omitempty"`
Expand Down Expand Up @@ -82,7 +82,7 @@ func New() *Config {
CrowdsecLapiTLSInsecureVerify: false,
UpdateIntervalSeconds: 60,
DefaultDecisionSeconds: 60,
DefaultTimeoutSeconds: 10,
HttpTimeoutSeconds: 10,
ForwardedHeadersCustomName: "X-Forwarded-For",
ForwardedHeadersTrustedIPs: []string{},
ClientTrustedIPs: []string{},
Expand Down Expand Up @@ -243,7 +243,7 @@ func validateParamsRequired(config *Config) error {
requiredInt := map[string]int64{
"UpdateIntervalSeconds": config.UpdateIntervalSeconds,
"DefaultDecisionSeconds": config.DefaultDecisionSeconds,
"DefaultTimeoutSeconds": config.DefaultTimeoutSeconds,
"HttpTimeoutSeconds": config.HttpTimeoutSeconds,
}
for key, val := range requiredInt {
if val < 1 {
Expand Down

0 comments on commit e95d44f

Please sign in to comment.