GPG keys not exposed in API
Bug #389872 reported by
Loïc Minier
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Didier Roche-Tolomelli |
Bug Description
Hi
I'd like to retrieve people's GPG keys from Launchpad as to generate a keyring from the ubuntu-dev / ubuntu-core-dev teams. I don't think this is currently exposed in API (apologies if it is, didn't find it on people's objects nor in the API ref).
Cheers,
----------------
what we need is:
- getting GPG keys available from Launchpad (and details info like emails)
- associate a new GPG key with a LP account
- get/sign the CoC
Related branches
lp:~jml/launchpad/expose-gpgkeys-bug-389872
Merged
into
lp:launchpad
- Eleanor Berger (community): Approve
-
Diff: 1071 lines (+331/-148)30 files modifiedlib/canonical/launchpad/browser/logintoken.py (+31/-103)
lib/canonical/launchpad/database/logintoken.py (+70/-0)
lib/canonical/launchpad/doc/gpg-encryption.txt (+3/-3)
lib/canonical/launchpad/ftests/keys_for_tests.py (+1/-1)
lib/canonical/launchpad/interfaces/gpghandler.py (+38/-0)
lib/canonical/launchpad/interfaces/logintoken.py (+21/-0)
lib/canonical/launchpad/mail/incoming.py (+1/-1)
lib/canonical/launchpad/templates/logintoken-validatesignonlygpg.pt (+1/-1)
lib/canonical/launchpad/utilities/gpghandler.py (+12/-4)
lib/lp/archivepublisher/tests/archive-signing.txt (+1/-1)
lib/lp/registry/browser/configure.zcml (+7/-0)
lib/lp/registry/browser/person.py (+1/-1)
lib/lp/registry/browser/tests/gpg-views.txt (+3/-3)
lib/lp/registry/browser/tests/test_gpgkey.py (+30/-0)
lib/lp/registry/interfaces/gpg.py (+17/-5)
lib/lp/registry/interfaces/person.py (+12/-3)
lib/lp/registry/model/gpgkey.py (+18/-0)
lib/lp/registry/model/person.py (+3/-3)
lib/lp/registry/stories/webservice/xx-person.txt (+42/-0)
lib/lp/registry/templates/codeofconduct-list.pt (+1/-1)
lib/lp/registry/templates/person-editpgpkeys.pt (+6/-6)
lib/lp/registry/templates/person-portlet-contact-details.pt (+2/-2)
lib/lp/registry/templates/person-rdf-contents.pt (+1/-1)
lib/lp/registry/templates/signedcodeofconduct-add.pt (+1/-1)
lib/lp/soyuz/doc/archive.txt (+1/-1)
lib/lp/soyuz/doc/nascentupload.txt (+1/-1)
lib/lp/soyuz/stories/webservice/xx-archive.txt (+1/-1)
lib/lp/soyuz/tests/ppa.py (+2/-2)
lib/lp/soyuz/tests/test_packageupload.py (+1/-1)
lib/lp/soyuz/tests/test_publishing.py (+2/-2)
affects: | launchpadlib → launchpad-registry |
tags: | added: api |
Changed in launchpad-registry: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in launchpad-registry: | |
milestone: | none → 10.02 |
description: | updated |
Changed in launchpad-registry: | |
milestone: | 10.02 → 10.03 |
tags: | added: quickly |
tags: |
added: qa-ok removed: qa-needstesting |
To post a comment you must log in.
This is a pretty straightforward bug to fix. There are two major components to it: setting up our GPG key objects to be exported via the API and then exporting the GPG key attributes that are on the Person object.
For the first one, you'll want to edit lp/registry/ interfaces/ gpg.py. In order to prepare the IGPGKey object for exporting, you'll need to tweak the interface a bit. I'd suggest looking at lp/registry/ interfaces/ sourcepackage. py for another example of this. The trick is to find the invocations of things that were imported from lazr.restful.
For the second one, look at lp/registry/ interfaces/ person. py. You'll see a bunch of attributes on the IPersonPublic interface that are wrapped in exported(). You'll want to do the same for gpgkeys, pendinggpgkeys and probably others.
You can run the tests for the Person webservice with the command './bin/test -1cvvt webservice/ xx-person. txt'. You can find the tests in canonical/ launchpad/ pagetests/ webservice/ xx-person. txt. The tests really ought to live in lp/registry/ stories/ webservice/ , but one thing at a time.
Running 'make build' and then 'make run' and browsing to https:/ /launchpad. dev/+apidoc can be helpful for checking the API documentation, and for confirming that the attributes are, in fact, exposed.
Let me know if you have any questions.