launchpadlib person sshkeys requires authentication while fetching via URL doesn't

Bug #1014996 reported by Stewart Smith
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
William Grant

Bug Description

Code like the following doesn't print anything:

#!/usr/bin/python

from launchpadlib.launchpad import Launchpad

cachedir = "~/.launchpadlib/cache/"
launchpad = Launchpad.login_anonymously('fetch-ssh-keys', 'production', cachedir)

group = launchpad.people['percona-core']
for person in group.members:
        print person.name
        keys = person.sshkeys
        for k in keys:
                print k

While if you construct a url such as 'https://launchpad.net/~' + person.name + '/+sshkeys' and fetch it you're home free (i.e. it works)

Related branches

Revision history for this message
William Grant (wgrant) wrote :

Needs the usual trivial AnonymousAuthorization fix.

tags: added: api ssh trivial
Changed in launchpad:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Curtis Hovey (sinzui) wrote :

Specifically, lp.security.py needs
    class ViewISSHKey(AnonymousAuthorization):
        """Anyone can view an IISSHKey."""
        usedfor = ISSHKey

And we want a test using the anonymous login to show that the key can be retrieved from the collection.

William Grant (wgrant)
Changed in launchpad:
assignee: nobody → William Grant (wgrant)
status: Triaged → In Progress
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.