1050 Commits

Author SHA1 Message Date
Paweł Stołowski
37e4b217c4 Use Ref().PrimaryKey instead of At().PrimaryKey (thanks pedronis). 2021-09-17 09:38:32 +02:00
Paweł Stołowski
b1fbca56a9 Return full validation set keys from CheckPresenceRequired and
CheckPresenceInvalid; full keys including series and sequence are
expected by store api.
2021-09-17 09:38:32 +02:00
Paweł Stołowski
8e094d70b3 Add doc comment to PresenceConstraintError. 2021-07-27 08:18:29 +02:00
Paweł Stołowski
cc9cf4dfdf Fix format. 2021-07-27 08:12:37 +02:00
Paweł Stołowski
9b47121247 Introduce PresenceConstraintError. 2021-07-27 08:12:37 +02:00
Paweł Stołowski
b8afc08fe1 Return an error from CheckPresenceRequired and CheckPresenceInvalid if
the presence if opposite to what the function is about.
2021-07-27 08:12:37 +02:00
Paweł Stołowski
64807cb59c Implement CheckPresenceInvalid and CheckPresenceRequired methods for
ValidationSets.
2021-07-27 08:12:37 +02:00
Michael Vogt
d3a74b498d Merge remote-tracking branch 'upstream/master' into switch-to-golang-1.13 2021-07-23 16:12:45 +02:00
Paweł Stołowski
16d858b20c Simplify TestBackstore test (thanks pedronis) 2021-07-13 12:05:22 +02:00
Paweł Stołowski
d9d09f1915 Add test for Backstore() function. 2021-07-13 09:05:11 +02:00
Paweł Stołowski
909e34c75a Check for conflicts when refreshing and commiting validation set assertions. 2021-07-12 11:13:20 +02:00
Samuele Pedroni
d9a4499dbf c/snap,asserts: create/delete-key external keypair manager interaction
at least initially we don't support using snap commands to create/delete
keys under an external keypair manager, organize things such that though
we can produce appropriate error messages and we can implement
supporting this later if required
2021-07-08 11:39:47 +02:00
Samuele Pedroni
f8b8615476 c/snap,asserts: introduce KeypairManager.List for "snap keys"
implement it in both GPGKeypairManager and ExternalKeypairManager
2021-07-01 16:53:28 +02:00
Michael Vogt
79a93de625 Merge pull request #10370 from pedronis/ext-keymgr-1
asserts: introduce ExternalKeypairManager
2021-07-01 16:47:37 +02:00
Samuele Pedroni
226ab58974 asserts: some small cleanups and clarifications
thanks @mvo
2021-06-29 18:01:04 +02:00
Samuele Pedroni
e05c79847f asserts: clearer error messages, more robust mock command
thanks @stolowski, @degville
2021-06-24 16:58:10 +02:00
Michael Vogt
53d63d65bd many: run gofmt to match go-1.13 2021-06-24 11:42:13 +02:00
Samuele Pedroni
f2cdb6dd92 asserts,interfaces,snap: fix imports order (according to gci) 2021-06-14 20:54:41 +02:00
Samuele Pedroni
c190fd2b05 asserts: test how ExternalKeypairManager.loadAllKeys is implemented 2021-06-10 13:48:22 +02:00
Samuele Pedroni
61d41d8d81 asserts: DER public keys are expected to be PKIX
that's the case with pkcs11-tool
2021-06-10 11:58:47 +02:00
Samuele Pedroni
a97126c78e asserts: implement ExternalKeypairManager.Export 2021-06-10 09:20:58 +02:00
Samuele Pedroni
716a951c5d asserts: full ExternalKeypairManager.Get implementation
also fix/improve key caching
2021-06-10 09:20:58 +02:00
Samuele Pedroni
895e560e48 asserts: introduce ExternalKeypairManager
this supports using an external program with a simple interface to
handle key management.

this starts with minimal support to be able to perform signing.
2021-06-09 20:30:54 +02:00
Alberto Mardegan
37e83765f3 asserts: fix errors reported by linter
Besides some trivial fixes, this also adds the (previously unused) class
`isUnacceptedUpdateSuite` to the tests suite.
2021-05-05 10:16:20 +03:00
Samuele Pedroni
35c76d6f1a seed: ReadSystemEssentialAndBetterEarliestTime (#10005)
ReadSystemEssentialAndBetterEarliestTime retrieves in one go
information about the model and essential snaps of the given types
for the Core 20 recovery system seed specified by seedDir and label
(which cannot be empty).
It can operate even if current system time is unreliable by taking
a earliestTime lower bound for current time.
It returns as well an improved lower bound by considering appropriate
assertions in the seed.

* asserts: Batch.CommitToAndObserve

have a variant of CommitTo that supports a callback to consider each
assertion immediately after it has been added to the database, at
which point it also verified
2021-03-18 18:40:16 +01:00