From 60649460b223dea6d08e6bd8e1c1582c86bdd03b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 14 Dec 2025 21:16:02 -0800 Subject: [PATCH] fix: default policy storeType to memory when not specified (#7754) When loading IAM config from JSON, if the policy section exists but storeType is not specified, default to 'memory' instead of 'filer'. This ensures that policies defined in JSON config files are properly loaded into memory for test environments and standalone setups that don't rely on the filer for policy persistence. --- weed/s3api/s3api_server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/s3api/s3api_server.go b/weed/s3api/s3api_server.go index bf1a44e54..464ca1c8b 100644 --- a/weed/s3api/s3api_server.go +++ b/weed/s3api/s3api_server.go @@ -653,6 +653,11 @@ func loadIAMManagerFromConfig(configPath string, filerAddressProvider func() str DefaultEffect: sts.EffectDeny, StoreType: sts.StoreTypeMemory, } + } else if configRoot.Policy.StoreType == "" { + // If policy config exists but storeType is not specified, use memory store + // This ensures JSON-defined policies are stored in memory and work correctly + configRoot.Policy.StoreType = sts.StoreTypeMemory + glog.V(1).Infof("Policy storeType not specified; using memory store for JSON config-based setup") } // Create IAM configuration