Allow use of client id as an app id (#4057)

This commit is contained in:
Nikola Jokic
2025-05-16 16:21:06 +02:00
committed by GitHub
parent 43f1cd0dac
commit 1dbb88cb9e
8 changed files with 59 additions and 47 deletions
+3 -7
View File
@@ -23,7 +23,8 @@ type multiClient struct {
}
type GitHubAppAuth struct {
AppID int64
// AppID is the ID or the Client ID of the application
AppID string
AppInstallationID int64
AppPrivateKey string
}
@@ -124,16 +125,11 @@ func (m *multiClient) GetClientFromSecret(ctx context.Context, githubConfigURL,
return m.GetClientFor(ctx, githubConfigURL, auth, namespace, options...)
}
parsedAppID, err := strconv.ParseInt(appID, 10, 64)
if err != nil {
return nil, err
}
parsedAppInstallationID, err := strconv.ParseInt(appInstallationID, 10, 64)
if err != nil {
return nil, err
}
auth.AppCreds = &GitHubAppAuth{AppID: parsedAppID, AppInstallationID: parsedAppInstallationID, AppPrivateKey: appPrivateKey}
auth.AppCreds = &GitHubAppAuth{AppID: appID, AppInstallationID: parsedAppInstallationID, AppPrivateKey: appPrivateKey}
return m.GetClientFor(ctx, githubConfigURL, auth, namespace, options...)
}