-
Notifications
You must be signed in to change notification settings - Fork 1
fixed save issue #51
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
fixed save issue #51
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 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -154,8 +154,9 @@ | |||||||||||||||||||
|
|
||||||||||||||||||||
| REST_FRAMEWORK = { | ||||||||||||||||||||
| "DEFAULT_PERMISSION_CLASSES": [ | ||||||||||||||||||||
| "rest_framework.permissions.IsAuthenticatedOrReadOnly", | ||||||||||||||||||||
| "rest_framework.permissions.AllowAny", # Views handle auth via Firebase middleware | ||||||||||||||||||||
| ], | ||||||||||||||||||||
| "DEFAULT_AUTHENTICATION_CLASSES": [], # Disable DRF auth, using Firebase middleware | ||||||||||||||||||||
|
Comment on lines
+157
to
+159
|
||||||||||||||||||||
| "rest_framework.permissions.AllowAny", # Views handle auth via Firebase middleware | |
| ], | |
| "DEFAULT_AUTHENTICATION_CLASSES": [], # Disable DRF auth, using Firebase middleware | |
| "rest_framework.permissions.IsAuthenticatedOrReadOnly", | |
| ], | |
| "DEFAULT_AUTHENTICATION_CLASSES": [ | |
| "rest_framework.authentication.SessionAuthentication", | |
| "rest_framework.authentication.BasicAuthentication", | |
| ], |
Copilot
AI
Feb 2, 2026
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.
The PR title "fixed save issue" does not accurately describe the changes made. This PR modifies the authentication and authorization configuration for the entire Django REST Framework layer, which is a significant architectural change with security implications. The title should reflect the actual changes, for example: "Migrate DRF authentication to Firebase middleware pattern" or "Change default DRF permissions to AllowAny for Firebase auth".
Copilot
AI
Feb 2, 2026
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.
Disabling DRF authentication classes entirely removes compatibility with DRF's built-in authentication mechanisms and tools. This creates several maintainability issues:
- DRF browsable API will no longer work properly for authenticated requests
- Third-party packages expecting standard DRF authentication patterns may break
- Future developers expecting DRF conventions will face confusion
Consider creating a custom DRF authentication class that bridges Firebase middleware to DRF's authentication system by reading request.firebase_user and setting request.user. This would maintain DRF compatibility while using Firebase as the underlying auth mechanism. See: https://www.django-rest-framework.org/api-guide/authentication/#custom-authentication
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.
The removed
IsAuthenticatedOrReadOnlypermission was likely preventing the save issue, as it only allowed authenticated users to make modifications. Replacing it withAllowAnyremoves this protection. If the "save issue" was related to authentication, the proper fix would be to ensure Firebase tokens are being passed correctly in requests, not to remove authentication requirements entirely. This change may appear to fix the immediate issue but does so by creating a security vulnerability rather than addressing the root cause.