feat(store): record accepted package authority against the pin

An archie package declares its authority; nothing in the tree recorded the
operator's acceptance of it. This lands the acceptance-record slice of
docs/prds/store.md ("Authority"):

- storepkg.Authority gains Covers (the upper-bound predicate: equal or
  narrower applies, wider does not) and Validate (forge-permission
  vocabulary, no blank grants).
- Installed carries AcceptedAuthority (nil until accepted); install leaves it
  unset, so an unaccepted package has no authority.
- AcceptPackageAuthority on the storepkg Manager records the acceptance
  against the pinned digest and refuses grants the package does not declare
  (storepkg.ErrAuthorityNotDeclared), carried over the wire.
- staterpc gains the admin-only AcceptPackageAuthority RPC;
  InstalledPackage carries accepted_authority.
This commit is contained in:
sam committed 2026-09-30 07:40:06 +10:00
1 parent c5a8942976
commit bf68866dca
16 files changed
+1144 -377

No files matched your search

@@ -10,13 +10,17 @@ INSERT INTO installed_package_requirements (org_id, package_name, required_name,
VALUES ($1, $2, $3, $4);
-- name: GetInstalledPackage :one
SELECT org_id, name, reference, digest, descriptor, layer, update_policy
SELECT org_id, name, reference, digest, descriptor, layer, update_policy, accepted_authority
FROM installed_packages WHERE org_id = $1 AND name = $2;
-- name: ListInstalledPackages :many
SELECT org_id, name, reference, digest, descriptor, layer, update_policy
SELECT org_id, name, reference, digest, descriptor, layer, update_policy, accepted_authority
FROM installed_packages WHERE org_id = $1 ORDER BY name;
-- name: AcceptInstalledPackageAuthority :execrows
UPDATE installed_packages SET accepted_authority = $3
WHERE org_id = $1 AND name = $2;
-- name: DeleteInstalledPackage :execrows
DELETE FROM installed_packages WHERE org_id = $1 AND name = $2;