Merge lp:~adeuring/launchpad/bug-612779 into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Māris Fogels on 2010-08-03 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 9612 |
| Proposed branch: | lp:~adeuring/launchpad/bug-612779 |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
157 lines (+57/-9) 4 files modified
lib/canonical/launchpad/browser/librarian.py (+6/-5) lib/lp/bugs/browser/bugattachment.py (+20/-1) lib/lp/bugs/browser/configure.zcml (+5/-0) lib/lp/bugs/browser/tests/test_bugattachment_file_access.py (+26/-3) |
| To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-612779 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Māris Fogels (community) | code | 2010-08-03 | Approve on 2010-08-03 |
|
Review via email:
|
|||
Description of the Change
This branch fixes bug 612779:user controlled data will be exposed in the launchpad.net domains at the next release.
It ensures that HTTP responses for restircted LFA (ie.e, the content of bug attachments for private bugs) always have the HTTP header Content-
The branch defines a new class SafeStreamOrRed
Instances of StreamOrRedirec
Finally, I set the view class used in BugAttachmentFi
test: ./bin/test -vvt test_bugattachm
no lint
| Abel Deuring (adeuring) wrote : | # |
Hi Māris,
Agreed, the word "always" is questionable in this context. But a comparison "before/after" is a test is a bit difficult, I think. OK, I could monkey patch the view_class attribute of BugAttachmentFi
assertIsInstance() is sufficient:
def test_content_
# The content of restricted Librarian files for bug attachments
# is served by instances of SafeStreamOrRed
# which set the content disposition header of the HTTP response for
# to "attachment".
request = LaunchpadTestRe
navigation = BugAttachmentFi
view = navigation.
next_view, traversal_path = view.browserDef
next_view()
| Robert Collins (lifeless) wrote : | # |
Abel, could you do a small follow on patch for me?
I'd like a little more prose/documentation in the docstrings for the
views so that developers can see when they should use one or the other
view class.
rs=lifeless for such a tweak.
Thanks,
Rob
| Abel Deuring (adeuring) wrote : | # |
On 04.08.2010 02:52, Robert Collins wrote:
> Abel, could you do a small follow on patch for me?
>
> I'd like a little more prose/documentation in the docstrings for the
> views so that developers can see when they should use one or the other
> view class.
>
> rs=lifeless for such a tweak.
>
> Thanks,
> Rob
Robert,
I'd like to postpone this to when PQM is closed ;) reasons:
- I need to land at least two more branches to fix the "private bug
attachments" bug.
- ProxiedLFA, FileNavigationM
bit more testing (I've added some unit tests for private attachments
that are in fact more like tests of FileNavigationMixin and
StreamOrRedir
- StreamOrRedirec
lib.lp.
canonical.
Abel
| Robert Collins (lifeless) wrote : | # |
Sure, thats fine, its just polish we should do.

Hi Abel,
As noted on IRC, I think the class name StreamOrRedirec tLibraryFileAli asView indicates a serious object design problem: it sounds like you should have three polymorphic classes instead (StreamAliasView, SafeStreamAlias View, and RedirectedAlias View). But also as noted on IRC, Robert is is going to overhaul the entire LibrarianFileAlias implementation.
The only other potential issue I see is in the test body: the test says it is "ensuring that restricted files ALWAYS have a disposition of 'attachement'", but this test only checks that the one file served has said disposition. Whether or not the incoming request had the disposition added by the code is a mystery. I would prefer a "before and after" comparison that shows the disposition being added.
With the above points considered, r=mars.
Maris