aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rpkid/rpki/irdb/zookeeper.py9
-rw-r--r--rpkid/rpki/left_right.py2
-rw-r--r--rpkid/rpki/rpkic.py37
3 files changed, 42 insertions, 6 deletions
diff --git a/rpkid/rpki/irdb/zookeeper.py b/rpkid/rpki/irdb/zookeeper.py
index 092717a1..f99dc9f0 100644
--- a/rpkid/rpki/irdb/zookeeper.py
+++ b/rpkid/rpki/irdb/zookeeper.py
@@ -1671,3 +1671,12 @@ class Zookeeper(object):
for range in asns:
ee_request.asns.create(start_as = str(range.min), end_as = str(range.max))
+
+
+ @django.db.transaction.commit_on_success
+ def delete_router_certificate_request(self, gski):
+ """
+ Delete a router certificate request from this RPKI entity.
+ """
+
+ self.resource_ca.ee_certificate_requests.get(gski = gski).delete()
diff --git a/rpkid/rpki/left_right.py b/rpkid/rpki/left_right.py
index 1913fc7a..2d46cdfa 100644
--- a/rpkid/rpki/left_right.py
+++ b/rpkid/rpki/left_right.py
@@ -1150,6 +1150,8 @@ class list_published_objects_elt(rpki.xml_utils.text_elt, left_right_namespace):
for r in ca_detail.roas if r.roa is not None)
r_msg.extend(self.make_reply(g.uri, g.ghostbuster)
for g in ca_detail.ghostbusters)
+ r_msg.extend(self.make_reply(c.uri, c.cert)
+ for c in ca_detail.ee_certificates)
cb()
def make_reply(self, uri, obj, child_handle = None):
diff --git a/rpkid/rpki/rpkic.py b/rpkid/rpki/rpkic.py
index 10a04987..d5339f5b 100644
--- a/rpkid/rpki/rpkic.py
+++ b/rpkid/rpki/rpkic.py
@@ -717,12 +717,37 @@ class main(Cmd):
if self.autosync:
self.zoo.run_rpkid_now()
- # Going to need some way to delete router certificate requests too.
- # This probably means that we specify which request to delete by
- # g(SKI), which means we need a g(SKI) completion function and a
- # show method to display a table of g(SKI)s, router-ids, and
- # valid_until values.
- #
+ @parsecmd(argsubparsers,
+ cmdarg("gski", help = "g(SKI) of router certificate request to delete"))
+ def do_delete_router_certificate_request(self, args):
+ """
+ Delete a router certificate request from the IRDB.
+ """
+
+ try:
+ self.zoo.delete_router_certificate_request(args.gski)
+ if self.autosync:
+ self.zoo.run_rpkid_now()
+ except rpki.irdb.ResourceHolderCA.DoesNotExist:
+ print "No such resource holder \"%s\"" % self.zoo.handle
+ except rpki.irdb.EECertificateRequest.DoesNotExist:
+ print "No certificate request matching g(SKI) \"%s\"" % args.gski
+
+ def complete_delete_router_certificate_request(self, text, line, begidx, endidx):
+ return [obj.gski for obj in self.zoo.resource_ca.ee_certificate_requests.all()
+ if obj.gski and obj.gski.startswith(text)]
+
+
+ @parsecmd(argsubparsers)
+ def do_show_router_certificate_requests(self, args):
+ """
+ Show this entity's router certificate requests.
+ """
+
+ for req in self.zoo.resource_ca.ee_certificate_requests.all():
+ print "%s %s %s %s" % (req.gski, req.valid_until, req.cn, req.sn)
+
+
# What about updates? Validity interval, change router-id, change
# ASNs. Not sure what this looks like yet, blunder ahead with the
# core code while mulling over the UI.