feat: implement GitHub platform auto-discovery from GitHub API#506
Conversation
|
@udaycodespace is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel. A member of the Team first needs to authorize it. |
CI — All Checks PassedBackend — PASS
Mobile — SKIP
Web — SKIP
Last updated: |
|
@Harxhit Fixed and pushed.
|
|
Hi @Harxhit, I noticed the backend CI is failing with:
The failure points to the line that was restored during the review: async (request: FastifyRequest, reply: FastifyReply) => {Would it be okay if I update it to: async (request: FastifyRequest, _reply: FastifyReply) => {This would keep the parameter in the handler signature while satisfying the lint rule. |
|
Hi @Harxhit, Just following up on this PR. The requested change has been pushed and the review comment addressed. Could you please take another look when you get a chance? Thanks! |
| try { await request.jwtVerify() } catch (e) { reply.status(401).send({ error: 'Unauthorized' }) } | ||
| try { await request.jwtVerify() } catch { reply.status(401).send({ error: 'Unauthorized' }) } | ||
| }], | ||
| }, async (request: FastifyRequest, reply: FastifyReply) => { |
There was a problem hiding this comment.
Could you please address this?
|
Congratulations @udaycodespace on getting PR #506 merged! Thank you for your contribution to the project. To receive the appropriate GSSoC labels and recognition, please mention @Harxhit in the #get-labels channel on our Discord server and share your merged PR link. |

Summary
Implements GitHub Platform Auto-Discovery (#32).
This PR adds a new authenticated endpoint,
GET /api/connect/github/autodiscover, which uses the user's connected GitHub account to discover platform links from their GitHub profile. The endpoint returns suggestions only and does not create any links automatically.To reduce unnecessary GitHub API requests, discovery results are cached in Redis for one hour. The implementation also handles missing, expired, or revoked GitHub tokens gracefully.
Closes #32
Type of Change
What Changed
GET /api/connect/github/autodiscover.github_followOAuth token flow to fetch GitHub profile data.How to Test
GET /api/connect/github/autodiscover.Checklist
pnpm -r run lintpasses).pnpm -r run typecheck).console.logor debug statements left in the code.Additional Context
Discovery Mapping
twitter_username→twitter(high confidence)dev.toURLs →devto(low confidence)hashnodeURLs →hashnode(low confidence)npmjsURLs →npm(low confidence)portfolio(high confidence)Caching
github:autodiscover:{userId}Tests Added