apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

bug: manager-api do not support add consumer with custom create time or update time

Open idbeta opened this issue 6 years ago • 10 comments

Bug report

Describe the bug

use manager-api add a consumer with custom create time or update time, but the consumer actually created does not use the custom time.

idbeta avatar Nov 23 '20 03:11 idbeta

Hi, @idbeta, I can't get your point. Can you give me an example or steps to reproduce the issue?

starsz avatar Nov 23 '20 05:11 starsz

hi, @starsz you can refer to https://github.com/apache/apisix-dashboard/pull/830/files#diff-d6674616f38aabf4e6e7f91f04b057982213b9b3758fc363ffc140843db957e3R344-R385 this case is failed, it will return the current timestamp.

idbeta avatar Nov 23 '20 05:11 idbeta

OK, I reproduce the issue.

starsz avatar Nov 23 '20 13:11 starsz

I don't think it is a bug, audit field should maintain by server not client.So we should not accept client audit field such as CreatedAt, CreatedBy etc.

ShiningRush avatar Nov 24 '20 01:11 ShiningRush

Not sure if it's a bug indeed, what's your opinion? I would be more prefer with @ShiningRush's opinion 🤔

cc @membphis @nic-chen @liuxiran @tokers

juzhiyuan avatar Nov 24 '20 02:11 juzhiyuan

I don't think it is a bug, audit field should maintain by server not client.So we should not accept client audit field such as CreatedAt, CreatedBy etc.

agree +1. If the user customizes these fields, it goes against the original intent of using these fields to record the time.

liuxiran avatar Nov 24 '20 02:11 liuxiran

I don't think it is a bug, audit field should maintain by server not client.So we should not accept client audit field such as CreatedAt, CreatedBy etc.

agree +1

nic-chen avatar Nov 25 '20 02:11 nic-chen

OK. So the conclusion is that we should not accept the client audit fields such as CreatedAt, CreatedBy. If the client put those fields, just ignore them.

starsz avatar Nov 25 '20 02:11 starsz

Should we add this tip to FAQ?

juzhiyuan avatar Nov 25 '20 02:11 juzhiyuan

At the beginning, I referred to the processing of adminAPI ( APISIX ). After reading your comments, I think manager-api does not need to be the same as adminAPI at this point. I will modify the related test cases.

idbeta avatar Nov 25 '20 02:11 idbeta