Add contrib wallet-rekey-periodic script

Add a new contrib script, wallet-rekey-periodic, which is used at
Stanford to periodically rekey hosts from cron.

Change-Id: Ic1f515da44e55623f7d6864f9a3cebf24c08e13b
Reviewed-on: https://gerrit.stanford.edu/1547
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Document enctype reference table population in NEWS

Change-Id: I3b3a035817e7e8f1c0e9709505490ce0ec299f3d
Reviewed-on: https://gerrit.stanford.edu/1548
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Also drop the new duo table when destroying the database

In Wallet::Admin, add duo to the list of tables to drop when
either destroying or reinitializing the database.

Change-Id: I78790927f7d53b8d596e6ccb7c2340a341e404ae
Reviewed-on: https://gerrit.stanford.edu/1549
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Drop use POSIX from several tests that don't use it

Change-Id: I61379e8963569d26c9b9c31d1727f3cca4567f8e
Reviewed-on: https://gerrit.stanford.edu/1550
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Use DateTime objects in the database layer, not strings

Pass in DateTime objects for the date fields in the database instead
of formatted time strings.  This provides better compatibility with
different database engines.  Document in README the need to install
the DateTime::Format::* module corresponding to the DBD::* module used
for the server database.

Change-Id: Id25796da718d734ac96ca27ccea9045b0c80c03f
Reviewed-on: https://gerrit.stanford.edu/1551
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Adjust create-ddl for the move of modules to lib

Now needs a use lib 'lib' in order to run out of the source
directory.

Change-Id: Ia8645eae6c6699db919968d42f057b06e42150a2
Reviewed-on: https://gerrit.stanford.edu/1552
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Record the ACL name in the acl_history table

Store the current name of the ACL with each history row, and index
the name.  This will eventually allow retrieval of history by name
for ACLs that have been deleted, although the rest of the code is
not yet in place.

The initial creation and membership of the ADMIN ACL during database
initialization or reinitialization is no longer recorded in the
acl_history table, since otherwise it produces errors due to the
missing ah_name field when building the database with schema 0.07.
There should be some better solution to this, but this will be okay
for the time being.

Change-Id: I015a00c972e0c2730c3d449952fcfe9b79c6e54f
Reviewed-on: https://gerrit.stanford.edu/1553
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Record ACL names in the ACL history

Change-Id: I0d7a088bb34dda2fc554b9f104c2a33e5faf879e
Reviewed-on: https://gerrit.stanford.edu/1554
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Use DateTime objects uniformly, improve expires parsing

Always use DateTime objects for every date field in the database,
and translate them into the local time zone for display when
pulling them out of the database.  This should provide better
portability to different database backends.

Change the parsing of expires arguments to use Date::Parse, thus
supporting a much broader variety of possible date and time
formats and allowing easy conversion to a DateTime object.
Document the new dependency.

Change-Id: I2ee8eaa6aa6ae9925ac419e49234ec9880d4fe95
Reviewed-on: https://gerrit.stanford.edu/1555
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Fix wallet-backend parsing of expires

Fix wallet-backend parsing of the expires command to expect only one
argument as the expiration.  This was correctly documented in the
wallet client man page, but not in wallet-backend, and it accepted two
arguments (a date and time).  However, Wallet::Server did not and
would just ignore the time.  Now wallet-backend correctly requires the
date and time be passed as a single argument.

Change-Id: I8e51a576ea8781502f4eb983462ceca867b002be
Reviewed-on: https://gerrit.stanford.edu/1556
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>