setting a ppa private cannot be done over the API

Bug #724740 reported by Robert Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Timothy R. Chavez

Bug Description

This API call to set a PPA to private by a ~commercial-admin should work:

    launchpad = Launchpad.login_with(
        'test', service_root='https://api.launchpad.net', version='devel')
    user = launchpad.people['timrchavez']
    ppa = user.getPPAByName(name="test6")
    ppa.private = True
    ppa.lp_save()

This was failing due to bug 724522 but there may be deeper issues. Probably the appserver needs to generate a builddsecret on the fly. The builddsecret should not be accepted over the API.

Related branches

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

I put my comment on the last bug via email before I noticed it had morphed into a different problem. So I'll repeat here:

buildd_secret is entirely internal and should never, ever be exposed anywhere. There is code to auto-generate it via the UI and this should be duplicated in the API call.

summary: - setting a ppa private fails for commercial admins
+ setting a ppa private cannot be done over the API
Curtis Hovey (sinzui)
tags: added: api ppa
Revision history for this message
Timothy R. Chavez (timrchavez) wrote :

I've proposed my implementation for this bug and discussed it with bigjools on #launchpad-dev.

The basic strategy is to make the 'private' attribute on IArchivePublic read-only and create a mutator for it (e.g. setPrivate) which will replace the current validator ( _validate_archive_privacy) and add the logic to set 'private' and, if set to True, generate and set the value of the 'buildd_secret' attribute if it does not yet exist.

Changed in launchpad:
assignee: nobody → Timothy R. Chavez (timrchavez)
Changed in launchpad:
status: Triaged → In Progress
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 724740] Re: setting a ppa private cannot be done over the API

On Fri, May 27, 2011 at 4:17 AM, Timothy R. Chavez
<email address hidden> wrote:
> I've proposed my implementation for this bug and discussed it with
> bigjools on #launchpad-dev.
>
> The basic strategy is to make the 'private' attribute on IArchivePublic
> read-only and create a mutator for it (e.g. setPrivate) which will
> replace the current validator ( _validate_archive_privacy) and add the
> logic to set 'private' and, if set to True, generate and set the value
> of the 'buildd_secret' attribute if it does not yet exist.

Huh? Just make altering the private attribute run some business logic.
No API changes are needed.

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
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.