From 96d67a1d4ee80de75914f9b230cde534dfa98099 Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Wed, 16 Oct 2024 17:04:58 +0100 Subject: [PATCH 1/3] Enrich JS/Lua runtimes context. Enrich JS and Lua runtimes vm context with the same fields we expose in the runtimes context. This resolves an issue where the X-Forwarded-For was not correctly inferred when making an Authenticate request with the Satori client. --- server/runtime_javascript.go | 23 +++++++++++++++++++++++ server/runtime_lua.go | 18 ++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/server/runtime_javascript.go b/server/runtime_javascript.go index 2c165b2e7..c4d7b3c17 100644 --- a/server/runtime_javascript.go +++ b/server/runtime_javascript.go @@ -20,6 +20,7 @@ import ( "encoding/json" "errors" "fmt" + "maps" "net/http" "os" "path/filepath" @@ -50,6 +51,7 @@ type RuntimeJS struct { nkInst goja.Value jsLoggerInst goja.Value env goja.Value + envMap map[string]string vm *goja.Runtime nakamaModule *runtimeJavascriptNakamaModule callbacks *RuntimeJavascriptCallbacks @@ -197,6 +199,8 @@ func (rp *RuntimeProviderJS) Rpc(ctx context.Context, id string, headers, queryP rp.logger.Error("Could not instantiate js logger.", zap.Error(err)) return "", errors.New("Could not run Rpc function."), codes.Internal } + + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeRPC, headers, queryParams, expiry, userID, username, vars, sessionID, clientIP, clientPort, lang) r.SetContext(ctx) retValue, err, code := r.InvokeFunction(RuntimeExecutionModeRPC, id, fn, jsLogger, headers, queryParams, userID, username, vars, expiry, sessionID, clientIP, clientPort, lang, payload) r.SetContext(context.Background()) @@ -256,6 +260,8 @@ func (rp *RuntimeProviderJS) BeforeRt(ctx context.Context, id string, logger *za logger.Error("Could not instantiate js logger.", zap.Error(err)) return nil, errors.New("Could not run runtime Before function.") } + + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeBefore, nil, nil, expiry, userID, username, vars, sessionID, clientIP, clientPort, lang) r.SetContext(ctx) result, fnErr, _ := r.InvokeFunction(RuntimeExecutionModeBefore, id, fn, jsLogger, nil, nil, userID, username, vars, expiry, sessionID, clientIP, clientPort, lang, envelopeMap) r.SetContext(context.Background()) @@ -340,6 +346,8 @@ func (rp *RuntimeProviderJS) AfterRt(ctx context.Context, id string, logger *zap logger.Error("Could not instantiate js logger.", zap.Error(err)) return errors.New("Could not run runtime After function.") } + + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeAfter, nil, nil, expiry, userID, username, vars, sessionID, clientIP, clientPort, lang) r.SetContext(ctx) _, fnErr, _ := r.InvokeFunction(RuntimeExecutionModeAfter, id, fn, jsLogger, nil, nil, userID, username, vars, expiry, sessionID, clientIP, clientPort, lang, outMap, inMap) r.SetContext(context.Background()) @@ -405,6 +413,8 @@ func (rp *RuntimeProviderJS) BeforeReq(ctx context.Context, id string, logger *z logger.Error("Could not instantiate js logger.", zap.Error(err)) return nil, errors.New("Could not run runtime Before function."), codes.Internal } + + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeBefore, nil, nil, expiry, userID, username, vars, "", clientIP, clientPort, "") r.SetContext(ctx) result, fnErr, code := r.InvokeFunction(RuntimeExecutionModeBefore, id, fn, jsLogger, nil, nil, userID, username, vars, expiry, "", clientIP, clientPort, "", reqMap) r.SetContext(context.Background()) @@ -508,6 +518,8 @@ func (rp *RuntimeProviderJS) AfterReq(ctx context.Context, id string, logger *za logger.Error("Could not instantiate js logger.", zap.Error(err)) return errors.New("Could not run runtime After function.") } + + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeAfter, nil, nil, expiry, userID, username, vars, "", clientIP, clientPort, "") r.SetContext(ctx) _, fnErr, _ := r.InvokeFunction(RuntimeExecutionModeAfter, id, fn, jsLogger, nil, nil, userID, username, vars, expiry, "", clientIP, clientPort, "", resMap, reqMap) r.SetContext(context.Background()) @@ -1731,6 +1743,7 @@ func NewRuntimeProviderJS(ctx context.Context, logger, startupLogger *zap.Logger vm: runtime, nakamaModule: nakamaModule, env: runtime.ToValue(config.GetRuntime().Environment), + envMap: maps.Clone(config.GetRuntime().Environment), callbacks: callbacks, } } @@ -1872,6 +1885,7 @@ func (rp *RuntimeProviderJS) MatchmakerMatched(ctx context.Context, entries []*M return "", false, errors.New("Could not run matchmaker matched hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeMatchmaker, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeMatchmaker, "matchmakerMatched", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", r.vm.ToValue(entriesSlice)) r.SetContext(context.Background()) @@ -1963,6 +1977,7 @@ func (rp *RuntimeProviderJS) TournamentEnd(ctx context.Context, tournament *api. return errors.New("Could not run tournament end hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeTournamentEnd, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeTournamentEnd, "tournamentEnd", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", tournamentObj, r.vm.ToValue(end), r.vm.ToValue(reset)) r.SetContext(context.Background()) @@ -2039,6 +2054,7 @@ func (rp *RuntimeProviderJS) TournamentReset(ctx context.Context, tournament *ap return errors.New("Could not run tournament reset hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeTournamentReset, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeTournamentReset, "tournamentReset", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", tournamentObj, r.vm.ToValue(end), r.vm.ToValue(reset)) r.SetContext(context.Background()) @@ -2100,6 +2116,7 @@ func (rp *RuntimeProviderJS) LeaderboardReset(ctx context.Context, leaderboard * return errors.New("Could not run leaderboard reset hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeLeaderboardReset, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeLeaderboardReset, "leaderboardReset", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", leaderboardObj, r.vm.ToValue(reset)) r.SetContext(context.Background()) @@ -2141,6 +2158,7 @@ func (rp *RuntimeProviderJS) Shutdown(ctx context.Context) { return } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeShutdown, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) _, err, _ = r.InvokeFunction(RuntimeExecutionModeShutdown, "shutdown", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "") r.SetContext(context.Background()) @@ -2178,6 +2196,7 @@ func (rp *RuntimeProviderJS) PurchaseNotificationApple(ctx context.Context, purc return errors.New("Could not run Purchase Notification Apple hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModePurchaseNotificationApple, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModePurchaseNotificationApple, "purchaseNotificationApple", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", r.vm.ToValue(purchaseMap), r.vm.ToValue(providerPayload)) r.SetContext(context.Background()) @@ -2220,6 +2239,7 @@ func (rp *RuntimeProviderJS) SubscriptionNotificationApple(ctx context.Context, return errors.New("Could not run Subscription Notification Apple hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeSubscriptionNotificationApple, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeSubscriptionNotificationApple, "subscriptionNotificationApple", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", r.vm.ToValue(subscriptionMap), r.vm.ToValue(providerPayload)) r.SetContext(context.Background()) @@ -2262,6 +2282,7 @@ func (rp *RuntimeProviderJS) PurchaseNotificationGoogle(ctx context.Context, pur return errors.New("Could not run Purchase Notification Google hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModePurchaseNotificationGoogle, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModePurchaseNotificationGoogle, "purchaseNotificationGoogle", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", r.vm.ToValue(purchaseMap), r.vm.ToValue(providerPayload)) r.SetContext(context.Background()) @@ -2304,6 +2325,7 @@ func (rp *RuntimeProviderJS) SubscriptionNotificationGoogle(ctx context.Context, return errors.New("Could not run Subscription Notification Google hook.") } + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeSubscriptionNotificationGoogle, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeSubscriptionNotificationGoogle, "subscriptionNotificationGoogle", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", r.vm.ToValue(subscriptionMap), r.vm.ToValue(providerPayload)) r.SetContext(context.Background()) @@ -2365,6 +2387,7 @@ func (rp *RuntimeProviderJS) StorageIndexFilter(ctx context.Context, indexName s pointerizeSlices(valueMap) objectMap["value"] = valueMap + ctx = NewRuntimeGoContext(ctx, r.node, r.version, r.envMap, RuntimeExecutionModeStorageIndexFilter, nil, nil, 0, "", "", nil, "", "", "", "") r.SetContext(ctx) retValue, err, _ := r.InvokeFunction(RuntimeExecutionModeStorageIndexFilter, "storageIndexFilter", fn, jsLogger, nil, nil, "", "", nil, 0, "", "", "", "", r.vm.ToValue(objectMap)) r.SetContext(context.Background()) diff --git a/server/runtime_lua.go b/server/runtime_lua.go index 29f5cf38b..dd2a0be2f 100644 --- a/server/runtime_lua.go +++ b/server/runtime_lua.go @@ -1236,6 +1236,7 @@ func NewRuntimeProviderLua(ctx context.Context, logger, startupLogger *zap.Logge version: version, vm: vm, luaEnv: RuntimeLuaConvertMapString(vm, config.GetRuntime().Environment), + env: config.GetRuntime().Environment, callbacks: callbacksGlobals, } return r @@ -1353,6 +1354,7 @@ func (rp *RuntimeProviderLua) Rpc(ctx context.Context, id string, headers, query // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"rpc_id": id}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeRPC, headers, queryParams, expiry, userID, username, vars, sessionID, clientIP, clientPort, lang) r.vm.SetContext(vmCtx) result, fnErr, code, isCustomErr := r.InvokeFunction(RuntimeExecutionModeRPC, lf, headers, queryParams, userID, username, vars, expiry, sessionID, clientIP, clientPort, lang, payload) r.vm.SetContext(context.Background()) @@ -1413,6 +1415,7 @@ func (rp *RuntimeProviderLua) BeforeRt(ctx context.Context, id string, logger *z // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"api_id": strings.TrimPrefix(id, RTAPI_PREFIX_LOWERCASE), "mode": RuntimeExecutionModeBefore.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeBefore, nil, nil, expiry, userID, username, vars, sessionID, clientIP, clientPort, lang) r.vm.SetContext(vmCtx) result, fnErr, _, isCustomErr := r.InvokeFunction(RuntimeExecutionModeBefore, lf, nil, nil, userID, username, vars, expiry, sessionID, clientIP, clientPort, lang, envelopeMap) r.vm.SetContext(context.Background()) @@ -1489,6 +1492,7 @@ func (rp *RuntimeProviderLua) AfterRt(ctx context.Context, id string, logger *za // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"api_id": strings.TrimPrefix(id, RTAPI_PREFIX_LOWERCASE), "mode": RuntimeExecutionModeAfter.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeAfter, nil, nil, expiry, userID, username, vars, sessionID, clientIP, clientPort, lang) r.vm.SetContext(vmCtx) _, fnErr, _, isCustomErr := r.InvokeFunction(RuntimeExecutionModeAfter, lf, nil, nil, userID, username, vars, expiry, sessionID, clientIP, clientPort, lang, outMap, inMap) r.vm.SetContext(context.Background()) @@ -1546,6 +1550,7 @@ func (rp *RuntimeProviderLua) BeforeReq(ctx context.Context, id string, logger * // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"api_id": strings.TrimPrefix(id, API_PREFIX_LOWERCASE), "mode": RuntimeExecutionModeBefore.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeBefore, nil, nil, expiry, userID, username, vars, "", clientIP, clientPort, "") r.vm.SetContext(vmCtx) result, fnErr, code, isCustomErr := r.InvokeFunction(RuntimeExecutionModeBefore, lf, nil, nil, userID, username, vars, expiry, "", clientIP, clientPort, "", reqMap) r.vm.SetContext(context.Background()) @@ -1641,6 +1646,7 @@ func (rp *RuntimeProviderLua) AfterReq(ctx context.Context, id string, logger *z // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"api_id": strings.TrimPrefix(id, API_PREFIX_LOWERCASE), "mode": RuntimeExecutionModeAfter.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeAfter, nil, nil, expiry, userID, username, vars, "", clientIP, clientPort, "") r.vm.SetContext(vmCtx) _, fnErr, _, isCustomErr := r.InvokeFunction(RuntimeExecutionModeAfter, lf, nil, nil, userID, username, vars, expiry, "", clientIP, clientPort, "", resMap, reqMap) r.vm.SetContext(context.Background()) @@ -1703,6 +1709,7 @@ func (rp *RuntimeProviderLua) MatchmakerMatched(ctx context.Context, entries []* // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeMatchmaker.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeMatchmaker, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, entriesTable) r.vm.SetContext(context.Background()) @@ -1793,6 +1800,7 @@ func (rp *RuntimeProviderLua) TournamentEnd(ctx context.Context, tournament *api // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeTournamentEnd.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeTournamentEnd, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, tournamentTable, lua.LNumber(end), lua.LNumber(reset)) r.vm.SetContext(context.Background()) @@ -1864,6 +1872,7 @@ func (rp *RuntimeProviderLua) TournamentReset(ctx context.Context, tournament *a // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeTournamentReset.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeTournamentReset, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, tournamentTable, lua.LNumber(end), lua.LNumber(reset)) r.vm.SetContext(context.Background()) @@ -1917,6 +1926,7 @@ func (rp *RuntimeProviderLua) LeaderboardReset(ctx context.Context, leaderboard // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeLeaderboardReset.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeLeaderboardReset, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, leaderboardTable, lua.LNumber(reset)) r.vm.SetContext(context.Background()) @@ -1949,6 +1959,7 @@ func (rp *RuntimeProviderLua) Shutdown(ctx context.Context) { // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeShutdown.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeShutdown, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) _, err, _, _ = r.invokeFunction(r.vm, lf, luaCtx) r.vm.SetContext(context.Background()) @@ -1976,6 +1987,7 @@ func (rp *RuntimeProviderLua) PurchaseNotificationApple(ctx context.Context, pur // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModePurchaseNotificationApple.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModePurchaseNotificationApple, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, purchaseTable, lua.LString(providerPayload)) r.vm.SetContext(context.Background()) @@ -2009,6 +2021,7 @@ func (rp *RuntimeProviderLua) SubscriptionNotificationApple(ctx context.Context, // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeSubscriptionNotificationApple.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeSubscriptionNotificationApple, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, subscriptionTable, lua.LString(providerPayload)) r.vm.SetContext(context.Background()) @@ -2042,6 +2055,7 @@ func (rp *RuntimeProviderLua) PurchaseNotificationGoogle(ctx context.Context, pu // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModePurchaseNotificationGoogle.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModePurchaseNotificationGoogle, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, purchaseTable, lua.LString(providerPayload)) r.vm.SetContext(context.Background()) @@ -2075,6 +2089,7 @@ func (rp *RuntimeProviderLua) SubscriptionNotificationGoogle(ctx context.Context // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeSubscriptionNotificationGoogle.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeSubscriptionNotificationGoogle, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, subscriptionTable, lua.LString(providerPayload)) r.vm.SetContext(context.Background()) @@ -2131,6 +2146,7 @@ func (rp *RuntimeProviderLua) StorageIndexFilter(ctx context.Context, indexName // Set context value used for logging vmCtx := context.WithValue(ctx, ctxLoggerFields{}, map[string]string{"mode": RuntimeExecutionModeStorageIndexFilter.String()}) + vmCtx = NewRuntimeGoContext(ctx, r.node, r.version, r.env, RuntimeExecutionModeStorageIndexFilter, nil, nil, 0, "", "", nil, "", "", "", "") r.vm.SetContext(vmCtx) retValue, err, _, _ := r.invokeFunction(r.vm, lf, luaCtx, writeTable) r.vm.SetContext(context.Background()) @@ -2202,6 +2218,7 @@ type RuntimeLua struct { version string vm *lua.LState luaEnv *lua.LTable + env map[string]string callbacks *RuntimeLuaCallbacks } @@ -2522,6 +2539,7 @@ func newRuntimeLuaVM(logger *zap.Logger, db *sql.DB, protojsonMarshaler *protojs version: version, vm: vm, luaEnv: RuntimeLuaConvertMapString(vm, config.GetRuntime().Environment), + env: config.GetRuntime().Environment, callbacks: callbacks, } From 695391c9ec7edd885e44a2fa2c670edba1b87e2a Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Wed, 16 Oct 2024 17:08:14 +0100 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41e502a66..c8f582776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Ensure matchmaker stats behave correctly if matchmaker becomes fully empty and idle. - Correctly clear rank cache entries on account deletion. - Only display owned purchases in the console account tab. +- Correctly infer X-Forwarded-For headers on Satori Authenticate calls in JS/Lua runtimes. ## [3.23.0] - 2024-07-27 ### Added From 5d7cd8338f779acdebbb1da57daca0cccb1952c4 Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Wed, 16 Oct 2024 17:12:49 +0100 Subject: [PATCH 3/3] Remove unneded map clone --- server/runtime_javascript.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/runtime_javascript.go b/server/runtime_javascript.go index c4d7b3c17..1826a7b21 100644 --- a/server/runtime_javascript.go +++ b/server/runtime_javascript.go @@ -20,7 +20,6 @@ import ( "encoding/json" "errors" "fmt" - "maps" "net/http" "os" "path/filepath" @@ -1743,7 +1742,7 @@ func NewRuntimeProviderJS(ctx context.Context, logger, startupLogger *zap.Logger vm: runtime, nakamaModule: nakamaModule, env: runtime.ToValue(config.GetRuntime().Environment), - envMap: maps.Clone(config.GetRuntime().Environment), + envMap: config.GetRuntime().Environment, callbacks: callbacks, } }