Internal Server Error when posting a permission while being authenticated with another permission
@deepjyoti30 đang làm issue này rồi.
Từ ngày 23/1/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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?
- Ngôn ngữ chính
- Go
- Star
- 212
- Fork
- 30
- Merge trung bình
- 13 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của appbaseio/reactivesearch-api
-
AI Answer stops working on 23 October: the gpt-3.5-turbo default shuts down, and its replacement rejects max_tokensCó thể đã có người làm @Lakshya-0910 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
appbaseio/reactivesearch-api#402 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
appbaseio/reactivesearch-api#382 ·
-
Error 401 (Unauthorized)Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
appbaseio/reactivesearch-api#377 ·
-
Does it work with Kibana ?Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
appbaseio/reactivesearch-api#151 · 4 bình luận ·
-
Add test cases for the users pluginCó thể làm lại được @harsh-2711 đã nhận 2586 ngày trước và không có pull request nào đang mở. Đang mở
appbaseio/reactivesearch-api#19 · 1 bình luận · 1 người được giao ·
Tất cả issue của appbaseio/reactivesearch-api
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
vanderheijden86/b9s#20 ·
-
go-battery needs an ndsctl on PATH: TestPurchaseSessionGuardHoldsThroughTheOutcomeUnknownWindow fails on bare hosts (passes with stub)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenTollGate/tollgate-module-basic-go#726 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ux waiting for feedback
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
evcc-io/evcc#34527 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
phase:v3 type:harness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày