fix: allow GitHub API requests in CSP - #1054
Conversation
|
@amanyadavkr098-bot is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@komalharshita please review this PR for any updates. |
|
@komalharshita / maintainers please review this PR |
|
@komalharshita please verify this PR FOR ANY CHANGES REQUIRED. |
|
@komalharshita please review this PR for any Updates....... |
|
@komalharshita pls review this PR |
|
@komalharshita please go through this PR |
1 similar comment
|
@komalharshita please go through this PR |
|
@komalharshita please review this PR |
2 similar comments
|
@komalharshita please review this PR |
|
@komalharshita please review this PR |
|
@amanyadavkr098-bot kindly resolve the merge conflicts |
|
@komalharshita please review this Pr the merge conflict is resolved |
|
Thanks for addressing this issue! The fix is straightforward and resolves the CSP restriction that was preventing GitHub API requests from reaching https://api.github.com. Updating the Content Security Policy while removing the duplicate CSP assignment keeps the implementation clean and restores the GitHub skill import functionality without introducing unnecessary changes. The scope is well-defined, directly addresses the reported bug, and the testing steps are clear. Nice work! Approved for merge. ✅ |
Summary [required]
This PR fixes the GitHub Skill Import feature, which was failing due to a Content Security Policy (CSP) restriction. The application attempted to fetch repository data directly from the GitHub API, but the existing CSP configuration only allowed connections to the application's own origin (
'self'). As a result, GitHub API requests were blocked by the browser and users were unable to import skills from their GitHub profiles.The CSP has been updated to allow requests to
https://api.github.com, restoring the GitHub skill import functionality.Related Issue [required]
Closes #1024
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
app.pyhttps://api.github.comand removed the duplicate CSP assignment block.How to Test This PR [required]
Clone this branch:
Install dependencies:
Run the application:
Open
http://127.0.0.1:5000Click Import from GitHub
Enter a valid GitHub username (e.g.
torvalds)Click Fetch Skills
Verify that skills are successfully imported and no CSP errors appear in the browser console.
Run tests:
Expected Result
Content-Security-Policyerrors appear in the browser console.Test Results [required]
Screenshots (if UI change)
Not applicable (no UI changes).
Self-Review Checklist [required]
fix/python tests/test_basic.pyand all tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
The GitHub Skill Import feature was failing because the browser blocked requests to the GitHub API due to the CSP directive:
This PR updates the directive to:
allowing the existing GitHub integration to function as intended without modifying application logic.