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>
Mon, 30 Dec 2019 13:15:50 +0000 (13:15 +0000)
commitcd30cf5288502664b0caf394046aaebd5e9caa32
tree1fd25a032aaffd61cd79f288e7d8305a1df236cc
parent50e37007cbb8f0245a200f3cab0cbed465b47a24
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