mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2025-11-08 15:15:05 +01:00
🍱 revert unnecessary code
This commit is contained in:
@@ -232,7 +232,6 @@ func New(_ context.Context, next http.Handler, config *configuration.Config, nam
|
||||
)
|
||||
config.CaptchaSiteKey, _ = configuration.GetVariable(config, "CaptchaSiteKey")
|
||||
config.CaptchaSecretKey, _ = configuration.GetVariable(config, "CaptchaSecretKey")
|
||||
|
||||
err = bouncer.captchaClient.New(
|
||||
log,
|
||||
bouncer.cacheClient,
|
||||
|
||||
@@ -28,8 +28,8 @@ type Client struct {
|
||||
infoProvider *InfoProvider
|
||||
}
|
||||
|
||||
// InfoProvider Information for self-hosted provider.
|
||||
type InfoProvider struct {
|
||||
// Information for self-hosted provider.
|
||||
type infoProvider struct {
|
||||
js string
|
||||
key string
|
||||
response string
|
||||
@@ -37,7 +37,7 @@ type InfoProvider struct {
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var infoProviders = map[string]*InfoProvider{
|
||||
var infoProviders = map[string]*infoProvider{
|
||||
configuration.HcaptchaProvider: {
|
||||
js: "https://hcaptcha.com/1/api.js",
|
||||
key: "h-captcha",
|
||||
@@ -64,9 +64,9 @@ func (c *Client) New(log *logger.Log, cacheClient *cache.Client, httpClient *htt
|
||||
if !c.Valid {
|
||||
return nil
|
||||
}
|
||||
var infoProvider *InfoProvider
|
||||
var infoProvider *infoProvider
|
||||
if provider == configuration.CustomProvider {
|
||||
infoProvider = &InfoProvider{js: js, key: key, response: response, validate: validate}
|
||||
infoProvider = &infoProvider{js: js, key: key, response: response, validate: validate}
|
||||
} else {
|
||||
infoProvider = infoProviders[provider]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user