|
|
|
@ -108,12 +108,12 @@ const ( |
|
|
|
|
// GetBucketQuotaAdminAction - allow getting bucket quota
|
|
|
|
|
GetBucketQuotaAdminAction = "admin:GetBucketQuota" |
|
|
|
|
|
|
|
|
|
// Bucket Replication admin Actions
|
|
|
|
|
// Bucket Target admin Actions
|
|
|
|
|
|
|
|
|
|
// SetBucketReplicationTargetAction - allow setting bucket replication target
|
|
|
|
|
SetBucketReplicationTargetAction = "admin:SetBucketReplicationTarget" |
|
|
|
|
// GetBucketReplicationTargetAction - allow getting bucket replication targets
|
|
|
|
|
GetBucketReplicationTargetAction = "admin:GetBucketReplicationTarget" |
|
|
|
|
// SetBucketTargetAction - allow setting bucket target
|
|
|
|
|
SetBucketTargetAction = "admin:SetBucketTarget" |
|
|
|
|
// GetBucketTargetAction - allow getting bucket targets
|
|
|
|
|
GetBucketTargetAction = "admin:GetBucketTarget" |
|
|
|
|
|
|
|
|
|
// AllAdminActions - provides all admin permissions
|
|
|
|
|
AllAdminActions = "admin:*" |
|
|
|
@ -121,42 +121,42 @@ const ( |
|
|
|
|
|
|
|
|
|
// List of all supported admin actions.
|
|
|
|
|
var supportedAdminActions = map[AdminAction]struct{}{ |
|
|
|
|
HealAdminAction: {}, |
|
|
|
|
StorageInfoAdminAction: {}, |
|
|
|
|
DataUsageInfoAdminAction: {}, |
|
|
|
|
TopLocksAdminAction: {}, |
|
|
|
|
ProfilingAdminAction: {}, |
|
|
|
|
TraceAdminAction: {}, |
|
|
|
|
ConsoleLogAdminAction: {}, |
|
|
|
|
KMSKeyStatusAdminAction: {}, |
|
|
|
|
ServerInfoAdminAction: {}, |
|
|
|
|
OBDInfoAdminAction: {}, |
|
|
|
|
ServerUpdateAdminAction: {}, |
|
|
|
|
ServiceRestartAdminAction: {}, |
|
|
|
|
ServiceStopAdminAction: {}, |
|
|
|
|
ConfigUpdateAdminAction: {}, |
|
|
|
|
CreateUserAdminAction: {}, |
|
|
|
|
DeleteUserAdminAction: {}, |
|
|
|
|
ListUsersAdminAction: {}, |
|
|
|
|
EnableUserAdminAction: {}, |
|
|
|
|
DisableUserAdminAction: {}, |
|
|
|
|
GetUserAdminAction: {}, |
|
|
|
|
AddUserToGroupAdminAction: {}, |
|
|
|
|
RemoveUserFromGroupAdminAction: {}, |
|
|
|
|
GetGroupAdminAction: {}, |
|
|
|
|
ListGroupsAdminAction: {}, |
|
|
|
|
EnableGroupAdminAction: {}, |
|
|
|
|
DisableGroupAdminAction: {}, |
|
|
|
|
CreatePolicyAdminAction: {}, |
|
|
|
|
DeletePolicyAdminAction: {}, |
|
|
|
|
GetPolicyAdminAction: {}, |
|
|
|
|
AttachPolicyAdminAction: {}, |
|
|
|
|
ListUserPoliciesAdminAction: {}, |
|
|
|
|
SetBucketQuotaAdminAction: {}, |
|
|
|
|
GetBucketQuotaAdminAction: {}, |
|
|
|
|
SetBucketReplicationTargetAction: {}, |
|
|
|
|
GetBucketReplicationTargetAction: {}, |
|
|
|
|
AllAdminActions: {}, |
|
|
|
|
HealAdminAction: {}, |
|
|
|
|
StorageInfoAdminAction: {}, |
|
|
|
|
DataUsageInfoAdminAction: {}, |
|
|
|
|
TopLocksAdminAction: {}, |
|
|
|
|
ProfilingAdminAction: {}, |
|
|
|
|
TraceAdminAction: {}, |
|
|
|
|
ConsoleLogAdminAction: {}, |
|
|
|
|
KMSKeyStatusAdminAction: {}, |
|
|
|
|
ServerInfoAdminAction: {}, |
|
|
|
|
OBDInfoAdminAction: {}, |
|
|
|
|
ServerUpdateAdminAction: {}, |
|
|
|
|
ServiceRestartAdminAction: {}, |
|
|
|
|
ServiceStopAdminAction: {}, |
|
|
|
|
ConfigUpdateAdminAction: {}, |
|
|
|
|
CreateUserAdminAction: {}, |
|
|
|
|
DeleteUserAdminAction: {}, |
|
|
|
|
ListUsersAdminAction: {}, |
|
|
|
|
EnableUserAdminAction: {}, |
|
|
|
|
DisableUserAdminAction: {}, |
|
|
|
|
GetUserAdminAction: {}, |
|
|
|
|
AddUserToGroupAdminAction: {}, |
|
|
|
|
RemoveUserFromGroupAdminAction: {}, |
|
|
|
|
GetGroupAdminAction: {}, |
|
|
|
|
ListGroupsAdminAction: {}, |
|
|
|
|
EnableGroupAdminAction: {}, |
|
|
|
|
DisableGroupAdminAction: {}, |
|
|
|
|
CreatePolicyAdminAction: {}, |
|
|
|
|
DeletePolicyAdminAction: {}, |
|
|
|
|
GetPolicyAdminAction: {}, |
|
|
|
|
AttachPolicyAdminAction: {}, |
|
|
|
|
ListUserPoliciesAdminAction: {}, |
|
|
|
|
SetBucketQuotaAdminAction: {}, |
|
|
|
|
GetBucketQuotaAdminAction: {}, |
|
|
|
|
SetBucketTargetAction: {}, |
|
|
|
|
GetBucketTargetAction: {}, |
|
|
|
|
AllAdminActions: {}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// IsValid - checks if action is valid or not.
|
|
|
|
@ -167,39 +167,39 @@ func (action AdminAction) IsValid() bool { |
|
|
|
|
|
|
|
|
|
// adminActionConditionKeyMap - holds mapping of supported condition key for an action.
|
|
|
|
|
var adminActionConditionKeyMap = map[Action]condition.KeySet{ |
|
|
|
|
AllAdminActions: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
HealAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
StorageInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServerInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DataUsageInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
OBDInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
TopLocksAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ProfilingAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
TraceAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ConsoleLogAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
KMSKeyStatusAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServerUpdateAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServiceRestartAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServiceStopAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ConfigUpdateAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
CreateUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DeleteUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ListUsersAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
EnableUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DisableUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
AddUserToGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
RemoveUserFromGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ListGroupsAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
EnableGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DisableGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
CreatePolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DeletePolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetPolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
AttachPolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ListUserPoliciesAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
SetBucketQuotaAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetBucketQuotaAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
SetBucketReplicationTargetAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetBucketReplicationTargetAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
AllAdminActions: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
HealAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
StorageInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServerInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DataUsageInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
OBDInfoAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
TopLocksAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ProfilingAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
TraceAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ConsoleLogAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
KMSKeyStatusAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServerUpdateAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServiceRestartAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ServiceStopAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ConfigUpdateAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
CreateUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DeleteUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ListUsersAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
EnableUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DisableUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetUserAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
AddUserToGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
RemoveUserFromGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ListGroupsAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
EnableGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DisableGroupAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
CreatePolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
DeletePolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetPolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
AttachPolicyAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
ListUserPoliciesAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
SetBucketQuotaAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetBucketQuotaAdminAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
SetBucketTargetAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
GetBucketTargetAction: condition.NewKeySet(condition.AllSupportedAdminKeys...), |
|
|
|
|
} |
|
|
|
|