Ptt-official-app / Ptt-backend

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

[BUG] 不放入 Access Token 的情況下 GET /v1/users/SYSOP/articles 不應該看到任何文章,應該要看到 error 元素 #220

Closed y2468101216 closed 3 years ago

y2468101216 commented 3 years ago

發生了什麼事? / The Problem

不放入 Access Token 的情況下 GET /v1/users/SYSOP/articles 看到了 item = null 螢幕擷取畫面 2021-06-09 134825

如何重現 / To Reproduce

不放入 Access Token 的情況下 GET /v1/users/SYSOP/articles 看到了 item = null

  1. 使用預設的測試資料
  2. curl 'localhost:8081/v1/users/SYSOP/articles' (或是用 postman)
  3. 取得 SYSOP 資料 (不應該要取到的)

預期的行為 / Expected behavior

不放入 Access Token 的情況下 GET /v1/users/SYSOP/articles 不應該看到任何文章,應該要看到 error 元素

應該要出現錯誤訊息

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

另外要出現 403 的 HTTP Status

螢幕截圖 / Screenshots

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

開發環境 / Environment

windows 10 golang1.16

PichuChen commented 3 years ago

testcase 2021060401 中的 C5-1-1 測試項目中發現有問題

y2468101216 commented 3 years ago

螢幕擷取畫面 2021-06-30 153243

PichuChen commented 3 years ago

C5-1-1 是 boards 不是 users, 我這邊搞錯了,所以關掉這個