chiark / gitweb /
make-secnet-sites: Rework with new `inpub' class
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 Dec 2019 17:38:31 +0000 (17:38 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:52 +0000 (21:56 +0000)
commitdb4b8821ec4768cc0b33ffaa83fdc1f9d96ea497
tree7768922ac1d57eea1c6d5f7d2e961b889a4d458a
parent3a9dbc44ec05a2d3b2990302d3b6ba5f59f89917
make-secnet-sites: Rework with new `inpub' class

The use of k.forsites(,None,) was rather unprincipled and required a
strange comment.  Instead, invent a `forpub' method for this use.
`forsites' can be implemented, for these classes, in terms of forpub.

Likewise testing whether the return from forsites was []; replace that
with an okforonlykey method.  (The implementation uses the same trick
but now it's inside the class.)

We transpose the if `pubkeys_install' with the `for k' loop.  The `not
pubkeys_install' arm is rather different now, accumulating in outk.

The one nontrivial consquence is that now if there are multiple
eligible keys to be written to a sites.conf, we fail, rather than just
choosing the first.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites