Browse Source

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.
pull/7760/head
Chris Lu 1 day ago
committed by GitHub
parent
commit
60649460b2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      weed/s3api/s3api_server.go

5
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

Loading…
Cancel
Save