Browse Source

remove filerAddress required

pull/7160/head
chrislu 1 month ago
parent
commit
51525ea2ba
  1. 9
      weed/iam/integration/role_store.go
  2. 9
      weed/iam/policy/policy_store.go

9
weed/iam/integration/role_store.go

@ -146,18 +146,11 @@ func NewFilerRoleStore(config map[string]interface{}) (*FilerRoleStore, error) {
basePath: "/etc/iam/roles", // Default path for role storage - aligned with /etc/ convention basePath: "/etc/iam/roles", // Default path for role storage - aligned with /etc/ convention
} }
// Parse configuration
// Parse configuration - only basePath and other settings, NOT filerAddress
if config != nil { if config != nil {
if basePath, ok := config["basePath"].(string); ok && basePath != "" { if basePath, ok := config["basePath"].(string); ok && basePath != "" {
store.basePath = strings.TrimSuffix(basePath, "/") store.basePath = strings.TrimSuffix(basePath, "/")
} }
// Validate that filerAddress is provided in config - required for distributed setup
if _, ok := config["filerAddress"].(string); !ok {
return nil, fmt.Errorf("filer address is required in configuration for FilerRoleStore")
}
} else {
return nil, fmt.Errorf("filer address is required in configuration for FilerRoleStore")
} }
glog.V(2).Infof("Initialized FilerRoleStore with basePath %s", store.basePath) glog.V(2).Infof("Initialized FilerRoleStore with basePath %s", store.basePath)

9
weed/iam/policy/policy_store.go

@ -158,18 +158,11 @@ func NewFilerPolicyStore(config map[string]interface{}) (*FilerPolicyStore, erro
basePath: "/etc/iam/policies", // Default path for policy storage - aligned with /etc/ convention basePath: "/etc/iam/policies", // Default path for policy storage - aligned with /etc/ convention
} }
// Parse configuration
// Parse configuration - only basePath and other settings, NOT filerAddress
if config != nil { if config != nil {
if basePath, ok := config["basePath"].(string); ok && basePath != "" { if basePath, ok := config["basePath"].(string); ok && basePath != "" {
store.basePath = strings.TrimSuffix(basePath, "/") store.basePath = strings.TrimSuffix(basePath, "/")
} }
// Validate that filerAddress is provided in config - required for distributed setup
if _, ok := config["filerAddress"].(string); !ok {
return nil, fmt.Errorf("filer address is required in configuration for FilerPolicyStore")
}
} else {
return nil, fmt.Errorf("filer address is required in configuration for FilerPolicyStore")
} }
glog.V(2).Infof("Initialized FilerPolicyStore with basePath %s", store.basePath) glog.V(2).Infof("Initialized FilerPolicyStore with basePath %s", store.basePath)

Loading…
Cancel
Save