← Back to issue list

snap installer: get assertion for the publisher's account id

View original Github issue

Metadata

Project
craft-providers
Number
#159
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #159 (commit 1fa7819): snap_installer now also collects the publisher's account assertion via `snap known account account-id=<id>` when injecting a snap, fixing rockcraft 309 'cannot resolve prerequisite assertion' errors.

Resolution: closed resolved

Reason: PR #159 by maintainer mr-cal was approved and merged, landing as commit 1fa7819 ("snap installer: get assertion for the publisher's account id (#159)"). The merged change adds an ["account", f"account-id={snap_publisher_id}"] query to _get_assertions_file() in craft_providers/actions/snap_installer.py, with unit test coverage in tests/unit/actions/test_snap_installer.py.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- ### Overview Adds another assertion when injecting a snap into a provider. ### Details @tigarmo and I saw this problem with revision 309 of rockcraft. The snap's publisher was unverified and produced the error: ``` error: cannot assert: assert failed: cannot resolve prerequisite assertion: account (pMLNwd28ezFdozetvrAOlLj3UqC9HKpe) ``` Looking into `rockcraft`'s snap info, it contains a publisher with a matching account id: ``` 'publisher': { 'id': 'pMLNwd28ezFdozetvrAOlLj3UqC9HKpe', 'username': 'sergiusens', 'display-name': 'Sergio Schvezov', 'validation': 'unproven' } ``` I assume the key `'validation': 'unproven'` is causing the error. To resolve this, `craft-providers` now collects the publisher account with `snap known account account-id=pMLNwd28ezFdozetvrAOlLj3UqC9HKpe` The assertion looks like this: ``` type: account authority-id: canonical revision: 223 account-id: pMLNwd28ezFdozetvrAOlLj3UqC9HKpe display-name: Sergio Schvezov timestamp: 2022-09-23T08:30:19.896972Z username: sergiusens validation: unproven sign-key-sha3-384: BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul ... ``` It appears to be a working and valid solution for the current rockcraft snap. There are no regressions for snapcraft or charmcraft.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #159 (commit 1fa7819): snap_installer now also collects the publisher's account assertion via `snap known account account-id=<id>` when injecting a snap, fixing rockcraft 309 'cannot resolve prerequisite assertion' errors.
qwen/qwen3.6-35b-a3b — closed resolved Fixed in craft-providers by fetching and injecting the publisher's account assertion, resolving cannot resolve prerequisite assertion errors for unverified publishers.

Update history

Date Change
created

Related work

  • Related To: canonical/craft-providers#153 (confidence 80%)

    Preceding PR b0d058a 'snap installer: assert injected snaps' (#153) introduced the assertion injection mechanism this PR extends.

  • Caused By: rockcraft#0 (confidence 40%)

    Placeholder — issue was triggered by rockcraft revision 309, an unproven publisher; no verifiable linked ref.

Related issues

Issue Project State Summary Similarity
#153 snap installer: assert injected snaps craft-providers merged Merged PR #153 as commit b0d058a, adding snap known/ack assertion handling for signed injected snaps while preserving dangerous installation for unsigned snaps.
72%