Skip to main content
githubSyncUserCredentials holds one document per user who linked a GitHub account for GitHub Sync. It stores the user’s OAuth access token, encrypted. It belongs to the github-sync web module (services/web/modules/github-sync). The schema is in services/web/modules/github-sync/app/models/githubSyncUserCredentials.mjs, and all access goes through services/web/modules/github-sync/app/src/TokenManager.mjs.

Fields

Only the access token is stored: the OAuth callback keeps access_token from GitHub’s answer (services/web/modules/github-sync/app/src/GitHubApiClient.mjs:180-191). There is no refresh token or expiry.

Who Writes It

Who Reads It

Indexes

Mongoose autoIndex is off (services/web/app/src/infrastructure/Mongoose.mjs:7), so the schema’s unique: true on userId creates nothing. tools/migrations/20190912145011_create_githubSyncUserCredentials_indexes.mjs (upstream’s user_id) is tagged saas only and does not run in CE.

Notes

  • Changing GITHUB_TOKEN_CIPHER_PASSWORD makes the stored tokens unreadable. Those users then count as not linked until they link again.
  • A deleted user keeps the document until the user expires.
Last modified on November 14, 2026