feat(catalog): implement discovery by GitHub app

Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
Benjamin Janssens
2025-05-08 16:33:25 +02:00
parent e6d91b40e9
commit 7810e8d998
4 changed files with 81 additions and 24 deletions
@@ -201,9 +201,11 @@ class GithubAppManager {
export class GithubAppCredentialsMux {
private readonly apps: GithubAppManager[];
constructor(config: GithubIntegrationConfig) {
constructor(config: GithubIntegrationConfig, appIds: number[] = []) {
this.apps =
config.apps?.map(ac => new GithubAppManager(ac, config.apiBaseUrl)) ?? [];
config.apps
?.filter(app => (appIds.length ? appIds.includes(app.appId) : true))
.map(ac => new GithubAppManager(ac, config.apiBaseUrl)) ?? [];
}
async getAllInstallations(): Promise<