Skip to content

feat: Register GitHub OAuth app and configure environment#4

Open
charliewwdev wants to merge 3 commits intomainfrom
feat/register-github-oauth-app-and-configure-environmen
Open

feat: Register GitHub OAuth app and configure environment#4
charliewwdev wants to merge 3 commits intomainfrom
feat/register-github-oauth-app-and-configure-environmen

Conversation

@charliewwdev
Copy link
Copy Markdown
Member

Create OAuth app in GitHub org settings, document required env vars (GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_CALLBACK_URL), add to .env.example and secret management.


Generated by OpenDev AI

Three deliverables: (1) .env.example documents every environment variable the service uses, with inline setup instructions for registering the GitHub OAuth app and the required callback URL; (2) src/github-oauth.ts provides a fully-typed GitHubOAuthClient that covers the complete OAuth lifecycle — building the authorization URL, exchanging the code for a token, fetching the authenticated user, and revoking the token on disconnect; (3) tests/github-oauth.test.ts covers config validation, happy-path token exchange, error propagation from GitHub's error envelope, and user fetch. Zod is used (already a dependency) for runtime validation of the env config and GitHub API responses, giving precise error messages for misconfiguration without adding new packages. The loadGitHubOAuthConfig function is exported separately so it can be called once at startup and the resulting config object passed around, avoiding repeated env reads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant