Giter Club home page Giter Club logo

Comments (1)

gr2m avatar gr2m commented on August 22, 2024

I had a query, I installed your app, but I am not sure how is it working, as far as I understand, after installation, you must have received a access token valid on my GitHub account but where did you stored that access token, as I never created account on WIP app website.

The act of installing an app grants the app access to all repositories that you added to that installation. With the credentials of the WIP app (ID and private key) and the ID of your installation, I can now create an installation access token. Using that token, I can now interact with resources in the repositories you granted the app access to, limited by the requested permission of the app.

The way the WIP works, and most GitHub Apps for that matter, is this

  1. GitHub sends a webhook request for a pull request to the configured URL of the WIP app. For example, the pull_request events are handled here:

    app/index.js

    Lines 12 to 21 in 5476d4a

    app.on(
    [
    "pull_request.opened",
    "pull_request.edited",
    "pull_request.labeled",
    "pull_request.unlabeled",
    "pull_request.synchronize",
    ],
    handlePullRequestChange.bind(null, app),
    );
  2. The payload includes the installation ID. The app is using that installation ID to create an access token. This is all taken care of by Octokit, GitHub's Official SDK. The webhook handler callback receives an object with an .octokit property, which is the octokit instance that is pre-authenticated using the installation access token. See this documentation for more information: https://github.com/octokit/octokit.js#webhooks

Hope that helps! I'll close this issue as there is nothing actionable for me, but feel free to ask follow up questions.

from app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.