summaryrefslogtreecommitdiff
path: root/devel/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-02-03 13:55:25 -0600
committerDan McGee <dan@archlinux.org>2013-02-03 13:56:35 -0600
commit9da8a63dd476fe3607a68a028655c9f9d0fee163 (patch)
tree6d16436917a3231845974171c3e06816feaad1c1 /devel/models.py
parent844ed8109317db882e5d2b2ae8fa6084f794d798 (diff)
Add DeveloperKey model
We're starting to see developers use subkeys of their primary key to sign packages, which we aren't handling well in the web interface. These subkeys show up as unknown, which isn't strictly true. Start the process of being able to handle these keys by adding a model that will store all known keys and subkeys and the relationships among them, as well as which developer owns each. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/models.py')
-rw-r--r--devel/models.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/devel/models.py b/devel/models.py
index 6689ca3d..67de40a6 100644
--- a/devel/models.py
+++ b/devel/models.py
@@ -68,7 +68,6 @@ class UserProfile(models.Model):
return '/%s/#%s' % (prefix, self.user.username)
-
class MasterKey(models.Model):
owner = models.ForeignKey(User, related_name='masterkey_owner',
help_text="The developer holding this master key")
@@ -88,6 +87,20 @@ class MasterKey(models.Model):
self.owner.get_full_name(), self.created)
+class DeveloperKey(models.Model):
+ owner = models.ForeignKey(User, related_name='all_keys', null=True,
+ help_text="The developer this key belongs to")
+ key = PGPKeyField(max_length=40, verbose_name="PGP key fingerprint",
+ unique=True)
+ created = models.DateTimeField()
+ expires = models.DateTimeField(null=True, blank=True)
+ revoked = models.DateTimeField(null=True, blank=True)
+ parent = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
+
+ def __unicode__(self):
+ return self.key
+
+
class PGPSignature(models.Model):
signer = PGPKeyField(max_length=40, verbose_name="Signer key fingerprint")
signee = PGPKeyField(max_length=40, verbose_name="Signee key fingerprint")