micro / services

Real World Micro Services
Apache License 2.0
1.27k stars 139 forks source link

Support for private github repo #410

Closed domwong closed 2 years ago

domwong commented 2 years ago

Backend impl for new flow

  1. Ask user to install app; send them to https://github.com/apps/m3o-apps-dev/installations/new
  2. On success GH callback to m3o.com/?code=0f957374a642fe783c0c&installation_id=24302523&setup_action=install (GH -> FRONTEND)
  3. call https://api.m3o.com/github/authorize with the code and installation ID so we can store the installation ID and exchange code for a GH user token (FRONTEND -> BACKEND)
  4. M3O can now generate tokens to access source (endpoint to be called by App and Function services)

New endpoints /github/ListRepos and /github/ListBranches allows frontend to display available repos to run in app.

NOTE:

Only supports installation in a single org per user. TODO support multiple orgs for a single user

cyb3rko commented 2 years ago

Is it already documented anywhere so users know it is possible?