We're updating the issue view to help you get more done. 

Unable to delete tenants and user groups with specific names

Description

In the REST API, the method and URL to delete a tenant is:
DELETE http://<manager_ip>/api/v3.1/tenants/<tenant_name>

while the method and URLs to remove a user/user group from a tenant are:
DELETE http://<manager_ip>/api/v3.1/tenants/users
DELETE http://<manager_ip>/api/v3.1/tenants/user-groups

The side effect of this URL scheme is that when a tenant with the name users or user-groups is created, then it cannot be deleted because any attempt to remove it is interpreted as a request to remove a user/user group from a tenant.

In a similar fashion, the the method and URL to delete a tenant is:
DELETE http://<manager_ip>/api/v3.1/user-groups/<user_group_name>

while the method and URL to remove a user from a user group is:
DELETE http://<manager_ip>/api/v3.1/user-groups/users

in this case, if a user group is named users it becomes impossible to remove it later since an attempt to do so is interpreted as a request to remove a user from a user group.

Given that the URL mapping cannot be changed without creating a new major version of the API, I believe that the tenant/user group names that can cause problems shouldn't be allowed when trying to create them in the first place.

Quick way to reproduce the problem:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $ cfy tenants create users Tenant `users` created $ cfy tenants delete users Deleting tenant `users`... An error occurred on the server: 400: Bad Request $ cfy tenants create user-groups Tenant `user-groups` created $ cfy tenants delete user-groups Deleting tenant `user-groups`... An error occurred on the server: 400: Bad Request $ cfy user-groups create users Group `users` created $ cfy user-groups delete users Deleting user group `users`... An error occurred on the server: 400: Bad Request

Status

Assignee

Javier Collado Cabeza

Reporter

Javier Collado Cabeza

Labels

None

Severity

None

Bug Type

None

Target Version

None

Severity

None

Epic Link

Fix versions

Affects versions

4.2