Skip to content
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

adds the ability to access grants API data via API KEYs #8494

Merged
merged 2 commits into from
Mar 8, 2021

Conversation

owocki
Copy link
Contributor

@owocki owocki commented Mar 5, 2021

Description

These API calls require you to be authenticated as a team member of a grant:

This was a problem for a few users who wanted to script access to this data, and these users wanted to do a major promotion of Gitocin Grants Round 9, so I whipped up this PR to help them.

Authentication on Gitcoin is primary centric around our user model, which (for now) is dependant upon Github. If you are accessing the data programmatically, you may not be able to handle the Github authentication cycle, and for that reason we have begun providing limited access to this data via an API Key / Secret model. Here's how it works.

  1. Access any API which requires authorization via the standard authentication flow in browser.
  2. You will be issued credentials, which you can find in the response: body.meta.api_key.
  3. You may now access the API using the API credentials at URL?_key=YOUR_KEY&_secret=YOUR_SECRET.
Refers/Fixes

https://discord.com/channels/562828676480237578/799328822163931187/817338886787039292

Testing

tested locally

@Buttaa
Copy link

Buttaa commented Mar 5, 2021

https://beaconcha.in/

image

@thelostone-mc
Copy link
Member

thelostone-mc commented Mar 7, 2021

@owocki PR LGTM but I'm gonna get this onto gpg/landing just to avoid conflicts

@thelostone-mc thelostone-mc changed the base branch from master to gpg/grants-landing March 7, 2021 08:41
@owocki
Copy link
Contributor Author

owocki commented Mar 7, 2021

no the cred auto-creates when a user accesses an API that needs it. 1 per user

@octavioamu octavioamu merged commit ea7f281 into gpg/grants-landing Mar 8, 2021
@Buttaa
Copy link

Buttaa commented Mar 8, 2021

hi @octavioamu , I would really appreciate it if this was deployed ASAP, so we can test it on our end before the next round. :) ❤️

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.

None yet

5 participants