Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOTE] API "POST /users" not work as expect #7

Open
moooofly opened this issue Nov 4, 2018 · 2 comments
Open

[NOTE] API "POST /users" not work as expect #7

moooofly opened this issue Nov 4, 2018 · 2 comments
Assignees
Labels
bug Something isn't working note markdown some conclusions v1.6.0-66709daa

Comments

@moooofly
Copy link
Owner

moooofly commented Nov 4, 2018

by swagger UI

image

image

@moooofly moooofly added bug Something isn't working note markdown some conclusions v1.6.0-66709daa labels Nov 4, 2018
@moooofly moooofly self-assigned this Nov 4, 2018
@moooofly
Copy link
Owner Author

moooofly commented Nov 4, 2018

After some digging, the conclusions are:

  • the parameters that are effectively used by this API as follow
    • username
    • email
    • password
    • realname
    • comment
    • has_admin_role
  • the parameters that have no effect are (but you must make sure all of these with right type, or you will get "400")
    • user_id
    • deleted
    • role_name
    • role_id
    • reset_uuid
    • salt
  • the parameters that should not appear in this API are (or you will get "400")
    • creation_time
    • update_time

@moooofly
Copy link
Owner Author

moooofly commented Nov 4, 2018

only with parameters that do take effect

image

image

[#66#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl user list -u san.zhang
==> GET https://localhost/api/users?username=san.zhang&email=&page=1&page_size=10
<==
<== Rsp Status: 200 OK
<== Rsp Body: [
  {
    "user_id": 8,
    "username": "san.zhang",
    "email": "san.zhang@163.com",
    "password": "fda0a26d9f0661ce1f4ef6c0dab37483",
    "realname": "San Zhang",
    "comment": "comment from San Zhang",
    "deleted": false,
    "role_name": "",
    "role_id": 0,
    "has_admin_role": true,
    "reset_uuid": "",
    "creation_time": "2018-11-04T10:03:40Z",
    "update_time": "2018-11-04T10:03:40Z"
  }
]
[#67#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$

with parameters that do take effect and parameters that take no effect

image

image

[#67#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl user list -u si.li
==> GET https://localhost/api/users?username=si.li&email=&page=1&page_size=10
<==
<== Rsp Status: 200 OK
<== Rsp Body: [
  {
    "user_id": 9,
    "username": "si.li",
    "email": "si.li@163.com",
    "password": "d406d9f1a6a954ad951c3c19dee687fc",
    "realname": "Si Li",
    "comment": "comment from Si LI",
    "deleted": false,
    "role_name": "",
    "role_id": 0,
    "has_admin_role": false,
    "reset_uuid": "",
    "creation_time": "2018-11-04T10:10:45Z",
    "update_time": "2018-11-04T10:10:45Z"
  }
]
[#68#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$

with parameters that should not appear

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working note markdown some conclusions v1.6.0-66709daa
Projects
None yet
Development

No branches or pull requests

1 participant