Skip to content

Commit 2cd9473

Browse files
committed
debug
1 parent 7c6a784 commit 2cd9473

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

internals/proxy/middlewares/body.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func (data BodyMiddleware) Use() http.Handler {
2020
next := data.Next
2121

2222
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
23-
messageAliases := GetSettings(req).MESSAGE_ALIASES
23+
messageAliases := getSettings(req).MESSAGE_ALIASES
2424

2525
body, err := request.GetReqBody(w, req)
2626

internals/proxy/middlewares/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type contextKey string
2323

2424
const tokenKey contextKey = "token"
2525

26-
func GetSettings(req *http.Request) config.SETTING_ {
26+
func getSettings(req *http.Request) config.SETTING_ {
2727
token := req.Context().Value(tokenKey).(string)
2828

2929
settings := config.ENV.SETTINGS[token]

internals/proxy/middlewares/endpoints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func (data EndpointsMiddleware) Use() http.Handler {
1515
next := data.Next
1616

1717
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
18-
blockedEndpoints := GetSettings(req).BLOCKED_ENDPOINTS
18+
blockedEndpoints := getSettings(req).BLOCKED_ENDPOINTS
1919

2020
reqPath := req.URL.Path
2121

internals/proxy/middlewares/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func (data TemplateMiddleware) Use() http.Handler {
2222
next := data.Next
2323

2424
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
25-
variables := GetSettings(req).VARIABLES
25+
variables := getSettings(req).VARIABLES
2626

2727
body, err := request.GetReqBody(w, req)
2828

utils/config/token-config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
type TOKEN_CONFIG_ struct {
1212
TOKENS []string `koanf:"tokens"`
13-
OVERRIDES *SETTING_ `koanf:"overrides"`
13+
OVERRIDES SETTING_ `koanf:"overrides"`
1414
}
1515

1616
func LoadTokens() {
@@ -35,7 +35,7 @@ func InitTokens() {
3535
for token, override := range overrides {
3636
apiTokens = append(apiTokens, token)
3737

38-
ENV.SETTINGS[token] = override
38+
*ENV.SETTINGS[token] = override
3939
}
4040

4141
if len(apiTokens) <= 0 {
@@ -57,8 +57,8 @@ func InitTokens() {
5757
}
5858
}
5959

60-
func ParseTokenConfigs(configs []TOKEN_CONFIG_) (map[string]*SETTING_) {
61-
settings := map[string]*SETTING_{}
60+
func ParseTokenConfigs(configs []TOKEN_CONFIG_) (map[string]SETTING_) {
61+
settings := map[string]SETTING_{}
6262

6363
for _, config := range configs {
6464
for _, token := range config.TOKENS {

0 commit comments

Comments
 (0)