1130 Commits

Author SHA1 Message Date
Samuele Pedroni
1f6c27adb7 asserts/info,mkversion.sh: capture max assertion formats in snapd/info 2022-05-17 20:39:12 +02:00
Michael Vogt
7e80a58091 Merge pull request #11709 from mvo5/starred-developers
snap: implement "star" developers
2022-04-28 20:01:04 +02:00
Samuele Pedroni
cbcc460bdc a/snapasserts: tweak/rewrap the DeriveSideInfo* doc comments 2022-04-25 11:05:14 +02:00
Michael Vogt
26352ada90 asserts: Fix Account.Validation doc string (thanks to Samuele) 2022-04-25 10:50:18 +02:00
Samuele Pedroni
c848f677d8 a/snapasserts: introduce DeriveSideInfoFromDigestAndSize
this is simply split out from DeriveSideInfo
2022-04-22 17:41:14 +02:00
Michael Vogt
290689cb39 snap: implement "star" developers
This commit adds support for the new account `starred` validation
value. It displays a unicode star "✪" when possible, otherwise
a ascii "*". Note that this also means that validated developers
get a "**" appended now. While this is an incompatible change
it is what was agreeded in the star developers spec because it
is the most natural way to present these values in ascii.
2022-04-22 15:54:59 +02:00
Samuele Pedroni
bee5d6bcaf asserts: simplify some of the optional primary keys with default code 2022-04-21 17:11:33 +02:00
Paweł Stołowski
81f307bd61 Merge branch 'master' into asserts-opt-primary-keys 2022-04-15 17:18:57 +02:00
Paweł Stołowski
5245cd1ba8 Fix ineffectual assignment in the test. 2022-04-15 17:18:11 +02:00
Paweł Stołowski
1f6f1ee740 Fixes related to inclusive language. 2022-04-14 12:51:08 +02:00
Samuele Pedroni
e1bb531595 asserts,store: relax reportFetchAssertionsError logic
use a new AssertionType.AcceptablePrimaryKey to check whether a key
has enough entries allowing for the omission of optional primary key
headers
2022-04-06 14:17:12 +02:00
Samuele Pedroni
491ff56795 asserts: export MockOptionalPrimaryKey for usage in other packages 2022-04-06 14:17:12 +02:00
Samuele Pedroni
a5d271b8f7 asserts: Ref supports for optional primary key headers
including being built with a PrimaryKey omitting default values

introduce ReducePrimaryKey to omit default values, useful also when
dealing with systems that might not support given optional primary
keys yet
2022-04-06 14:17:12 +02:00
Samuele Pedroni
c885693492 asserts: support in HeadersFromPrimaryKey for omitted optional primary keys 2022-04-06 14:17:12 +02:00
Samuele Pedroni
98de63ac23 asserts: support optional primary keys in Find family
change PrimaryKeyFromHeaders to allow for omitted optional primary
keys
2022-04-06 14:17:12 +02:00
Samuele Pedroni
df8b2a9c33 asserts: support optional primary keys in the memory backstore
as this is in-process there are no backward compatibility concerns
2022-04-05 14:05:40 +02:00
Samuele Pedroni
67ad4bcb85 asserts: clarify and simplify around optional primary key headers
clarify optional primary key headers and defaults, thanks @bboozzoo

simplify AssertionType.validate, thanks @stolowski
2022-04-05 10:04:48 +02:00
Samuele Pedroni
bf45d31d59 Merge remote-tracking branch 'upstream/master' into asserts-opt-primary-keys-1
fix conflict
2022-04-05 09:56:54 +02:00
James Henstridge
2dd614a92b interfaces: add private /dev/shm support to shared-memory interface
* interfaces: add a "private" attribute to the shared-memory interface

* interfaces: forbid mixing private and non private shared-memory plugs/slots on a snap

* interfaces: add mount entries for private shared-memory plugs

* cmd/snap-update-ns: set permissions for private shared-memory directory

* tests: update test-snapd-policy-app-consumer:shared-memory plug definition

* interfaces: BeforePrepareSlot is not called on implicit slots, so don't try to do anything there.

* interfaces/builtin: update shared-memory base declaration

* interfaces, cmd/snap-update-ns: allow writing to /dev/shm

* tests: add a test for private /dev/shm support

* interfaces: small fixes from review feedback

* tests: update description of spread test

* interfaces: fix typo mentioned in review

* many: use slot-snap-id to constraint shared-memory slot installation

this makes --dangerous install work while blocking actually app slots
not allowed by the store

* interfaces/policy: test that core and snapd snaps can provide a shared-memory slot

* interfaces/policy: add tests for shared-memory interface connection

* interfaces/policy: check shared-memory auto-connect behaviour of base declaration

* interfaces, tests: if /dev/shm is a symlink, refuse to connect a private shared-memory plug

Co-authored-by: Samuele Pedroni <pedronis@lucediurna.net>
2022-04-04 15:52:16 +02:00
Michael Vogt
d026f52799 Merge pull request #11593 from stolowski/fix-preseed-assert-seen-by-id
asserts: exclude empty snap id from duplicates lookup with preseed assert
2022-03-31 21:38:58 +02:00
Pawel Stolowski
e63994223f cmd/snap, signtool: move key-manager related helpers to signtool package
* Move key-manager related helpers to signtool package.

* Restore the location of GetKeypairManager. Fix gci-reported error.

* Add doc comments.

* Add docstring to KeyPairManager interface.
2022-03-31 21:36:23 +02:00
Paweł Stołowski
65e06eabde Exclude empty snap id from duplicates lookup when validating preseed assertions, otherwise it's not possible to have two local snaps. 2022-03-31 11:36:56 +02:00
Michael Vogt
50fca7c0eb Merge pull request #11511 from mvo5/less-sanity-3
many: replace use of "sanity" with more inclusive naming (part 2)
2022-03-25 11:04:45 +01:00
Samuele Pedroni
f43cc33d3d asserts,interfaces/policy: slot-snap-id allow-installation constraints
The use case for this is that we have now the unsupported situation of
an interface that is superprivileged but still wants to have special
system snap slots.

Because it needs to cover also the --dangerous case the
base-declaration slot side slot-snap-type constraint cannot express
this, it needs to allow both core and app. To restrict this as needed
we then allow to use slot-snap-id which can list the well-known system
snap ids.

Notice that this kind of constraint makes sense only in the
base-declaration.  In a snap-declaration the snap-id is fixed and
implied. We also do not want to put interface rules in the actual
snap-declarations of the system snaps.

Although there's no clear use case, as the system snaps don't have
plugs, we support also plug side allow-installation plug-snap-id for
symmetry.
2022-03-21 17:51:29 +01:00
Michael Vogt
46ef068423 many: replace use of "sanity" with more inclusive naming
This commit replaces the use of "sanity" with more inclusive
naming. When "sanity" is used in a more general sense either
"validity" or "quick" is used.
2022-03-16 09:10:59 +01:00