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

refactor: redesign instagram api #117

Merged
merged 8 commits into from
Aug 14, 2023
Merged

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Jul 7, 2023

Description

This PR redesign Instagram API to fit the official provided OAuth process:
https://developers.facebook.com/docs/instagram-api/reference/ig-user/

Update: 08:40:00, Aug 10, 2023 UTC:+0
Currently, it is impossible to get user biography by official API since it does not provide biography field, see:
https://developers.facebook.com/docs/marketing-api/reference/instagram-user/

In order to implement the application link process, we can only query the latest media posted by the given user, then store it into Themis cache for validating its proof later on.

Therefore, the whole process linking address to Instagram account would be like:

  1. users get access token with instagram_graph_user_profile and instagram_graph_user_media permissions
  2. users post their access token to Themis
  3. Themis retrieve the latest user media including proof URL by access token then cache it
  4. users send the link application request to Desmos
  5. users wait for the validation process passed

Checklist

  • Targeted PR against correct branch.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit tests.
  • Updated the documentation.
  • Re-reviewed Files changed in the Github PR explorer.

Comment on lines -26 to -29
user, err := suite.api.GetUser("leobragaz")
suite.Require().NoError(err)
suite.Require().NotEmpty(user.Username)
}
Copy link
Contributor Author

@dadamu dadamu Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the test since it requires accessToken right now, we should not post the token for security issue.

@dadamu dadamu marked this pull request as ready for review August 14, 2023 08:52
@dadamu dadamu requested a review from RiccardoM August 14, 2023 08:53
@RiccardoM RiccardoM changed the title feat: redesign instagram api refactor: redesign instagram api Aug 14, 2023
@RiccardoM RiccardoM merged commit 0bbeca0 into main Aug 14, 2023
7 checks passed
@RiccardoM RiccardoM deleted the paul/SDK-19/add-instagram-api branch August 14, 2023 16:37
RiccardoM pushed a commit that referenced this pull request Aug 14, 2023
…122)

<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰    
v    Before smashing the submit button please review the checkboxes.
v If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description
<!-- Small description -->

This PR updates the Instagram data source to get media instead of
biography.

Depends-On: #117 

## Checklist
- [ ] Targeted PR against correct branch.
- [ ] Linked to Github issue with discussion and accepted design OR link
to spec that describes this work.
- [ ] Wrote unit tests.
- [ ] Updated the documentation. 
- [ ] Re-reviewed `Files changed` in the Github PR explorer.
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.

2 participants