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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user