Ptt-official-app / Ptt-backend

PTT APP 的後端
BSD 3-Clause "New" or "Revised" License
208 stars 68 forks source link

[BUG] 不是 SYSOP 的 token GET /v1/users/SYSOP/comments 不應該取得任何資料 #223

Closed y2468101216 closed 3 years ago

y2468101216 commented 3 years ago

發生了什麼事? / The Problem

不是 SYSOP 的 token GET /v1/users/SYSOP/comments 取得 no value 螢幕擷取畫面 2021-06-09 140116

如何重現 / To Reproduce

不是 SYSOP 的 token GET /v1/users/SYSOP/comments 取得 no value

  1. 使用預設的測試資料
  2. curl 'localhost:8081/v1/users/SYSOP/comments ' (或是用 postman)
  3. 取得 SYSOP 資料,但資料都是 no value

預期的行為 / Expected behavior

不是 SYSOP 的 token GET /v1/users/SYSOP/comments 不應該取得任何資料

應該要出現錯誤訊息

{
    "error": "permission_error",
    "error_description": "no permission"
}

另外要出現 401 的 HTTP Status

螢幕截圖 / Screenshots

螢幕擷取畫面 2021-06-08 120117

開發環境 / Environment

windows 10 golang1.16