api gpg key URI is 404

Bug #838478 reported by Paul Tagliamonte
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

When I query for my GPG keys, I get a collection containing a bunch of elements, which is fairly stock. I get stuff similar to:

    "self_link": "https://api.launchpad.net/1.0/~paultag/+gpg-keys/B7982329",
    "self_link": "https://api.launchpad.net/1.0/~paultag/+gpg-keys/807C2A87",

    $ curl https://api.launchpad.net/1.0/~paultag/+gpg-keys/807C2A87
    Object: <Person at 0x13233950 paultag (Paul Tagliamonte)>, name: u'+gpg-keys'

Dang!

This behavior seems out of the norm when I compare it to other collection blobs.

< HTTP/1.1 404 Not Found
< Date: Thu, 01 Sep 2011 01:45:05 GMT
< Server: zope.server.http (HTTP)
< X-Powered-By: Zope (www.zope.org), Python (www.python.org)
< Content-Length: 77
< Content-Type: text/plain
< X-Cache: MISS from nutmeg.canonical.com
< X-Cache-Lookup: HIT from nutmeg.canonical.com:3128
< Via: 1.0 nutmeg.canonical.com:3128 (squid/2.7.STABLE7)
< Via: 1.1 api.launchpad.net
< Vary: Accept-Encoding
<
* Connection #0 to host api.launchpad.net left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
Object: <Person at 0x13b59290 paultag (Paul Tagliamonte)>, name: u'+gpg-keys'%

Tags: api
Revision history for this message
Martin Pool (mbp) wrote :

I agree this is unusual. I'm not absolutely totally convinced Launchpad needs to return you the contents of the key there (rather than just giving the client the id) but giving a URI that doesn't resolve is in poor taste.

Did you have a specific motivating example for trying this?

tags: added: api
affects: launchpadlib → launchpad
summary: - GPG link is borked
+ gpg key URI doesn't return the key
description: updated
summary: - gpg key URI doesn't return the key
+ api gpg key URI is 404
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Paul Tagliamonte (paultag) wrote :

Actually, I only came across this because I wrote (in an hour or so) a half-baked PHP library.

It handles collections by getting the collection link, and creating objects off all the self_links.

In short - I was trying to list all GPG keys - but because my API bindings are so primitive (like I said, random hack) this issue surfaced.

I doubt this is present in the Python library (unless you manually use the "borked" URL), so it's fairly harmless.

Thanks for the triage!

Revision history for this message
Martin Pool (mbp) wrote :

Cool, I'm glad you could get to that point in half an hour.

If the php client library gets even to a partially useful state we'd be happy to list in on the client help page etc.

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.