1057 Commits

Author SHA1 Message Date
Miguel Pires
13209fc52c many: fix formatting w/ latest go version
Fix formatting when running the latest version (1.17) of gofmt.
2021-12-08 13:59:56 +00:00
Samuele Pedroni
4a8ecace54 devicestate: Unregister deletes the device key pair as well
* daemon,tests: support forgetting device serial via API

this is done by posting {"action":"forget"} to /v2/model/serial

a flag no-registration-until-reboot is also supported

* many: more consistent naming Delete => DeleteByName on keypair mgrs

we actually want to introduce a Delete by key id on some of them now

* asserts: implement KeypairManager.Delete

* devicestate: Unregister deletes the device key pair as well

* tests: test device key deletion in generic-unregister

* asserts: avoid skipping the GPGKeypairManager.Delete test

pair --yes to --batch in the test
2021-12-02 18:04:53 +01:00
Samuele Pedroni
860aa6597d asserts: remove spurious code repetition
thanks @anonymouse64
2021-11-30 14:13:10 +01:00
Samuele Pedroni
00c3b5201c asserts: change behavior of alternative attribute matcher
change the behavior of an alt attribute matcher when matching against
a list of values to match the alternatives to each element and not
overall

this is the approach used by all other matchers against a list of
values

the old behavior was unused and as the new tests show the new behavior
is quite productive. if really needed expressing for different
variants of a list can still be done by expressing variants for one
full level up

to avoid uses of this confusing old snapd make sure format: 5 is used
to mark snap-declarations that use alt attribute matchers going
forward
2021-11-26 17:13:05 +01:00
Michael Vogt
856cd41c7f asserts: rename "white box" to "clear box" (woke checker)
First PR to fix an error from the "woke" checker [1].

[1] https://github.com/get-woke/woke
2021-11-22 10:08:19 +01:00
Paweł Stołowski
7d1fa87e1b Check ignoreValidation condition before the main switch (thanks
pedronis).
2021-10-22 09:56:46 +02:00
Paweł Stołowski
32c8a4c8ab Honor ignoreValidation flag on snaps when checking installed snaps
against enforce validation sets.
2021-10-22 09:52:28 +02:00
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