diff --git a/docs/plugins/github-apps.md b/docs/plugins/github-apps.md index 1bb2af8524..d3b0e36cd9 100644 --- a/docs/plugins/github-apps.md +++ b/docs/plugins/github-apps.md @@ -1,8 +1,8 @@ # Using GitHub Apps for Backend Authentication Backstage can be configured to use GitHub Apps for backend authentication. This -comes with advantages such as higher rate limits and that Backstage can act as an -application instead of a user or bot account. +comes with advantages such as higher rate limits and that Backstage can act as +an application instead of a user or bot account. It also provides a much clearer and better authorization model as a opposed to the OAuth apps and their respective scopes. @@ -10,8 +10,8 @@ the OAuth apps and their respective scopes. ## Caveats - It's not possible to have multiple Backstage GitHub Apps installed in the same - GitHub organization, to be handled by Backstage. We currently don't check through - all the registered GitHub Apps to see which ones are installed for a + GitHub organization, to be handled by Backstage. We currently don't check + through all the registered GitHub Apps to see which ones are installed for a particular repository. We only respect global Organization installs right now. - App permissions is not managed by Backstage. They're created with some simple default permissions which you are free to change as you need, but you will @@ -64,10 +64,14 @@ privateKey: | ### Including in Integrations Config -Once the credentials are stored in a yaml file generated by -`create-github-app` or manually by following the -[GitHub Enterprise](#gitHub-enterprise) instructions, they can be included in the -`app-config.yaml` under the `integrations` section. +Once the credentials are stored in a yaml file generated by `create-github-app` +or manually by following the [GitHub Enterprise](#gitHub-enterprise) +instructions, they can be included in the `app-config.yaml` under the +`integrations` section. + +Please note that the credentials file is highly sensitive and should NOT be +checked into any kind of version control. Instead use your preferred secure +method of distributing secrets. ```yaml integrations: diff --git a/packages/integration/src/github/GithubCredentialsProvider.ts b/packages/integration/src/github/GithubCredentialsProvider.ts index cb928a4a6c..843ef629ab 100644 --- a/packages/integration/src/github/GithubCredentialsProvider.ts +++ b/packages/integration/src/github/GithubCredentialsProvider.ts @@ -60,7 +60,9 @@ const HEADERS = { Accept: 'application/vnd.github.machine-man-preview+json', }; -// GithubAppManager issues tokens for a speicifc GitHub App +/** + * GithubAppManager issues and caches tokens for a specific GitHub App. + */ class GithubAppManager { private readonly appClient: Octokit; private readonly baseAuthConfig: { appId: number; privateKey: string };