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
- フォーク
- 30
- 平均マージ
- 13分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
appbaseio/reactivesearch-api のほかの issue
-
AI Answer stops working on 23 October: the gpt-3.5-turbo default shuts down, and its replacement rejects max_tokens対応中かも @Lakshya-0910 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
appbaseio/reactivesearch-api#402 · コメント 2 件 ·
-
難易度 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 が 2589 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
appbaseio/reactivesearch-api#19 · コメント 1 件 · 担当者 1 名 ·
appbaseio/reactivesearch-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
prime-radiant-inc/evener#4329 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
openwatersio/aiscast#277 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
restic/restic#22112 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信