196 Commits

Author SHA1 Message Date
Michael Vogt
53e100759f Merge pull request #11502 from pedronis/disable-authority-delegation
asserts: minimal changes to disable authority-delegation before full revert
2022-03-15 15:00:00 +01:00
Samuele Pedroni
331724d76d asserts: minimal changes to disable authority-delegation before full revert
authority-delegation might have been premature, disable until we might
decide for a full revert
2022-03-14 18:47:04 +01:00
Michael Vogt
439f267378 many: replace use of "sanity" for interface implementation checks
This commit replaces the use of "sanity" with more inclusive
naming. When `// sanity` is used to check if an interface is
implemented the comment `expected interface is implemented`
is used.
2022-03-14 17:35:33 +01:00
Paweł Stołowski
0fe92618b3 Add missing tests, remove account-id, check that authority matches
brand.
2022-02-21 16:07:50 +01:00
Paweł Stołowski
537b9b1612 Add preseed assertion type. 2022-02-21 16:07:49 +01:00
Samuele Pedroni
e600a66137 asserts: small cleanups in check(No)Authority
thanks @stolowski and @MiguelPires
2022-02-14 11:44:12 +01:00
Samuele Pedroni
ffbb0e404c asserts: error consistency tweak 2022-02-11 15:24:41 +01:00
Samuele Pedroni
078cb5f74c asserts: first-class support for formatting/encoding signatory-id
together with checks for it
2022-02-11 15:24:41 +01:00
Samuele Pedroni
130242ee7e asserts: start supporting delegation when validating signatures
* start of basic test (failing here)
* start of signatory-id support
2022-02-03 11:22:12 +01:00
Samuele Pedroni
e1a856242e asserts: finish the scaffold of authority-delegation
main missing things since/until support and device scope constraint
support
2022-01-28 13:11:53 +01:00
Samuele Pedroni
2bb8fbc4d1 asserts: start of authority-delegation 2022-01-28 13:11:53 +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
Paweł Stołowski
cf75a47c6b Tweak AtSequence comment, omit "?" in the string repr if sequence point
is not set.
2021-02-04 11:36:38 +00:00
Paweł Stołowski
f027fdcf1a Handle NotFound error explicitly from Resolve; add
HeadersFromSequenceKey helper.
2021-02-03 16:28:04 +00:00
Paweł Stołowski
fe6ced9742 Extend comments, simplify String(). 2021-02-03 15:52:22 +00:00
Paweł Stołowski
293b0161b9 Introduce AtSequence type. 2021-02-03 11:16:11 +00:00
Samuele Pedroni
6adfc51ea7 Merge remote-tracking branch 'upstream/master' into asserts-find-sequence 2020-07-06 21:57:42 +02:00
Samuele Pedroni
5079d8c533 asserts: fixes
thanks @stolowski
2020-07-01 17:22:40 +02:00
Samuele Pedroni
237c0103ac asserts: implement Database.FindSequence
FindSequence finds a sequence-forming assertion based the given
headers. Provided headers must contain a prefix of the primary key
for the assertion type except for the sequence header.
Th assertion is the first in the sequence under the prefix with
sequential number > after.
If after is -1 it returns instead the assertion with the largest
sequential number.
2020-06-29 14:14:28 +02:00
Samuele Pedroni
f583badfbe asserts: adjust terminology: sequence key, sequence number 2020-06-29 13:51:54 +02:00
Samuele Pedroni
59d467f1b5 asserts: introduce the concept of sequence-forming assertion types
this is expressed via AssertionType.SequenceForming and the
SequenceMember interface

so far repair and validation-set are sequence-forming
2020-06-29 13:46:42 +02:00
Samuele Pedroni
e4afb8b356 asserts: introduce new assertion validation-set
Merge pull request #8852 from pedronis/validation-set

See the doc comment for asserts.ValidationSet.
2020-06-17 19:14:37 +02:00
Michael Vogt
50a2d9dc18 asserts: add missing systemUserFormatAnalyze() (thanks Samuele) 2020-06-15 12:12:12 +02:00
Michael Vogt
1d20b3cf88 asserts,daemon: add support for "serials" field in system-user assertion
This will allow to hand out system-user assertions limited to a
limited set of serial assertions.

Implements the spec in https://forum.snapcraft.io/t/18163
2020-06-15 09:31:51 +02:00
Samuele Pedroni
e736092075 asserts: introduce new assertion validation-set 2020-06-11 20:05:45 +02:00