Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-bronnikov committed Feb 12, 2025
1 parent 97a801b commit c024be9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/authenticator/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func (a *Authenticator) getApiKeyByXCustomProvider(req *http.Request, xCustomPro
err = internal_errors.NewAuthError("provider settings error")
return
}
header := req.Header.Get(xCustomSetting.Header)
key, err = xcustom.ExtractBricksKey(header, xCustomSetting.MaskAuth)
header := req.Header.Get(xCustomSetting.AuthHeader)
key, err = xcustom.ExtractBricksKey(header, xCustomSetting.AuthTemplate)
if err != nil {
err = internal_errors.NewAuthError("provider settings error")
return
Expand Down
8 changes: 4 additions & 4 deletions internal/manager/provider_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ func findMissingAuthParams(providerName string, params map[string]string) string
if len(val) == 0 {
missingFields = append(missingFields, "endpoint")
}
val = params["header"]
val = params["authHeader"]
if len(val) == 0 {
missingFields = append(missingFields, "header")
missingFields = append(missingFields, "authHeader")
}
val = params["maskAuth"]
val = params["authTemplate"]
if !strings.Contains(val, "{{apikey}}") {
missingFields = append(missingFields, "maskAuth")
missingFields = append(missingFields, "authTemplate")
}
}

Expand Down
8 changes: 4 additions & 4 deletions internal/provider/xcustom/xcustom.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
)

type XCustomSettings struct {
Apikey string `json:"apikey"`
Endpoint string `json:"endpoint"`
Header string `json:"header"`
MaskAuth string `json:"maskAuth"`
Apikey string `json:"apikey"`
Endpoint string `json:"endpoint"`
AuthHeader string `json:"authHeader"`
AuthTemplate string `json:"authTemplate"`
}

const XProviderIdParam = "x_provider_id"
Expand Down

0 comments on commit c024be9

Please sign in to comment.