Project

General

Profile

Actions

Bug #14162

closed

rgw: return suitable error message for bad request when using Admin API

Added by Dunrong Huang over 8 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

1. use admin api to create two users, with same email address:
$ curl -s -X PUT http://ceph1:9090/admin/user?format=json&uid=testuser1&exclusive=true&display-name=testuser1&email=testuser%40gmail.com
the response: as expected.
$ curl -s -X PUT http://ceph1:9090/admin/user?format=json&uid=testuser2&exclusive=true&display-name=testuser2&email=testuser%40gmail.com
get response: {"Code":"UserAlreadyExists","RequestId":"tx000000000000000000007-005673d4ea-6647f-a"},

From http://docs.ceph.com/docs/master/radosgw/adminops/ ,the error code should be EmailExists

2. use admin api to add a exist key
$ curl -s -X PUT http://ceph1:9090/admin/user?format=json&uid=testuser7&access-key=ZOYBOL2Q1GH5FRQH4IAL&key
get response: {"Code":"BucketAlreadyExists","RequestId":"tx000000000000000000001-005673dfe2-6648e-a"}

From document the error code should be KeyExists

3. add bad caps to user

$ curl -s -X PUT http://ceph1:9090/admin/user?format=json&uid=testuser6&user-caps=usasisdfafsdlgereafsa%2C%20write&caps
got response: "Code":"InvalidArgument","RequestId":"tx000000000000000000001-005673df43-63ef2-a"}

From document the error code should be InvalidCap.

refer: http://docs.ceph.com/docs/master/radosgw/adminops/

Actions #2

Updated by Casey Bodley about 4 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF