Skip to content

github installation callback missing the "code" parameter #1879

Open
@motatoes

Description

@motatoes

in some cases github when an app installation is being updated it decides to not send a code paramter which we expect to recieve here:

func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
installationId := c.Request.URL.Query()["installation_id"][0]
//setupAction := c.Request.URL.Query()["setup_action"][0]
code := c.Request.URL.Query()["code"][0]
appId := c.Request.URL.Query().Get("state")
clientId, clientSecret, _, _, err := d.GithubClientProvider.FetchCredentials(appId)
if err != nil {
log.Printf("could not fetch credentials for the app: %v", err)

this causes an exception on callback and we need to handle it properly. The callback from github sometimes look like this: /github/callback?installation_id=1234567890&setup_action=update

In this case we need to handle a missing code parameter and then lookup the installation_id from the db records then perform the update accordingly somehow TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions