From e2f6a68810d6d92c28890ab679b5ae46b38bdd3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Wed, 28 Jan 2026 12:52:24 +0100 Subject: [PATCH] Do not ever set a TTL for the ID cache. It's not supposed to expire. --- services/storage-users/pkg/config/config.go | 13 ++++++------- .../pkg/config/defaults/defaultconfig.go | 1 - services/storage-users/pkg/revaconfig/drivers.go | 5 ----- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index 104780a2e3..cae254dbf3 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -237,13 +237,12 @@ type FilemetadataCache struct { // IDCache holds cache config type IDCache struct { - Store string `yaml:"store" env:"OC_CACHE_STORE;STORAGE_USERS_ID_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"1.0.0"` - Nodes []string `yaml:"nodes" env:"OC_CACHE_STORE_NODES;STORAGE_USERS_ID_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"` - Database string `yaml:"database" env:"OC_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"1.0.0"` - TTL time.Duration `yaml:"ttl" env:"OC_CACHE_TTL;STORAGE_USERS_ID_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens have no expiration. Defaults to 300s which is derived from the underlaying package though not explicitly set as default. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"` - DisablePersistence bool `yaml:"disable_persistence" env:"OC_CACHE_DISABLE_PERSISTENCE;STORAGE_USERS_ID_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"1.0.0"` - AuthUsername string `yaml:"username" env:"OC_CACHE_AUTH_USERNAME;STORAGE_USERS_ID_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` - AuthPassword string `yaml:"password" env:"OC_CACHE_AUTH_PASSWORD;STORAGE_USERS_ID_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` + Store string `yaml:"store" env:"OC_CACHE_STORE;STORAGE_USERS_ID_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"1.0.0"` + Nodes []string `yaml:"nodes" env:"OC_CACHE_STORE_NODES;STORAGE_USERS_ID_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"` + Database string `yaml:"database" env:"OC_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"1.0.0"` + DisablePersistence bool `yaml:"disable_persistence" env:"OC_CACHE_DISABLE_PERSISTENCE;STORAGE_USERS_ID_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"1.0.0"` + AuthUsername string `yaml:"username" env:"OC_CACHE_AUTH_USERNAME;STORAGE_USERS_ID_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` + AuthPassword string `yaml:"password" env:"OC_CACHE_AUTH_PASSWORD;STORAGE_USERS_ID_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"1.0.0"` } // EOSDriver is the storage driver configuration when using 'eos' storage driver diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index fe7e17c9b0..541d56d20a 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -171,7 +171,6 @@ func DefaultConfig() *config.Config { Store: "nats-js-kv", Nodes: []string{"127.0.0.1:9233"}, Database: "ids-storage-users", - TTL: 24 * 60 * time.Second, }, Tasks: config.Tasks{ PurgeTrashBin: config.PurgeTrashBin{ diff --git a/services/storage-users/pkg/revaconfig/drivers.go b/services/storage-users/pkg/revaconfig/drivers.go index a8c1976222..c6793f3907 100644 --- a/services/storage-users/pkg/revaconfig/drivers.go +++ b/services/storage-users/pkg/revaconfig/drivers.go @@ -112,7 +112,6 @@ func Posix(cfg *config.Config, enableFSScan, enableFSWatch bool) map[string]inte "cache_store": cfg.IDCache.Store, "cache_nodes": cfg.IDCache.Nodes, "cache_database": cfg.IDCache.Database, - "cache_ttl": cfg.IDCache.TTL, "cache_disable_persistence": cfg.IDCache.DisablePersistence, "cache_auth_username": cfg.IDCache.AuthUsername, "cache_auth_password": cfg.IDCache.AuthPassword, @@ -218,7 +217,6 @@ func Decomposed(cfg *config.Config) map[string]interface{} { "cache_store": cfg.IDCache.Store, "cache_nodes": cfg.IDCache.Nodes, "cache_database": cfg.IDCache.Database, - "cache_ttl": cfg.IDCache.TTL, "cache_disable_persistence": cfg.IDCache.DisablePersistence, "cache_auth_username": cfg.IDCache.AuthUsername, "cache_auth_password": cfg.IDCache.AuthPassword, @@ -273,7 +271,6 @@ func DecomposedNoEvents(cfg *config.Config) map[string]interface{} { "cache_store": cfg.IDCache.Store, "cache_nodes": cfg.IDCache.Nodes, "cache_database": cfg.IDCache.Database, - "cache_ttl": cfg.IDCache.TTL, "cache_disable_persistence": cfg.IDCache.DisablePersistence, "cache_auth_username": cfg.IDCache.AuthUsername, "cache_auth_password": cfg.IDCache.AuthPassword, @@ -330,7 +327,6 @@ func DecomposedS3(cfg *config.Config) map[string]interface{} { "cache_store": cfg.IDCache.Store, "cache_nodes": cfg.IDCache.Nodes, "cache_database": cfg.IDCache.Database, - "cache_ttl": cfg.IDCache.TTL, "cache_disable_persistence": cfg.IDCache.DisablePersistence, "cache_auth_username": cfg.IDCache.AuthUsername, "cache_auth_password": cfg.IDCache.AuthPassword, @@ -389,7 +385,6 @@ func DecomposedS3NoEvents(cfg *config.Config) map[string]interface{} { "cache_store": cfg.IDCache.Store, "cache_nodes": cfg.IDCache.Nodes, "cache_database": cfg.IDCache.Database, - "cache_ttl": cfg.IDCache.TTL, "cache_disable_persistence": cfg.IDCache.DisablePersistence, "cache_auth_username": cfg.IDCache.AuthUsername, "cache_auth_password": cfg.IDCache.AuthPassword,