From ab82b7963871a3a585914b722361cfc33fface1d Mon Sep 17 00:00:00 2001 From: colin <102356659+colinlyguo@users.noreply.github.com> Date: Fri, 5 Jan 2024 00:01:54 +0800 Subject: [PATCH] fix(bridge-history): add cache key prefix (#1067) Co-authored-by: colinlyguo --- bridge-history-api/internal/logic/history_logic.go | 14 ++++++++++---- common/version/version.go | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bridge-history-api/internal/logic/history_logic.go b/bridge-history-api/internal/logic/history_logic.go index 5765dcda1a..516f657b28 100644 --- a/bridge-history-api/internal/logic/history_logic.go +++ b/bridge-history-api/internal/logic/history_logic.go @@ -19,10 +19,16 @@ import ( ) const ( - cacheKeyPrefixL2ClaimableWithdrawalsByAddr = "l2ClaimableWithdrawalsByAddr:" - cacheKeyPrefixL2WithdrawalsByAddr = "l2WithdrawalsByAddr:" - cacheKeyPrefixTxsByAddr = "txsByAddr:" - cacheKeyPrefixQueryTxsByHashes = "queryTxsByHashes:" + // cacheKeyPrefixBridgeHistory serves as a specific namespace for all Redis cache keys + // associated with the 'bridge-history' user. This prefix is used to enforce access controls + // in Redis, allowing permissions to be set such that only users with the appropriate + // access rights can read or write to keys starting with "bridge-history". + cacheKeyPrefixBridgeHistory = "bridge-history-" + + cacheKeyPrefixL2ClaimableWithdrawalsByAddr = cacheKeyPrefixBridgeHistory + "l2ClaimableWithdrawalsByAddr:" + cacheKeyPrefixL2WithdrawalsByAddr = cacheKeyPrefixBridgeHistory + "l2WithdrawalsByAddr:" + cacheKeyPrefixTxsByAddr = cacheKeyPrefixBridgeHistory + "txsByAddr:" + cacheKeyPrefixQueryTxsByHashes = cacheKeyPrefixBridgeHistory + "queryTxsByHashes:" cacheKeyExpiredTime = 1 * time.Minute ) diff --git a/common/version/version.go b/common/version/version.go index 83e9686780..f851a21da4 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.3.48" +var tag = "v4.3.49" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {