mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
CreateUserGroup, DescribeUserGroups, ModifyUserGroup and DeleteUserGroup returned UnsupportedOperation, and ModifyReplicationGroup read UserGroupIdsToAdd as user ids, so RBAC could not be set up the way AWS and Terraform (aws_elasticache_user_group, user_group_ids) do it. User groups are now stored resources. CreateReplicationGroup takes UserGroupIds and ModifyReplicationGroup adds and removes user groups; the proxy authenticates the members of a replication group's user groups, read at AUTH time so a ModifyUserGroup applies at once, each by its own authentication mode. A replication group with a user group associated admits only its members, even while the group is empty. An id in UserGroupIdsToAdd that names no user group but names a user still associates that user directly, so existing setups keep working. A cache uses either its AUTH token or user groups, as on AWS: while a user group is attached the token is not accepted and AuthTokenEnabled reads false. ModifyReplicationGroup takes AuthTokenUpdateStrategy DELETE, which removes the token and is only allowed together with a user group, and RemoveUserGroups. Removing the last user group leaves the cache without access control, still encrypted in transit; a token that was never deleted applies again. The proxy reads the cache's auth mode per connection, so these changes take effect without a restart. Validation follows the RBAC rules: a redis user group needs a user named default (DefaultUserRequired), members cannot share a user name (DuplicateUserName), valkey users only join valkey groups, a valkey group cannot hold a no-password user or serve a redis cache, association needs in-transit encryption, and a user group in use cannot be deleted (InvalidUserGroupState). ModifyUser refuses an engine or authentication change that a user group holding the user would reject. Deleting a user removes it from its user groups.