The default encoding is utf-8, which is what we want, but it's confusing
not to specify it.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Now, if the type "hash" and a more specific type (e.g. "sha256") are
present, the more specific type will remain and the generic type will be
removed. This allows creating databases that can be imported by earlier
versions of newfol.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
A lot of the code stores the items for later, and using an iterator will
result in unhappiness when the data can't be iterated over more than once.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This allows for better diffing, and it also makes it possible to load
untrusted data from the dtb file if that becomes necessary.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
As well as testing that all files are checked into git when using git
transactions, test that the files actually checked in are exactly the
expected ones.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
The appropriate hash to use for validating the data is automatically
detected, and if no hash type is specified, use SHA-512 on 64-bit systems
and SHA-256 on 32-bit systems, as this provides the best performance.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Turn the SHA256Transaction store into a HashTransactionStore and support
SHA-384 and SHA-512, which provide better performance on 64-bit systems.
Don't support SHA-224 since it is weaker and is only useful where the hash
would be truncated anyway.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
The mode was always being reported as "w" (write), which resulted in SHA-256
checksums not being validated on load.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
We should not rely on the user setting up reasonable values for the committer
identification for git. Use a committer name of newfol and an email address
consisting of the user's username and the FQDN of the machine.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Since currently we can only serialize YAML, not load it, verify that it
serializes correctly twice.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Extend the filemanip tests to ensure that the data is serialized the same way
every time.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This also includes a unit test to ensure that round-tripping works properly for
those serializations where it's supported.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>