-
Notifications
You must be signed in to change notification settings - Fork 52
LCORE-759: Updated response dicts for feedback endpoints #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -260,7 +260,25 @@ Feature: feedback endpoint API tests | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| And The body of the response is the following | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "detail": "No Authorization header found" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "detail": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cause": "Missing or invalid credentials provided by client", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "response": "Unauthorized" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Scenario: Check if update feedback status endpoint is not working when not authorized | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Given The system is in default state | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| And I remove the auth header | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| When The feedback is enabled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Then The status code of the response is 400 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| And The body of the response is the following | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "detail": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cause": "Missing or invalid credentials provided by client", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "response": "Unauthorized" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+270
to
283
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reconsider using 400 for authentication failures. This new scenario also expects a 400 status code for missing credentials, which is semantically incorrect per HTTP standards. Authentication failures should return 401 (Unauthorized), not 400 (Bad Request). Apply this change: - Then The status code of the response is 400
+ Then The status code of the response is 401📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the 400 response entry in
feedback_put_response.The 400 status code entry (lines 57-60) has two issues:
UnauthorizedResponsemodel for a 400 status creates confusion, as this model is designed for 401 responses.HTTP status codes should follow standard conventions:
If 400 is intended for request validation errors (e.g., invalid body schema), update the description and use
BadRequestResponse:If the intent is to document missing credentials, remove the 400 entry as 401 already covers this case.
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 0
🏁 Script executed:
Length of output: 9856
🏁 Script executed:
Length of output: 0
@asimurka, understood! I can see from the test scenarios (lines 301-330 and 332-350 in
feedback.feature) that returning 400 for missing/invalid credentials is explicitly validated and intentional for the feedback endpoints. Thank you for clarifying this design decision.🧬 Code Graph Analysis Results
File: src/utils/suid.py
File: src/models/requests.py
Lines 244-387
Summary:
File: src/models/requests.py
Lines 390-415
Summary:
File: src/models/config.py
File: src/authorization/middleware.py
File: src/authentication/init.py
File: src/configuration.py
File: src/configuration.py