← Back to issue list

remote-build: Use personal access tokens

View original Github issue

Metadata

Project
snapcraft
Number
#4270
Type
pull request
State
merged
Author
cjwatson
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #4270 as 7c80a055b, replacing deprecated Launchpad bearer macaroons with scoped, revocable, short-lived personal access tokens for remote builds.

Resolution: closed resolved

Reason: PR #4270 was merged into main as commit 7c80a055b. It updates snapcraft remote-build to use Launchpad personal access tokens with explicit scopes and expiry.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The initial mechanism used by Launchpad to grant temporary access tokens to `snapcraft remote-build` was a bit of a hack. They were essentially pure bearer tokens (implemented as macaroons) that weren't recorded anywhere on the Launchpad side, which meant that there was no mechanism for revoking them. We mitigated this with a hardcoded expiry time, but it wasn't great. We now have a new "personal access tokens" mechanism, which is much better. These tokens show up in a "Manage access tokens" page on the repository and can be revoked by the owner; they have more specific control of the access scopes they grant, and the caller can specify an expiry time. The old mechanism is now deprecated, and we intend to remove it after a suitable transition period. This commit changes `snapcraft remote-build` to use the new mechanism. The unit tests can essentially only confirm that it's passing the expected arguments to the Launchpad API, so I've also run an end-to-end manual test against Launchpad production to make sure that those arguments have the intended effect. We can use a very tight expiry time here, since it only has to last for long enough for the `git push` process to _start_. It's OK to increase it a little if needed, but it's generally good for token lifetimes to be short where possible. - [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `pytest tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #4270 as 7c80a055b, replacing deprecated Launchpad bearer macaroons with scoped, revocable, short-lived personal access tokens for remote builds.
stealth/space-bunny-alpha — closed resolved PR #4270 by cjwatson merged as commit 7c80a055b, switching `snapcraft remote-build` from deprecated Launchpad bearer tokens (macaroons) to the new personal access tokens API with scoped, revocable, short-lived credentials.
stealth/space-bunny-alpha — closed resolved Merged PR #4270 as commit 7c80a055b, replacing deprecated Launchpad bearer tokens with scoped, revocable, short-lived personal access tokens for remote-build.
qwen/qwen3.6-35b-a3b — — Merged. Replaces deprecated bearer tokens in snapcraft remote-build with Launchpad's new personal access tokens, enabling revocation, scoped access, and configurable expiry. Approved, passed CI, and achieved 100% test coverage.
qwen3.6-35b-a3b-mtp-q6 — — Merged into main. Replaced deprecated Launchpad bearer tokens with the new personal access token mechanism for snapcraft remote-build. Includes manual testing, tight expiry times, and 100% test coverage.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2759 remote-build: https token support snapcraft merged Merged remote-build HTTPS token support after retargeting and rebasing through prerequisite PR #2760.
75%
#1827679 Update remote build login when Launchpad infrastructure is ready snapcraft (launchpad) closed Remote builds now authenticate with Launchpad personal access tokens instead of SSH keys via snapcraft#4270 (commit 7c80a055b).
74%
#2825 remote-build: remove need to specify user snapcraft merged Merged #2825, removing the remote-build user requirement and adding automatic Launchpad login; it also fixed public-upload handling and cleaned up LaunchpadClient.
71%