Skip to content

feat(backend): restrict builds to an owner allowlist - #26

Draft
kradalby wants to merge 1 commit into
OSSystems:selfhostfrom
kradalby:feat/owner-allowlist
Draft

kradalby wants to merge 1 commit into
OSSystems:selfhostfrom
kradalby:feat/owner-allowlist

Conversation

@kradalby

@kradalby kradalby commented Sep 9, 2026

Copy link
Copy Markdown

assertIsAllowedToBuild consults a denylist only, so on a self-hosted instance anyone who installs the GitHub App can spend your builders. This adds the inverse.

GARNIX_ALLOWED_OWNERS is a comma-separated list of owners permitted to build. Unset, empty, or separators-only keeps the current allow-all, so existing deployments are unaffected.

The decision is two pure functions rather than inline logic in the monad, so it is testable without a database. Both sides of the comparison go through normalizeGhLogin: GitHub logins are case-insensitive but GhLogin compares as plain Text, and what an operator types into a deployment is not necessarily the casing the webhook carries. Without that, KraDalby in the env var locks out kradalby with no error anywhere.

Generated with the help of an AI assistant

Upstream gating is denylist-only, so any installation could build. Self-hosts
need the inverse. Unset keeps allow-all. Logins are compared case-insensitively:
what an operator types is not necessarily the casing GitHub sends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant