Files
windmill/backend/windmill-common
a718720fd6 fix: let non-admins read an admin-approved GitHub App repository (#12524)
* fix: let non-admins read an admin-approved GitHub App repository

An admin's save of an app-backed git_repository resource records the url
it resolves to in github_app_repo_approval. Non-admins who can read the
resource are then served that repository through the installation, by
repo_archive and git_commit_hash, until the url (or a $var: it names)
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep the approved repository url on the resource row

A path-keyed approval table outlived its resource through every writer
that moves or deletes resources by path (username rename, offboarding,
deletes), so a new resource at a freed path could inherit an approval.
On the row, it follows renames and dies with the resource.

Also: an unresolvable $var: no longer fails an admin's save, and the
admin-or-not caller reuses GitRemoteCaller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: record the approved repository after the write commits

Resolving a $var: url takes a second pool connection and maybe a secret
backend, which must not be held under the write's row lock. The update
applies only while the row still holds the url the admin saved, and an
admin save that names no app-backed repository clears the approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: point the EE ref at the GitHub App approval branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep approvals in a side table and approve only literal urls

The approval moves from a resource column to github_app_repo_approval,
whose FK cascades on resource renames and deletes like resource_version.

It is now written in the admin's write transaction, from the saved row,
so it commits with the value it approves and a delayed approval can no
longer undo a later revocation. Only a save that carries the value, and
only a literal url, is approved: a $var: resolves to whatever its owner
sets, which the admin never saw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update ee-repo-ref to 2d094f0018c2474cbc47f2e6e81f7d53e158f87d

This commit updates the EE repository reference after PR #993 was merged in windmill-ee-private.

Previous ee-repo-ref: 2080e6f837108b6a3c0439b96257df66583cc487

New ee-repo-ref: 2d094f0018c2474cbc47f2e6e81f7d53e158f87d

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
2026-11-18 22:51:17 +01:00
..