Repository navigation
Identify the accounts whose installations are used by ID - #142
Merged
Merged
Conversation
koroku uses the GitHub App's installations only on accounts it trusts: the owner's, matched by ID, and those in [github] installation_accounts, matched by login. A login is not a stable identity. When an organization is renamed its old name becomes free, and since the App has to be installable on any account to be installed on an organization at all, whoever registers that name and installs the App would have their installation, and their repositories, accepted. Add [github] installation_account_ids, a list of numeric account IDs (values <= 0 are rejected when the configuration is loaded). installation_accounts keeps working so that a host does not lose its installations on upgrade: an account in either list is used. Because the login list keeps the weakness for as long as it is there, koroku serve warns at startup when it is set. So that the operator finds the IDs without the GitHub API: - koroku check prints every installation's account with its ID. For an account matched by login only it prints the installation_account_ids line to write (the configured IDs included), and it warns about a login list that no used installation needs. The warning about installations on accounts koroku ignores now names their IDs. - GET /api/system/github returns account_id and login_only for each installation and installation_account_ids next to installation_accounts. The decision lives in config.GitHub.InstallationAccess, which the client's filter, the check and the API share, so that "used through the login alone" means the same thing in all three. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
The accounts whose installations koroku uses are listed in config.toml by numeric ID, and the operator should not need the GitHub API to find one. The GitHub App panel shows each installation's account ID under its login with a copy button, and the line it suggests for config.toml is installation_account_ids: the configured IDs, the installations that are not used yet, and the ones used through their login alone. An installation that is used only because its login is listed says so on its row, and the guide then tells the operator to remove the installation_accounts line: a login given up in a rename can be taken by another account. With nothing to list, the suggested line is a pattern and has no copy button, so that nobody pastes a line that does not parse. The mock API answers with account IDs, and its warnings scenario has an org matched by login, which the system-github-login screenshots show. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
koroku only uses the GitHub App's installations on accounts it trusts. The owner's account is matched by numeric ID, but the accounts in
[github] installation_accountswere matched by login. A login is not a stable identity: when an organization is renamed, its old name becomes free, and whoever takes it and installs the App would have their installation accepted.[github] installation_account_ids: a list of numeric account IDs.installation_accountskeeps working, so an existing host does not lose its installations on upgrade. While it is set,koroku servelogs a warning at startup andkoroku checkwarns. With both set, an installation is used when either matches.koroku checkprints each installation's account with its ID and the line to write; the system screen shows the ID next to each account, with a copy button, and the line forconfig.toml.SETUP recommends the ID form.
Screenshots
Test plan
go vet ./...,go vet -tags integration ./...,go test ./...pnpm lint,pnpm testkoroku checkoutput, the APIkoroku servestarted by hand with a throwaway configuration: the warning appears withinstallation_accountsand not with IDs only🤖 Generated with Claude Code