-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update API export to allow input session id #178
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 |
---|---|---|
|
@@ -114,7 +114,10 @@ def get(self, request, *args, **kwargs): | |
|
||
exporter.schedule = self.schedule | ||
if "-my" in exporter.identifier and self.request.user.id is None: | ||
return HttpResponseRedirect(self.request.event.urls.login) | ||
if request.GET.get('talks'): | ||
exporter.talk_ids = request.GET.get('talks').split(',') | ||
else: | ||
return HttpResponseRedirect(self.request.event.urls.login) | ||
Comment on lines
+117
to
+120
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. 🚨 issue (security): Security and logic flow concerns in authentication bypass The new condition allows unauthenticated access to functionality previously requiring login. This could expose sensitive information or operations. Consider maintaining authentication and implementing a secure method for sharing specific talks. Additionally, this change increases the complexity of the logic flow, potentially making the code harder to maintain. |
||
favs_talks = SubmissionFavourite.objects.filter(user=self.request.user.id) | ||
if favs_talks.exists(): | ||
exporter.talk_ids = favs_talks[0].talk_list | ||
|
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.
Here is the original code:
The author wanted to prevent
SubmissionFavourite.objects.filter()
from receivingNone
, so there is the checkself.request.user.id is None
, to force user logging-in.But you insert your code in this
if
flow control and nullify the guard. After your code,return HttpResponseRedirect
doesn't run andNone
strips toSubmissionFavourite.objects.filter
.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.
Hi @hongquan, this view is using for both talk and video component:
Idea for this changes is reuse the current API for Video schedule export, not impact flow at talk component
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.
@lcduong Could you add your explanation as comment above that line?