-
Notifications
You must be signed in to change notification settings - Fork 268
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
Project RSS feed #1158
Project RSS feed #1158
Conversation
71b5e14
to
e1f5113
Compare
As mentioned:
We are using SQLAlchemy-continuum, so I guess that the last transaction is already accessible. But I don't have time to investigate it right now, it's just an idea. |
I can look at this in another PR once this one is merged if it OK with you. |
@Glandos any chance you might have some time to review this soon 🙏 ? |
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.
Thanks for working on this. It's working the right way to me, as the generated URLs will be able to only access the RSS endpoint.
Before merging, we should IMO decide if we want to integrate etags
and if-modified-since
, so that what we have in the main branch is feature-complete.
I advocate for the integration of these two =)
xmlns:atom="http://www.w3.org/2005/Atom" | ||
> | ||
<channel> | ||
<title>{{ g.project.name }}</title> |
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.
Maybe add "I Hate Money — " as a prefix here maybe, to make it obvious in the feed reader?
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.
I am not sure this is needed. Most readers display the channel name somewhere. Often you can also click select channel to only see the items for that specific channel. Displaying I Hate Money
feels redundant to me.
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.
I'm not sure I get it. Are you saying the channel name isn't coming from the <title>
tag? If you only have the project name, how do you know it's coming from this software?
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.
Ahh my bad. I though we were talking about the item title, and not the channel title. It makes sense, I fixed that.
What about adding a link and a button in the settings of the project? |
e1f5113
to
eb2968b
Compare
I added a |
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.
Looks good to me, I added a few other comments after a second pass. Hope you don't mind too much.
Thanks again for the work on this. I'm curious what other people think about etags and so on.
xmlns:atom="http://www.w3.org/2005/Atom" | ||
> | ||
<channel> | ||
<title>{{ g.project.name }}</title> |
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.
I'm not sure I get it. Are you saying the channel name isn't coming from the <title>
tag? If you only have the project name, how do you know it's coming from this software?
ihatemoney/tests/budget_test.py
Outdated
> | ||
<channel> | ||
<title>raclette</title> | ||
<description>A simple shared budget manager web application</description> |
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.
Well, actually it feels odd to me. You need to state that it's a feed with the latest bills from this project, maybe?
eb2968b
to
4649496
Compare
Not at all, I understand what maintainership is and why you may be careful.
I'll look at this soon. |
@almet to be able to return a Are you OK with that? |
As @Glandos noted earlier, we're using SQLAlchemy-continuum to version the changes, which should make things easier for us. It took me some time to find out that the I'm not sure if we have to chose between I advocate for using the easier one (unless there is something I don't get), which in this case seems to be |
Ok thank you for the tips I will look at that. I think both headers can be implemented at a cheap cost. |
4649496
to
1c73d9f
Compare
I just force-pushed the branch with the integration of the headers. I added pytest-libfaketime as a dev dependency to mock datetimes. I chose this instead of freezegun because, as freezegun is pure python it would not correctly mock sqlalchemy datetimes, but libfaketime works on a lower level and is able to mock sqlalchemy I use continuum to find the last datetime edition for a project, and handle I could not track bills edition that way though, but addition/deletion works fine. |
1c73d9f
to
a422f7b
Compare
I just realized that I forgot to send the |
a422f7b
to
cd7a2bc
Compare
This is better now. |
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.
I really like the approach, thanks a lot for working on this!
I left some comments, I hope you don't mind adding a few more tests ;)
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.
Please add a test that checks that we can't access another project with a "feed" token. Our first and only CVE was about unauthorized access by tweaking the project ID, so we definitely want to check that we don't introduce a similar issue for this new route (even if it's read-only).
Two cases are interesting: another project with the same private code, and another project with a different private code. Both should not allow access.
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.
Done.
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.
I was thinking of accessing the RSS feed of another project with the RSS token. Your new tests try to use the RSS token as an invite token, which is already well covered by test_invalid_invite_link_with_feed_token
.
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.
Ok that makes more sense 😅
I'll fix that.
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 fixed 👍
7bd8a49
to
641a456
Compare
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.
LGTM!
641a456
to
16378a4
Compare
Thanks for the changes, I still have a change request on the tests (testing we can't access other project's RSS feed), otherwise the rest looks good to me! |
16378a4
to
bb1eb07
Compare
bb1eb07
to
8c27afd
Compare
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.
Nice work!
Thanks again for the work on this. Yay! |
Partially implements #1130, possibly
etags
andif-modified-since
headers are missing, but let's discuss this in #1130This patch generates a feed for each project, with a dynamic secret part in the URL based on the existing
Project.generate_token
method. The generated feed passes the w3c validation<title>
and<description>
can probably different, but the main data is here. Let me know what you prefer. Also, the content is simple enough so it does not need to be localized. If more information is needed and the feed content does need to be localized, maybe a lang variable can be added to the feed URL.Maybe it worth adding an icon somewhere? Near the Invite button?
A firefox extension like awesome-rss automatically detects the feed on a project page, so I can live without it.