-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gnofaucet): Github middleware with cooldown #3808
base: master
Are you sure you want to change the base?
feat(gnofaucet): Github middleware with cooldown #3808
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
I didn't follow up on this 🤦♂️ I think the general idea of this PR is good, but the execution needs to be changed a bit. I'm not sure if we should require a GitHub app for verification. Is there a workaround for this? We would add a button on the modal UI for this specific network that says "Connect GitHub" or something similar, and the middleware should check if the user's account matches some criteria (we'll define it, no worries). cc @alexiscolin |
Hello thanks for taking a look :) I think there is not a way ensure user is owner of that account without having a Github Oauth app but I'll take a look. (If problem is the difficulty, whole process takes like 30 seconds). |
Yes, we have to make sure user the gh owner, username is not sufficient. |
Got it, so there is no way to avoid the GH app. The permissions it requires should be suuuuuuuper minimal @alexiscolin How do you think the flow should look like on the Faucet Hub modal? |
@alexiscolin for reference, https://gnolove.world/ has GitHub & Adena integration |
related to #3781
Related faucet-hub PR:
gnolang/faucet-hub#41
This pull request introduces two key features to gnofaucet:
getGithubMiddleware: A new middleware that checks for a code query parameter in the URL. It attempts to exchange this code for a GitHub token via OAuth. If the code is valid, the middleware retrieves the GitHub login associated with the token.
Cooldown Period: This feature allows for a configurable cooldown period (1 hour in this case). If the user attempts to claim tokens again before the cooldown period expires, the middleware will reject the request.
Additionally, we could enhance the functionality by implementing checks for account age, pull requests, commits, or verifying if the user belongs to a specific organization.
screen-capture.8.webm