Internal Server Error when posting a permission while being authenticated with another permission
@deepjyoti30 已經在處理了。
開始於 2023年1月23日。
評估
這個 Issue 還沒有評估資料。
描述
What version of ReactiveSearch API are you using ?
8.9.0
What issue did you run into?
- Create a permission (API Credentials) with a read-write access to the "permissions" category.
- Use the credentials of the just created permission in HTTP Basic Auth to send a
POST /_permissionrequest, trying to create another permission object.
What did you expect to see?
A created permission.
What did you see instead?
Internal server error saying "*user.User" not found in request context.
From what I was able to find in the code as a non-Go developer, looks like the user is being read from the context right here for the only purpose to check if it's admin or not, which decides the permission's default settings. And if the user not found, the error is being thrown.
Looking at the auth middleware I can see it being assigned only when the request is authenticated on behalf of a user. When you use API Credentials to authenticate the request, the permission is being assigned to the context instead.
I haven't found anywhere in the documentation that you can only create permissions when authenticated as a user. So I think it's a bug.
Would it be possible to fix it by assuming the user is not an admin if the request is authenticated with the API Credentials?
- 主要語言
- Go
- 星號
- 212
- 分支
- 29
- 平均合併
- 13 分鐘
- 30 天內合併 PR
- 2
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
appbaseio/reactivesearch-api 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
appbaseio/reactivesearch-api#402 ·
-
難度 3/5 1-2 天 新手友好度 30/100
appbaseio/reactivesearch-api#382 ·
-
難度 3/5 1-2 天 新手友好度 35/100
appbaseio/reactivesearch-api#377 ·
-
難度 4/5 3-5 天 新手友好度 25/100
appbaseio/reactivesearch-api#151 · 4 則留言 ·
-
Add test cases for the users plugin可能重新可做 @harsh-2711 於 2584 天前認領,目前沒有進行中的 PR。 未關閉
appbaseio/reactivesearch-api#19 · 1 則留言 · 已指派 1 人 ·
查看 appbaseio/reactivesearch-api 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
prime-radiant-inc/evener#3873 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
pion/interceptor#479 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
slavakurilyak/awesome-ai-agents#710 ·
維護者通常 1 天內回覆
-
agent-butler-finding agent-research-recommend bug ready-for-agent
難度 2/5 1-3 小時 新手友好度 76/100
jordansmall/spindrift#4614 · 1 則留言 ·
維護者通常 1 天內回覆