Person permission check for creating [p]ppa subscription tokens

Bug #341600 reported by Michael Nelson
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Steve Kowalik

Bug Description

IArchive will have a newAuthToken(person) method that creates a token for the given person so that they can access a private repository. This method ensures that:

1) The person already has a current subscription for the archive (created by the archive owner separately)
2) The person does not already have a current token for the archive.

What the method cannot do is verify that the logged-in user calling the method (could be a view or webservice) has the launchpad.Edit permission of the person (more simply, that the callsite is logged in as the person). For this reason, the IArchive.newAuthToken() method cannot yet be exposed on the API.

One possible solution would be to proxy the call via IPerson.newArchiveAuthToken() and ensure that this method requires launchpad.Edit. But needs further discussion.

Related branches

Revision history for this message
Michael Nelson (michael.nelson) wrote :

A second possibility discussed is to add a user=None parameter to the IArchive.newAuthToken() method. This would solve the webservice problem (using the @call_with decorator), but means that all other code would need to do: archive.newAuthToken(person, user=person).

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Doing security validation in the content class is not really right, it needs to be done in the zope security wrappers. We need to come up with some security adapter code into where we can move the check that you have a valid subscription.

Changed in soyuz:
importance: Undecided → Low
status: New → Triaged
tags: added: p3a ppa
Steve Kowalik (stevenk)
tags: added: qa-ok
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in soyuz:
assignee: nobody → Steve Kowalik (stevenk)
milestone: none → 10.06
tags: added: qa-needstesting
removed: qa-ok
Changed in soyuz:
status: Triaged → Fix Committed
Ursula Junque (ursinha)
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in soyuz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.